From 9972ca4732e769f20a677d29c334380709a24395 Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Mon, 22 Sep 2025 17:13:57 -0700 Subject: [PATCH 1/3] Upgrade baton-sdk to v0.4.2. Fix lint errors. --- .github/workflows/ci.yaml | 21 +- .github/workflows/main.yaml | 15 +- go.mod | 6 +- go.sum | 8 +- pkg/connector/enterprise_role.go | 2 +- pkg/connector/invitation.go | 4 +- .../baton-sdk/internal/connector/connector.go | 4 +- .../v2/annotation_resource_tree.pb.go | 52 +- .../annotation_resource_tree.pb.validate.go | 99 + .../c1/connector/v2/annotation_sync_id.pb.go | 130 ++ .../v2/annotation_sync_id.pb.validate.go | 137 ++ .../pb/c1/connector/v2/connector.pb.go | 79 +- .../pb/c1/connector/v2/event_feed.pb.go | 443 +++- .../c1/connector/v2/event_feed.pb.validate.go | 512 +++++ .../pb/c1/connector/v2/resource.pb.go | 1534 ++++++++----- .../c1/connector/v2/resource.pb.validate.go | 1027 ++++++++- .../pb/c1/connectorapi/baton/v1/baton.pb.go | 867 ++++---- .../baton/v1/baton.pb.validate.go | 33 + .../pb/c1/connectorapi/baton/v1/session.pb.go | 997 +++++++++ .../baton/v1/session.pb.validate.go | 1903 +++++++++++++++++ .../connectorapi/baton/v1/session_grpc.pb.go | 392 ++++ .../baton-sdk/pkg/annotations/annotations.go | 11 + .../conductorone/baton-sdk/pkg/bid/bid.go | 7 +- .../conductorone/baton-sdk/pkg/cli/cli.go | 13 +- .../baton-sdk/pkg/cli/commands.go | 47 +- .../baton-sdk/pkg/cli/lambda_server__added.go | 47 +- .../baton-sdk/pkg/config/config.go | 4 +- .../pkg/connectorbuilder/connectorbuilder.go | 192 +- .../baton-sdk/pkg/connectorrunner/runner.go | 11 +- .../pkg/connectorstore/connectorstore.go | 22 +- .../baton-sdk/pkg/crypto/client_secret.go | 56 + .../baton-sdk/pkg/crypto/crypto.go | 123 ++ .../baton-sdk/pkg/crypto/password.go | 10 +- .../baton-sdk/pkg/crypto/providers/jwk/jwk.go | 29 +- .../pkg/crypto/providers/registry.go | 33 +- .../baton-sdk/pkg/dotc1z/c1file.go | 172 +- .../baton-sdk/pkg/dotc1z/c1file_attached.go | 142 ++ .../baton-sdk/pkg/dotc1z/clone_sync.go | 4 +- .../baton-sdk/pkg/dotc1z/decoder.go | 36 +- .../conductorone/baton-sdk/pkg/dotc1z/diff.go | 3 +- .../baton-sdk/pkg/dotc1z/dotc1z.go | 6 +- .../conductorone/baton-sdk/pkg/dotc1z/file.go | 10 +- .../pkg/dotc1z/manager/local/local.go | 22 +- .../baton-sdk/pkg/dotc1z/manager/manager.go | 15 +- .../baton-sdk/pkg/dotc1z/manager/s3/s3.go | 24 +- .../baton-sdk/pkg/dotc1z/sql_helpers.go | 49 +- .../baton-sdk/pkg/dotc1z/sync_runs.go | 184 +- .../baton-sdk/pkg/field/defaults.go | 16 +- .../baton-sdk/pkg/field/validation.go | 2 +- .../pkg/lambda/grpc/config/config.go | 68 +- .../baton-sdk/pkg/lambda/grpc/transport.go | 81 +- .../baton-sdk/pkg/provisioner/provisioner.go | 14 +- .../pkg/ratelimit/mem_ratelimiter.go | 13 +- .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../baton-sdk/pkg/session/README.md | 14 + .../baton-sdk/pkg/session/grpc_session.go | 373 ++++ .../baton-sdk/pkg/session/json.go | 136 ++ .../baton-sdk/pkg/session/memory.go | 220 ++ .../baton-sdk/pkg/session/session.go | 63 + .../baton-sdk/pkg/sync/client_wrapper.go | 223 ++ .../baton-sdk/pkg/sync/expand/cycle.go | 151 +- .../baton-sdk/pkg/sync/expand/graph.go | 56 + .../baton-sdk/pkg/sync/expand/scc/bitset.go | 131 ++ .../baton-sdk/pkg/sync/expand/scc/scc.go | 649 ++++++ .../pkg/sync/expand/scc/test_source.go | 24 + .../conductorone/baton-sdk/pkg/sync/state.go | 56 +- .../conductorone/baton-sdk/pkg/sync/syncer.go | 256 ++- .../pkg/synccompactor/attached/attached.go | 95 + .../baton-sdk/pkg/synccompactor/compactor.go | 111 +- .../pkg/tasks/c1api/delete_resource.go | 3 +- .../baton-sdk/pkg/tasks/c1api/full_sync.go | 56 +- .../baton-sdk/pkg/tasks/c1api/manager.go | 2 +- .../pkg/tasks/c1api/service_client.go | 33 + .../baton-sdk/pkg/tasks/local/syncer.go | 8 + .../baton-sdk/pkg/types/session_cache.go | 58 + .../conductorone/baton-sdk/pkg/types/types.go | 2 +- .../pkg/ugrpc/c1_credential_provider.go | 44 +- .../baton-sdk/pkg/ugrpc/interceptors.go | 133 ++ .../baton-sdk/pkg/uhttp/dbcache.go | 2 +- .../baton-sdk/pkg/uhttp/wrapper.go | 26 +- .../conductorone/baton-sdk/pkg/us3/s3.go | 1 - .../github.com/klauspost/compress/README.md | 140 +- .../klauspost/compress/huff0/bitreader.go | 25 +- .../klauspost/compress/internal/le/le.go | 5 + .../compress/internal/le/unsafe_disabled.go | 42 + .../compress/internal/le/unsafe_enabled.go | 55 + vendor/github.com/klauspost/compress/s2sx.mod | 3 +- .../klauspost/compress/zstd/README.md | 2 +- .../klauspost/compress/zstd/bitreader.go | 37 +- .../klauspost/compress/zstd/blockdec.go | 19 - .../klauspost/compress/zstd/blockenc.go | 27 +- .../klauspost/compress/zstd/decoder.go | 3 +- .../klauspost/compress/zstd/enc_base.go | 2 +- .../compress/zstd/matchlen_generic.go | 11 +- .../klauspost/compress/zstd/seqdec.go | 2 +- .../klauspost/compress/zstd/seqdec_amd64.s | 64 +- .../klauspost/compress/zstd/seqdec_generic.go | 2 +- .../klauspost/compress/zstd/seqenc.go | 2 - .../klauspost/compress/zstd/snappy.go | 4 +- .../klauspost/compress/zstd/zstd.go | 7 +- vendor/modules.txt | 12 +- 101 files changed, 11240 insertions(+), 1883 deletions(-) create mode 100644 vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.validate.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.validate.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session_grpc.pb.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/crypto/client_secret.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/session/README.md create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/session/grpc_session.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/session/json.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/session/memory.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/session/session.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/sync/client_wrapper.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/bitset.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/scc.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/test_source.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/types/session_cache.go create mode 100644 vendor/github.com/klauspost/compress/internal/le/le.go create mode 100644 vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go create mode 100644 vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41cc690b..31027cc3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,31 +4,30 @@ jobs: go-lint: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.23.x - - name: Checkout code - uses: actions/checkout@v3 + go-version-file: go.mod - name: Run linters uses: golangci/golangci-lint-action@v8 with: - version: v2.1.6 + version: latest args: --timeout=3m go-test: strategy: matrix: - go-version: [1.23.x] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - - name: Install Go + - name: Checkout code if: success() - uses: actions/setup-go@v4 + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v3 + go-version-file: go.mod - name: go tests run: go test -v -covermode=count -json ./... > test.json - name: annotate go tests diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 92410421..c5e43291 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,12 +7,12 @@ jobs: go-lint: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.23.x - - name: Checkout code - uses: actions/checkout@v4 + go-version-file: go.mod - name: Run linters uses: golangci/golangci-lint-action@v8 with: @@ -21,17 +21,16 @@ jobs: go-test: strategy: matrix: - go-version: [ 1.23.x ] platform: [ ubuntu-latest ] runs-on: ${{ matrix.platform }} steps: - - name: Install Go + - name: Checkout code if: success() + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v4 + go-version-file: go.mod - name: go tests run: go test -v -covermode=count -json ./... > test.json - name: annotate go tests diff --git a/go.mod b/go.mod index 195ac6a3..4d01443d 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/conductorone/baton-github -go 1.23.4 +go 1.25 require ( - github.com/conductorone/baton-sdk v0.3.30 + github.com/conductorone/baton-sdk v0.4.2 github.com/deckarep/golang-set/v2 v2.8.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/golang-jwt/jwt/v5 v5.2.2 @@ -70,7 +70,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jellydator/ttlcache/v3 v3.3.0 // indirect - github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/compress v1.18.0 // indirect github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect github.com/magiconair/properties v1.8.9 // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/go.sum b/go.sum index f8d9d4e2..5df91713 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/conductorone/baton-sdk v0.3.30 h1:KR6r1pMpssQW6EgcSMOvtmBpkd08KX1bGtvUUGSXqek= -github.com/conductorone/baton-sdk v0.3.30/go.mod h1:L55WO3ERMx1mfpjDgwK3jWNRGRF2E76WrQHmW6ev8VY= +github.com/conductorone/baton-sdk v0.4.2 h1:hj/aXdaz850EVqnErw9DN/+3864LSdVcwa6p3vMrAfI= +github.com/conductorone/baton-sdk v0.4.2/go.mod h1:Csa1C2KrI4TxJAtC3WjQqOn24u0g2f4/5FgiYqZWpN4= github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o= github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s= @@ -155,8 +155,8 @@ github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHT github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/pkg/connector/enterprise_role.go b/pkg/connector/enterprise_role.go index 7da06449..5aa60ab8 100644 --- a/pkg/connector/enterprise_role.go +++ b/pkg/connector/enterprise_role.go @@ -119,7 +119,7 @@ func (o *enterpriseRoleResourceType) Entitlements( entitlement.WithDisplayName(resource.DisplayName), entitlement.WithDescription(fmt.Sprintf("Assignment to %s enterprise role in GitHub", resource.DisplayName)), entitlement.WithAnnotation(&v2.V1Identifier{ - Id: fmt.Sprintf(resource.Id.Resource), + Id: resource.Id.Resource, }), entitlement.WithGrantableTo(resourceTypeUser), )) diff --git a/pkg/connector/invitation.go b/pkg/connector/invitation.go index 6d4a8a3e..d4cae673 100644 --- a/pkg/connector/invitation.go +++ b/pkg/connector/invitation.go @@ -45,6 +45,8 @@ type invitationResourceType struct { orgs []string } +var _ connectorbuilder.AccountManager = &invitationResourceType{} + func (i *invitationResourceType) ResourceType(_ context.Context) *v2.ResourceType { return resourceTypeInvitation } @@ -122,7 +124,7 @@ func (i *invitationResourceType) CreateAccountCapabilityDetails(ctx context.Cont func (i *invitationResourceType) CreateAccount( ctx context.Context, accountInfo *v2.AccountInfo, - credentialOptions *v2.CredentialOptions, + credentialOptions *v2.LocalCredentialOptions, ) ( connectorbuilder.CreateAccountResponse, []*v2.PlaintextData, diff --git a/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go b/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go index 45642ad3..c5898902 100644 --- a/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go +++ b/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go @@ -303,11 +303,11 @@ func (cw *wrapper) C(ctx context.Context) (types.ConnectorClient, error) { var dialErr error var conn *grpc.ClientConn for { - conn, err = grpc.DialContext( //nolint:staticcheck // grpc.DialContext is deprecated but we are using it still. + conn, err = grpc.DialContext( //nolint:staticcheck // grpc.DialContext is deprecated but we are using it still for compatibility ctx, fmt.Sprintf("127.0.0.1:%d", listenPort), grpc.WithTransportCredentials(credentials.NewTLS(clientTLSConfig)), - grpc.WithBlock(), //nolint:staticcheck // grpc.WithBlock is deprecated but we are using it still. + grpc.WithBlock(), //nolint:staticcheck // grpc.WithBlock is deprecated but we are using it still for compatibility grpc.WithChainUnaryInterceptor(ratelimit2.UnaryInterceptor(cw.now, cw.rlDescriptors...)), grpc.WithStatsHandler(otelgrpc.NewClientHandler( otelgrpc.WithPropagators( diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.go index 75d893a7..61612ece 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.go @@ -101,6 +101,42 @@ func (*SkipEntitlementsAndGrants) Descriptor() ([]byte, []int) { return file_c1_connector_v2_annotation_resource_tree_proto_rawDescGZIP(), []int{1} } +type SkipGrants struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SkipGrants) Reset() { + *x = SkipGrants{} + mi := &file_c1_connector_v2_annotation_resource_tree_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SkipGrants) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SkipGrants) ProtoMessage() {} + +func (x *SkipGrants) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_resource_tree_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SkipGrants.ProtoReflect.Descriptor instead. +func (*SkipGrants) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_annotation_resource_tree_proto_rawDescGZIP(), []int{2} +} + var File_c1_connector_v2_annotation_resource_tree_proto protoreflect.FileDescriptor var file_c1_connector_v2_annotation_resource_tree_proto_rawDesc = string([]byte{ @@ -113,11 +149,12 @@ var file_c1_connector_v2_annotation_resource_tree_proto_rawDesc = string([]byte{ 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x53, 0x6b, 0x69, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x41, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 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, + 0x65, 0x6e, 0x74, 0x73, 0x41, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x0c, 0x0a, + 0x0a, 0x53, 0x6b, 0x69, 0x70, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 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, }) var ( @@ -132,10 +169,11 @@ func file_c1_connector_v2_annotation_resource_tree_proto_rawDescGZIP() []byte { return file_c1_connector_v2_annotation_resource_tree_proto_rawDescData } -var file_c1_connector_v2_annotation_resource_tree_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_c1_connector_v2_annotation_resource_tree_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_c1_connector_v2_annotation_resource_tree_proto_goTypes = []any{ (*ChildResourceType)(nil), // 0: c1.connector.v2.ChildResourceType (*SkipEntitlementsAndGrants)(nil), // 1: c1.connector.v2.SkipEntitlementsAndGrants + (*SkipGrants)(nil), // 2: c1.connector.v2.SkipGrants } var file_c1_connector_v2_annotation_resource_tree_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -156,7 +194,7 @@ func file_c1_connector_v2_annotation_resource_tree_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_resource_tree_proto_rawDesc), len(file_c1_connector_v2_annotation_resource_tree_proto_rawDesc)), NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.validate.go index 4a36fde5..36e768bd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.validate.go @@ -240,3 +240,102 @@ var _ interface { Cause() error ErrorName() string } = SkipEntitlementsAndGrantsValidationError{} + +// Validate checks the field values on SkipGrants with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *SkipGrants) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SkipGrants with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in SkipGrantsMultiError, or +// nil if none found. +func (m *SkipGrants) ValidateAll() error { + return m.validate(true) +} + +func (m *SkipGrants) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return SkipGrantsMultiError(errors) + } + + return nil +} + +// SkipGrantsMultiError is an error wrapping multiple validation errors +// returned by SkipGrants.ValidateAll() if the designated constraints aren't met. +type SkipGrantsMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SkipGrantsMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SkipGrantsMultiError) AllErrors() []error { return m } + +// SkipGrantsValidationError is the validation error returned by +// SkipGrants.Validate if the designated constraints aren't met. +type SkipGrantsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SkipGrantsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SkipGrantsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SkipGrantsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SkipGrantsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SkipGrantsValidationError) ErrorName() string { return "SkipGrantsValidationError" } + +// Error satisfies the builtin error interface +func (e SkipGrantsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSkipGrants.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SkipGrantsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SkipGrantsValidationError{} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.go new file mode 100644 index 00000000..05159caa --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.go @@ -0,0 +1,130 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.4 +// protoc (unknown) +// source: c1/connector/v2/annotation_sync_id.proto + +package v2 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ActiveSync is an annotation is used by the session cache. +type ActiveSync struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ActiveSync) Reset() { + *x = ActiveSync{} + mi := &file_c1_connector_v2_annotation_sync_id_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ActiveSync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActiveSync) ProtoMessage() {} + +func (x *ActiveSync) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_sync_id_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActiveSync.ProtoReflect.Descriptor instead. +func (*ActiveSync) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_annotation_sync_id_proto_rawDescGZIP(), []int{0} +} + +func (x *ActiveSync) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +var File_c1_connector_v2_annotation_sync_id_proto protoreflect.FileDescriptor + +var file_c1_connector_v2_annotation_sync_id_proto_rawDesc = string([]byte{ + 0x0a, 0x28, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x76, + 0x32, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x22, 0x1c, 0x0a, 0x0a, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 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, +}) + +var ( + file_c1_connector_v2_annotation_sync_id_proto_rawDescOnce sync.Once + file_c1_connector_v2_annotation_sync_id_proto_rawDescData []byte +) + +func file_c1_connector_v2_annotation_sync_id_proto_rawDescGZIP() []byte { + file_c1_connector_v2_annotation_sync_id_proto_rawDescOnce.Do(func() { + file_c1_connector_v2_annotation_sync_id_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_sync_id_proto_rawDesc), len(file_c1_connector_v2_annotation_sync_id_proto_rawDesc))) + }) + return file_c1_connector_v2_annotation_sync_id_proto_rawDescData +} + +var file_c1_connector_v2_annotation_sync_id_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_c1_connector_v2_annotation_sync_id_proto_goTypes = []any{ + (*ActiveSync)(nil), // 0: c1.connector.v2.ActiveSync +} +var file_c1_connector_v2_annotation_sync_id_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_c1_connector_v2_annotation_sync_id_proto_init() } +func file_c1_connector_v2_annotation_sync_id_proto_init() { + if File_c1_connector_v2_annotation_sync_id_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_sync_id_proto_rawDesc), len(file_c1_connector_v2_annotation_sync_id_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_c1_connector_v2_annotation_sync_id_proto_goTypes, + DependencyIndexes: file_c1_connector_v2_annotation_sync_id_proto_depIdxs, + MessageInfos: file_c1_connector_v2_annotation_sync_id_proto_msgTypes, + }.Build() + File_c1_connector_v2_annotation_sync_id_proto = out.File + file_c1_connector_v2_annotation_sync_id_proto_goTypes = nil + file_c1_connector_v2_annotation_sync_id_proto_depIdxs = nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.validate.go new file mode 100644 index 00000000..66613f9e --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_sync_id.pb.validate.go @@ -0,0 +1,137 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: c1/connector/v2/annotation_sync_id.proto + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on ActiveSync with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *ActiveSync) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ActiveSync with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ActiveSyncMultiError, or +// nil if none found. +func (m *ActiveSync) ValidateAll() error { + return m.validate(true) +} + +func (m *ActiveSync) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return ActiveSyncMultiError(errors) + } + + return nil +} + +// ActiveSyncMultiError is an error wrapping multiple validation errors +// returned by ActiveSync.ValidateAll() if the designated constraints aren't met. +type ActiveSyncMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ActiveSyncMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ActiveSyncMultiError) AllErrors() []error { return m } + +// ActiveSyncValidationError is the validation error returned by +// ActiveSync.Validate if the designated constraints aren't met. +type ActiveSyncValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ActiveSyncValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ActiveSyncValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ActiveSyncValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ActiveSyncValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ActiveSyncValidationError) ErrorName() string { return "ActiveSyncValidationError" } + +// Error satisfies the builtin error interface +func (e ActiveSyncValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sActiveSync.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ActiveSyncValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ActiveSyncValidationError{} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go index 3027d370..da231740 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go @@ -106,10 +106,11 @@ func (Capability) EnumDescriptor() ([]byte, []int) { type CapabilityDetailCredentialOption int32 const ( - CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED CapabilityDetailCredentialOption = 0 - CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD CapabilityDetailCredentialOption = 1 - CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD CapabilityDetailCredentialOption = 2 - CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO CapabilityDetailCredentialOption = 3 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED CapabilityDetailCredentialOption = 0 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD CapabilityDetailCredentialOption = 1 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD CapabilityDetailCredentialOption = 2 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO CapabilityDetailCredentialOption = 3 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD CapabilityDetailCredentialOption = 4 ) // Enum value maps for CapabilityDetailCredentialOption. @@ -119,12 +120,14 @@ var ( 1: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD", 2: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD", 3: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO", + 4: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD", } CapabilityDetailCredentialOption_value = map[string]int32{ - "CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED": 0, - "CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD": 1, - "CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD": 2, - "CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO": 3, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED": 0, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD": 1, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD": 2, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO": 3, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD": 4, } ) @@ -1500,7 +1503,7 @@ var file_c1_connector_v2_connector_proto_rawDesc = string([]byte{ 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x0b, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x46, - 0x45, 0x45, 0x44, 0x5f, 0x56, 0x32, 0x10, 0x0c, 0x2a, 0xf2, 0x01, 0x0a, 0x20, 0x43, 0x61, 0x70, + 0x45, 0x45, 0x44, 0x5f, 0x56, 0x32, 0x10, 0x0c, 0x2a, 0xae, 0x02, 0x0a, 0x20, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45, 0x54, 0x41, @@ -1515,34 +1518,38 @@ var file_c1_connector_v2_connector_proto_rawDesc = string([]byte{ 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x02, 0x12, 0x2b, 0x0a, 0x27, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45, 0x54, 0x41, 0x49, 0x4c, 0x5f, 0x43, 0x52, 0x45, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x53, 0x4f, 0x10, 0x03, 0x32, 0xeb, 0x02, - 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x33, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x53, 0x4f, 0x10, 0x03, 0x12, 0x3a, 0x0a, + 0x36, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45, 0x54, 0x41, + 0x49, 0x4c, 0x5f, 0x43, 0x52, 0x45, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x4f, 0x50, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x45, 0x44, 0x5f, 0x50, + 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x04, 0x32, 0xeb, 0x02, 0x0a, 0x10, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, + 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x08, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x08, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, - 0x07, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x12, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x65, 0x61, - 0x6e, 0x75, 0x70, 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, + 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x07, 0x43, 0x6c, 0x65, + 0x61, 0x6e, 0x75, 0x70, 0x12, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 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, }) var ( diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.go index 0da9efb1..133fbcba 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.go @@ -30,6 +30,8 @@ const ( EventType_EVENT_TYPE_UNSPECIFIED EventType = 0 EventType_EVENT_TYPE_USAGE EventType = 1 EventType_EVENT_TYPE_RESOURCE_CHANGE EventType = 4 + EventType_EVENT_TYPE_CREATE_GRANT EventType = 5 + EventType_EVENT_TYPE_CREATE_REVOKE EventType = 6 ) // Enum value maps for EventType. @@ -38,11 +40,15 @@ var ( 0: "EVENT_TYPE_UNSPECIFIED", 1: "EVENT_TYPE_USAGE", 4: "EVENT_TYPE_RESOURCE_CHANGE", + 5: "EVENT_TYPE_CREATE_GRANT", + 6: "EVENT_TYPE_CREATE_REVOKE", } EventType_value = map[string]int32{ "EVENT_TYPE_UNSPECIFIED": 0, "EVENT_TYPE_USAGE": 1, "EVENT_TYPE_RESOURCE_CHANGE": 4, + "EVENT_TYPE_CREATE_GRANT": 5, + "EVENT_TYPE_CREATE_REVOKE": 6, } ) @@ -329,6 +335,8 @@ type Event struct { // *Event_GrantEvent // *Event_RevokeEvent // *Event_ResourceChangeEvent + // *Event_CreateGrantEvent + // *Event_CreateRevokeEvent Event isEvent_Event `protobuf_oneof:"event"` // May contain resources for targets, actor, or items referenced in events Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -423,6 +431,24 @@ func (x *Event) GetResourceChangeEvent() *ResourceChangeEvent { return nil } +func (x *Event) GetCreateGrantEvent() *CreateGrantEvent { + if x != nil { + if x, ok := x.Event.(*Event_CreateGrantEvent); ok { + return x.CreateGrantEvent + } + } + return nil +} + +func (x *Event) GetCreateRevokeEvent() *CreateRevokeEvent { + if x != nil { + if x, ok := x.Event.(*Event_CreateRevokeEvent); ok { + return x.CreateRevokeEvent + } + } + return nil +} + func (x *Event) GetAnnotations() []*anypb.Any { if x != nil { return x.Annotations @@ -450,6 +476,14 @@ type Event_ResourceChangeEvent struct { ResourceChangeEvent *ResourceChangeEvent `protobuf:"bytes,103,opt,name=resource_change_event,json=resourceChangeEvent,proto3,oneof"` } +type Event_CreateGrantEvent struct { + CreateGrantEvent *CreateGrantEvent `protobuf:"bytes,104,opt,name=create_grant_event,json=createGrantEvent,proto3,oneof"` +} + +type Event_CreateRevokeEvent struct { + CreateRevokeEvent *CreateRevokeEvent `protobuf:"bytes,105,opt,name=create_revoke_event,json=createRevokeEvent,proto3,oneof"` +} + func (*Event_UsageEvent) isEvent_Event() {} func (*Event_GrantEvent) isEvent_Event() {} @@ -458,6 +492,10 @@ func (*Event_RevokeEvent) isEvent_Event() {} func (*Event_ResourceChangeEvent) isEvent_Event() {} +func (*Event_CreateGrantEvent) isEvent_Event() {} + +func (*Event_CreateRevokeEvent) isEvent_Event() {} + type UsageEvent struct { state protoimpl.MessageState `protogen:"open.v1"` TargetResource *Resource `protobuf:"bytes,1,opt,name=target_resource,json=targetResource,proto3" json:"target_resource,omitempty"` @@ -555,6 +593,126 @@ func (x *GrantEvent) GetGrant() *Grant { return nil } +type CreateGrantEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Entitlement *Entitlement `protobuf:"bytes,1,opt,name=entitlement,proto3" json:"entitlement,omitempty"` + Principal *Resource `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateGrantEvent) Reset() { + *x = CreateGrantEvent{} + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateGrantEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateGrantEvent) ProtoMessage() {} + +func (x *CreateGrantEvent) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateGrantEvent.ProtoReflect.Descriptor instead. +func (*CreateGrantEvent) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateGrantEvent) GetEntitlement() *Entitlement { + if x != nil { + return x.Entitlement + } + return nil +} + +func (x *CreateGrantEvent) GetPrincipal() *Resource { + if x != nil { + return x.Principal + } + return nil +} + +func (x *CreateGrantEvent) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +type CreateRevokeEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Entitlement *Entitlement `protobuf:"bytes,1,opt,name=entitlement,proto3" json:"entitlement,omitempty"` + Principal *Resource `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRevokeEvent) Reset() { + *x = CreateRevokeEvent{} + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRevokeEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRevokeEvent) ProtoMessage() {} + +func (x *CreateRevokeEvent) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRevokeEvent.ProtoReflect.Descriptor instead. +func (*CreateRevokeEvent) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{8} +} + +func (x *CreateRevokeEvent) GetEntitlement() *Entitlement { + if x != nil { + return x.Entitlement + } + return nil +} + +func (x *CreateRevokeEvent) GetPrincipal() *Resource { + if x != nil { + return x.Principal + } + return nil +} + +func (x *CreateRevokeEvent) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + type RevokeEvent struct { state protoimpl.MessageState `protogen:"open.v1"` Entitlement *Entitlement `protobuf:"bytes,1,opt,name=entitlement,proto3" json:"entitlement,omitempty"` @@ -565,7 +723,7 @@ type RevokeEvent struct { func (x *RevokeEvent) Reset() { *x = RevokeEvent{} - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[7] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -577,7 +735,7 @@ func (x *RevokeEvent) String() string { func (*RevokeEvent) ProtoMessage() {} func (x *RevokeEvent) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[7] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -590,7 +748,7 @@ func (x *RevokeEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use RevokeEvent.ProtoReflect.Descriptor instead. func (*RevokeEvent) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{7} + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{9} } func (x *RevokeEvent) GetEntitlement() *Entitlement { @@ -618,7 +776,7 @@ type ResourceChangeEvent struct { func (x *ResourceChangeEvent) Reset() { *x = ResourceChangeEvent{} - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[8] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -630,7 +788,7 @@ func (x *ResourceChangeEvent) String() string { func (*ResourceChangeEvent) ProtoMessage() {} func (x *ResourceChangeEvent) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[8] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -643,7 +801,7 @@ func (x *ResourceChangeEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceChangeEvent.ProtoReflect.Descriptor instead. func (*ResourceChangeEvent) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{8} + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{10} } func (x *ResourceChangeEvent) GetResourceId() *ResourceId { @@ -671,7 +829,7 @@ type EventFeedMetadata struct { func (x *EventFeedMetadata) Reset() { *x = EventFeedMetadata{} - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[9] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -683,7 +841,7 @@ func (x *EventFeedMetadata) String() string { func (*EventFeedMetadata) ProtoMessage() {} func (x *EventFeedMetadata) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[9] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -696,7 +854,7 @@ func (x *EventFeedMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use EventFeedMetadata.ProtoReflect.Descriptor instead. func (*EventFeedMetadata) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{9} + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{11} } func (x *EventFeedMetadata) GetId() string { @@ -772,7 +930,7 @@ var file_c1_connector_v2_event_feed_proto_rawDesc = string([]byte{ 0x04, 0x6c, 0x69, 0x73, 0x74, 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, 0xb4, 0x03, + 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xdd, 0x04, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, @@ -796,76 +954,117 @@ var file_c1_connector_v2_event_feed_proto_rawDesc = string([]byte{ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 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, 0x42, 0x07, 0x0a, 0x05, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x22, 0x92, 0x01, 0x0a, 0x0a, 0x55, 0x73, 0x61, 0x67, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 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, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x6f, 0x72, - 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 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, 0x0d, 0x61, 0x63, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x05, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 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, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, - 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x68, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x54, 0x0a, 0x13, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x5f, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x69, 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, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x6f, + 0x6b, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 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, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x92, 0x01, + 0x0a, 0x0a, 0x55, 0x73, 0x61, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0f, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 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, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x40, 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x02, 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, 0x22, 0xa8, - 0x01, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, + 0x72, 0x63, 0x65, 0x52, 0x0d, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x2c, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x32, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x22, 0xd7, + 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 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, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, + 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x02, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 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, 0xd8, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x48, + 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 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, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, + 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x02, 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, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, - 0x10, 0x01, 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, 0x90, 0x01, 0x0a, 0x11, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0x5f, 0x0a, 0x15, 0x73, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0f, 0xfa, 0x42, 0x0c, 0x92, 0x01, 0x09, 0x18, 0x01, - 0x22, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2a, 0x69, 0x0a, 0x09, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x55, 0x53, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x45, - 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, - 0x43, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x04, 0x22, 0x04, 0x08, 0x02, 0x10, - 0x02, 0x22, 0x04, 0x08, 0x03, 0x10, 0x03, 0x32, 0xc8, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x61, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, - 0x73, 0x12, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, - 0x64, 0x73, 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, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x73, 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, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 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, 0x86, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 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, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 0x18, 0x02, 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, 0x22, 0xa8, 0x01, 0x0a, + 0x13, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x46, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, + 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, 0x90, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x46, 0x65, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0x5f, 0x0a, 0x15, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x42, 0x0f, 0xfa, 0x42, 0x0c, 0x92, 0x01, 0x09, 0x18, 0x01, 0x22, 0x05, + 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2a, 0xa4, 0x01, 0x0a, 0x09, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, + 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x53, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, + 0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, + 0x47, 0x52, 0x41, 0x4e, 0x54, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x56, + 0x4f, 0x4b, 0x45, 0x10, 0x06, 0x22, 0x04, 0x08, 0x02, 0x10, 0x02, 0x22, 0x04, 0x08, 0x03, 0x10, + 0x03, 0x32, 0xc8, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0e, 0x4c, 0x69, 0x73, + 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x73, 0x12, 0x26, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x73, 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, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, + 0x65, 0x65, 0x64, 0x73, 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, }) var ( @@ -881,7 +1080,7 @@ func file_c1_connector_v2_event_feed_proto_rawDescGZIP() []byte { } var file_c1_connector_v2_event_feed_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_c1_connector_v2_event_feed_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_c1_connector_v2_event_feed_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_c1_connector_v2_event_feed_proto_goTypes = []any{ (EventType)(0), // 0: c1.connector.v2.EventType (*ListEventsRequest)(nil), // 1: c1.connector.v2.ListEventsRequest @@ -891,47 +1090,57 @@ var file_c1_connector_v2_event_feed_proto_goTypes = []any{ (*Event)(nil), // 5: c1.connector.v2.Event (*UsageEvent)(nil), // 6: c1.connector.v2.UsageEvent (*GrantEvent)(nil), // 7: c1.connector.v2.GrantEvent - (*RevokeEvent)(nil), // 8: c1.connector.v2.RevokeEvent - (*ResourceChangeEvent)(nil), // 9: c1.connector.v2.ResourceChangeEvent - (*EventFeedMetadata)(nil), // 10: c1.connector.v2.EventFeedMetadata - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp - (*anypb.Any)(nil), // 12: google.protobuf.Any - (*Resource)(nil), // 13: c1.connector.v2.Resource - (*Grant)(nil), // 14: c1.connector.v2.Grant - (*Entitlement)(nil), // 15: c1.connector.v2.Entitlement - (*ResourceId)(nil), // 16: c1.connector.v2.ResourceId + (*CreateGrantEvent)(nil), // 8: c1.connector.v2.CreateGrantEvent + (*CreateRevokeEvent)(nil), // 9: c1.connector.v2.CreateRevokeEvent + (*RevokeEvent)(nil), // 10: c1.connector.v2.RevokeEvent + (*ResourceChangeEvent)(nil), // 11: c1.connector.v2.ResourceChangeEvent + (*EventFeedMetadata)(nil), // 12: c1.connector.v2.EventFeedMetadata + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*anypb.Any)(nil), // 14: google.protobuf.Any + (*Resource)(nil), // 15: c1.connector.v2.Resource + (*Grant)(nil), // 16: c1.connector.v2.Grant + (*Entitlement)(nil), // 17: c1.connector.v2.Entitlement + (*ResourceId)(nil), // 18: c1.connector.v2.ResourceId } var file_c1_connector_v2_event_feed_proto_depIdxs = []int32{ - 11, // 0: c1.connector.v2.ListEventsRequest.start_at:type_name -> google.protobuf.Timestamp - 12, // 1: c1.connector.v2.ListEventsRequest.annotations:type_name -> google.protobuf.Any + 13, // 0: c1.connector.v2.ListEventsRequest.start_at:type_name -> google.protobuf.Timestamp + 14, // 1: c1.connector.v2.ListEventsRequest.annotations:type_name -> google.protobuf.Any 5, // 2: c1.connector.v2.ListEventsResponse.events:type_name -> c1.connector.v2.Event - 12, // 3: c1.connector.v2.ListEventsResponse.annotations:type_name -> google.protobuf.Any - 12, // 4: c1.connector.v2.ListEventFeedsRequest.annotations:type_name -> google.protobuf.Any - 10, // 5: c1.connector.v2.ListEventFeedsResponse.list:type_name -> c1.connector.v2.EventFeedMetadata - 12, // 6: c1.connector.v2.ListEventFeedsResponse.annotations:type_name -> google.protobuf.Any - 11, // 7: c1.connector.v2.Event.occurred_at:type_name -> google.protobuf.Timestamp + 14, // 3: c1.connector.v2.ListEventsResponse.annotations:type_name -> google.protobuf.Any + 14, // 4: c1.connector.v2.ListEventFeedsRequest.annotations:type_name -> google.protobuf.Any + 12, // 5: c1.connector.v2.ListEventFeedsResponse.list:type_name -> c1.connector.v2.EventFeedMetadata + 14, // 6: c1.connector.v2.ListEventFeedsResponse.annotations:type_name -> google.protobuf.Any + 13, // 7: c1.connector.v2.Event.occurred_at:type_name -> google.protobuf.Timestamp 6, // 8: c1.connector.v2.Event.usage_event:type_name -> c1.connector.v2.UsageEvent 7, // 9: c1.connector.v2.Event.grant_event:type_name -> c1.connector.v2.GrantEvent - 8, // 10: c1.connector.v2.Event.revoke_event:type_name -> c1.connector.v2.RevokeEvent - 9, // 11: c1.connector.v2.Event.resource_change_event:type_name -> c1.connector.v2.ResourceChangeEvent - 12, // 12: c1.connector.v2.Event.annotations:type_name -> google.protobuf.Any - 13, // 13: c1.connector.v2.UsageEvent.target_resource:type_name -> c1.connector.v2.Resource - 13, // 14: c1.connector.v2.UsageEvent.actor_resource:type_name -> c1.connector.v2.Resource - 14, // 15: c1.connector.v2.GrantEvent.grant:type_name -> c1.connector.v2.Grant - 15, // 16: c1.connector.v2.RevokeEvent.entitlement:type_name -> c1.connector.v2.Entitlement - 13, // 17: c1.connector.v2.RevokeEvent.principal:type_name -> c1.connector.v2.Resource - 16, // 18: c1.connector.v2.ResourceChangeEvent.resource_id:type_name -> c1.connector.v2.ResourceId - 16, // 19: c1.connector.v2.ResourceChangeEvent.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 0, // 20: c1.connector.v2.EventFeedMetadata.supported_event_types:type_name -> c1.connector.v2.EventType - 1, // 21: c1.connector.v2.EventService.ListEvents:input_type -> c1.connector.v2.ListEventsRequest - 3, // 22: c1.connector.v2.EventService.ListEventFeeds:input_type -> c1.connector.v2.ListEventFeedsRequest - 2, // 23: c1.connector.v2.EventService.ListEvents:output_type -> c1.connector.v2.ListEventsResponse - 4, // 24: c1.connector.v2.EventService.ListEventFeeds:output_type -> c1.connector.v2.ListEventFeedsResponse - 23, // [23:25] is the sub-list for method output_type - 21, // [21:23] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 10, // 10: c1.connector.v2.Event.revoke_event:type_name -> c1.connector.v2.RevokeEvent + 11, // 11: c1.connector.v2.Event.resource_change_event:type_name -> c1.connector.v2.ResourceChangeEvent + 8, // 12: c1.connector.v2.Event.create_grant_event:type_name -> c1.connector.v2.CreateGrantEvent + 9, // 13: c1.connector.v2.Event.create_revoke_event:type_name -> c1.connector.v2.CreateRevokeEvent + 14, // 14: c1.connector.v2.Event.annotations:type_name -> google.protobuf.Any + 15, // 15: c1.connector.v2.UsageEvent.target_resource:type_name -> c1.connector.v2.Resource + 15, // 16: c1.connector.v2.UsageEvent.actor_resource:type_name -> c1.connector.v2.Resource + 16, // 17: c1.connector.v2.GrantEvent.grant:type_name -> c1.connector.v2.Grant + 17, // 18: c1.connector.v2.CreateGrantEvent.entitlement:type_name -> c1.connector.v2.Entitlement + 15, // 19: c1.connector.v2.CreateGrantEvent.principal:type_name -> c1.connector.v2.Resource + 14, // 20: c1.connector.v2.CreateGrantEvent.annotations:type_name -> google.protobuf.Any + 17, // 21: c1.connector.v2.CreateRevokeEvent.entitlement:type_name -> c1.connector.v2.Entitlement + 15, // 22: c1.connector.v2.CreateRevokeEvent.principal:type_name -> c1.connector.v2.Resource + 14, // 23: c1.connector.v2.CreateRevokeEvent.annotations:type_name -> google.protobuf.Any + 17, // 24: c1.connector.v2.RevokeEvent.entitlement:type_name -> c1.connector.v2.Entitlement + 15, // 25: c1.connector.v2.RevokeEvent.principal:type_name -> c1.connector.v2.Resource + 18, // 26: c1.connector.v2.ResourceChangeEvent.resource_id:type_name -> c1.connector.v2.ResourceId + 18, // 27: c1.connector.v2.ResourceChangeEvent.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 0, // 28: c1.connector.v2.EventFeedMetadata.supported_event_types:type_name -> c1.connector.v2.EventType + 1, // 29: c1.connector.v2.EventService.ListEvents:input_type -> c1.connector.v2.ListEventsRequest + 3, // 30: c1.connector.v2.EventService.ListEventFeeds:input_type -> c1.connector.v2.ListEventFeedsRequest + 2, // 31: c1.connector.v2.EventService.ListEvents:output_type -> c1.connector.v2.ListEventsResponse + 4, // 32: c1.connector.v2.EventService.ListEventFeeds:output_type -> c1.connector.v2.ListEventFeedsResponse + 31, // [31:33] is the sub-list for method output_type + 29, // [29:31] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_c1_connector_v2_event_feed_proto_init() } @@ -947,6 +1156,8 @@ func file_c1_connector_v2_event_feed_proto_init() { (*Event_GrantEvent)(nil), (*Event_RevokeEvent)(nil), (*Event_ResourceChangeEvent)(nil), + (*Event_CreateGrantEvent)(nil), + (*Event_CreateRevokeEvent)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -954,7 +1165,7 @@ func file_c1_connector_v2_event_feed_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_event_feed_proto_rawDesc), len(file_c1_connector_v2_event_feed_proto_rawDesc)), NumEnums: 1, - NumMessages: 10, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.validate.go index bc384bf6..131ce870 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed.pb.validate.go @@ -989,6 +989,88 @@ func (m *Event) validate(all bool) error { } } + case *Event_CreateGrantEvent: + if v == nil { + err := EventValidationError{ + field: "Event", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetCreateGrantEvent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, EventValidationError{ + field: "CreateGrantEvent", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, EventValidationError{ + field: "CreateGrantEvent", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreateGrantEvent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EventValidationError{ + field: "CreateGrantEvent", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Event_CreateRevokeEvent: + if v == nil { + err := EventValidationError{ + field: "Event", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetCreateRevokeEvent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, EventValidationError{ + field: "CreateRevokeEvent", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, EventValidationError{ + field: "CreateRevokeEvent", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreateRevokeEvent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EventValidationError{ + field: "CreateRevokeEvent", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -1355,6 +1437,436 @@ var _ interface { ErrorName() string } = GrantEventValidationError{} +// Validate checks the field values on CreateGrantEvent with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateGrantEvent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateGrantEvent with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateGrantEventMultiError, or nil if none found. +func (m *CreateGrantEvent) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateGrantEvent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetEntitlement() == nil { + err := CreateGrantEventValidationError{ + field: "Entitlement", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetEntitlement()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateGrantEventValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateGrantEventValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEntitlement()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateGrantEventValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetPrincipal() == nil { + err := CreateGrantEventValidationError{ + field: "Principal", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPrincipal()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateGrantEventValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateGrantEventValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPrincipal()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateGrantEventValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetAnnotations() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateGrantEventValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateGrantEventValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateGrantEventValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return CreateGrantEventMultiError(errors) + } + + return nil +} + +// CreateGrantEventMultiError is an error wrapping multiple validation errors +// returned by CreateGrantEvent.ValidateAll() if the designated constraints +// aren't met. +type CreateGrantEventMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateGrantEventMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateGrantEventMultiError) AllErrors() []error { return m } + +// CreateGrantEventValidationError is the validation error returned by +// CreateGrantEvent.Validate if the designated constraints aren't met. +type CreateGrantEventValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateGrantEventValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateGrantEventValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateGrantEventValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateGrantEventValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateGrantEventValidationError) ErrorName() string { return "CreateGrantEventValidationError" } + +// Error satisfies the builtin error interface +func (e CreateGrantEventValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateGrantEvent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateGrantEventValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateGrantEventValidationError{} + +// Validate checks the field values on CreateRevokeEvent with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CreateRevokeEvent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateRevokeEvent with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateRevokeEventMultiError, or nil if none found. +func (m *CreateRevokeEvent) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateRevokeEvent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetEntitlement() == nil { + err := CreateRevokeEventValidationError{ + field: "Entitlement", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetEntitlement()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateRevokeEventValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateRevokeEventValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEntitlement()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateRevokeEventValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetPrincipal() == nil { + err := CreateRevokeEventValidationError{ + field: "Principal", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPrincipal()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateRevokeEventValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateRevokeEventValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPrincipal()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateRevokeEventValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetAnnotations() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateRevokeEventValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateRevokeEventValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateRevokeEventValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return CreateRevokeEventMultiError(errors) + } + + return nil +} + +// CreateRevokeEventMultiError is an error wrapping multiple validation errors +// returned by CreateRevokeEvent.ValidateAll() if the designated constraints +// aren't met. +type CreateRevokeEventMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateRevokeEventMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateRevokeEventMultiError) AllErrors() []error { return m } + +// CreateRevokeEventValidationError is the validation error returned by +// CreateRevokeEvent.Validate if the designated constraints aren't met. +type CreateRevokeEventValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateRevokeEventValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateRevokeEventValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateRevokeEventValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateRevokeEventValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateRevokeEventValidationError) ErrorName() string { + return "CreateRevokeEventValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateRevokeEventValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateRevokeEvent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateRevokeEventValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateRevokeEventValidationError{} + // Validate checks the field values on RevokeEvent with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go index 42bf6b92..27a761c5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go @@ -129,7 +129,7 @@ func (x Resource_CreationSource) Number() protoreflect.EnumNumber { // Deprecated: Use Resource_CreationSource.Descriptor instead. func (Resource_CreationSource) EnumDescriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{20, 0} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{21, 0} } type ResourceType struct { @@ -441,10 +441,11 @@ func (x *CreateResourceResponse) GetAnnotations() []*anypb.Any { } type DeleteResourceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + 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 + sizeCache protoimpl.SizeCache } func (x *DeleteResourceRequest) Reset() { @@ -484,6 +485,13 @@ func (x *DeleteResourceRequest) GetResourceId() *ResourceId { return nil } +func (x *DeleteResourceRequest) GetParentResourceId() *ResourceId { + if x != nil { + return x.ParentResourceId + } + return nil +} + type DeleteResourceResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -529,10 +537,11 @@ func (x *DeleteResourceResponse) GetAnnotations() []*anypb.Any { } type DeleteResourceV2Request struct { - state protoimpl.MessageState `protogen:"open.v1"` - ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + 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 + sizeCache protoimpl.SizeCache } func (x *DeleteResourceV2Request) Reset() { @@ -572,6 +581,13 @@ func (x *DeleteResourceV2Request) GetResourceId() *ResourceId { return nil } +func (x *DeleteResourceV2Request) GetParentResourceId() *ResourceId { + if x != nil { + return x.ParentResourceId + } + return nil +} + type DeleteResourceV2Response struct { state protoimpl.MessageState `protogen:"open.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -813,9 +829,11 @@ type CredentialOptions struct { // *CredentialOptions_RandomPassword_ // *CredentialOptions_NoPassword_ // *CredentialOptions_Sso - Options isCredentialOptions_Options `protobuf_oneof:"options"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // *CredentialOptions_EncryptedPassword_ + Options isCredentialOptions_Options `protobuf_oneof:"options"` + ForceChangeAtNextLogin bool `protobuf:"varint,1,opt,name=force_change_at_next_login,json=forceChangeAtNextLogin,proto3" json:"force_change_at_next_login,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CredentialOptions) Reset() { @@ -882,6 +900,22 @@ func (x *CredentialOptions) GetSso() *CredentialOptions_SSO { return nil } +func (x *CredentialOptions) GetEncryptedPassword() *CredentialOptions_EncryptedPassword { + if x != nil { + if x, ok := x.Options.(*CredentialOptions_EncryptedPassword_); ok { + return x.EncryptedPassword + } + } + return nil +} + +func (x *CredentialOptions) GetForceChangeAtNextLogin() bool { + if x != nil { + return x.ForceChangeAtNextLogin + } + return false +} + type isCredentialOptions_Options interface { isCredentialOptions_Options() } @@ -898,12 +932,141 @@ 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:"open.v1"` + // Types that are valid to be assigned to Options: + // + // *LocalCredentialOptions_RandomPassword_ + // *LocalCredentialOptions_NoPassword_ + // *LocalCredentialOptions_Sso + // *LocalCredentialOptions_PlaintextPassword_ + Options isLocalCredentialOptions_Options `protobuf_oneof:"options"` + ForceChangeAtNextLogin bool `protobuf:"varint,1,opt,name=force_change_at_next_login,json=forceChangeAtNextLogin,proto3" json:"force_change_at_next_login,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalCredentialOptions) Reset() { + *x = LocalCredentialOptions{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LocalCredentialOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalCredentialOptions) ProtoMessage() {} + +func (x *LocalCredentialOptions) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + 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 + } + return nil +} + +func (x *LocalCredentialOptions) GetRandomPassword() *LocalCredentialOptions_RandomPassword { + if x != nil { + if x, ok := x.Options.(*LocalCredentialOptions_RandomPassword_); ok { + return x.RandomPassword + } + } + return nil +} + +func (x *LocalCredentialOptions) GetNoPassword() *LocalCredentialOptions_NoPassword { + if x != nil { + if x, ok := x.Options.(*LocalCredentialOptions_NoPassword_); ok { + return x.NoPassword + } + } + return nil +} + +func (x *LocalCredentialOptions) GetSso() *LocalCredentialOptions_SSO { + if x != nil { + if x, ok := x.Options.(*LocalCredentialOptions_Sso); ok { + return x.Sso + } + } + return nil +} + +func (x *LocalCredentialOptions) GetPlaintextPassword() *LocalCredentialOptions_PlaintextPassword { + if x != nil { + if x, ok := x.Options.(*LocalCredentialOptions_PlaintextPassword_); ok { + return x.PlaintextPassword + } + } + return nil +} + +func (x *LocalCredentialOptions) GetForceChangeAtNextLogin() bool { + if x != nil { + return x.ForceChangeAtNextLogin + } + return false +} + +type isLocalCredentialOptions_Options interface { + isLocalCredentialOptions_Options() +} + +type LocalCredentialOptions_RandomPassword_ struct { + RandomPassword *LocalCredentialOptions_RandomPassword `protobuf:"bytes,100,opt,name=random_password,json=randomPassword,proto3,oneof"` +} + +type LocalCredentialOptions_NoPassword_ struct { + NoPassword *LocalCredentialOptions_NoPassword `protobuf:"bytes,101,opt,name=no_password,json=noPassword,proto3,oneof"` +} + +type LocalCredentialOptions_Sso struct { + Sso *LocalCredentialOptions_SSO `protobuf:"bytes,102,opt,name=sso,proto3,oneof"` +} + +type LocalCredentialOptions_PlaintextPassword_ struct { + PlaintextPassword *LocalCredentialOptions_PlaintextPassword `protobuf:"bytes,103,opt,name=plaintext_password,json=plaintextPassword,proto3,oneof"` +} + +func (*LocalCredentialOptions_RandomPassword_) isLocalCredentialOptions_Options() {} + +func (*LocalCredentialOptions_NoPassword_) isLocalCredentialOptions_Options() {} + +func (*LocalCredentialOptions_Sso) isLocalCredentialOptions_Options() {} + +func (*LocalCredentialOptions_PlaintextPassword_) isLocalCredentialOptions_Options() {} + type PasswordConstraint struct { state protoimpl.MessageState `protogen:"open.v1"` CharSet string `protobuf:"bytes,1,opt,name=char_set,json=charSet,proto3" json:"char_set,omitempty"` @@ -914,7 +1077,7 @@ type PasswordConstraint struct { func (x *PasswordConstraint) Reset() { *x = PasswordConstraint{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + mi := &file_c1_connector_v2_resource_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -926,7 +1089,7 @@ func (x *PasswordConstraint) String() string { func (*PasswordConstraint) ProtoMessage() {} func (x *PasswordConstraint) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + mi := &file_c1_connector_v2_resource_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -939,7 +1102,7 @@ func (x *PasswordConstraint) ProtoReflect() protoreflect.Message { // Deprecated: Use PasswordConstraint.ProtoReflect.Descriptor instead. func (*PasswordConstraint) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{14} } func (x *PasswordConstraint) GetCharSet() string { @@ -967,7 +1130,7 @@ type CreateAccountRequest struct { func (x *CreateAccountRequest) Reset() { *x = CreateAccountRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + mi := &file_c1_connector_v2_resource_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -979,7 +1142,7 @@ func (x *CreateAccountRequest) String() string { func (*CreateAccountRequest) ProtoMessage() {} func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + mi := &file_c1_connector_v2_resource_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -992,7 +1155,7 @@ func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateAccountRequest.ProtoReflect.Descriptor instead. func (*CreateAccountRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{14} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{15} } func (x *CreateAccountRequest) GetAccountInfo() *AccountInfo { @@ -1031,7 +1194,7 @@ type CreateAccountResponse struct { func (x *CreateAccountResponse) Reset() { *x = CreateAccountResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[15] + mi := &file_c1_connector_v2_resource_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1043,7 +1206,7 @@ func (x *CreateAccountResponse) String() string { func (*CreateAccountResponse) ProtoMessage() {} func (x *CreateAccountResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[15] + mi := &file_c1_connector_v2_resource_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1056,7 +1219,7 @@ func (x *CreateAccountResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateAccountResponse.ProtoReflect.Descriptor instead. func (*CreateAccountResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{15} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16} } func (x *CreateAccountResponse) GetResult() isCreateAccountResponse_Result { @@ -1130,7 +1293,7 @@ type EncryptedData struct { func (x *EncryptedData) Reset() { *x = EncryptedData{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[16] + mi := &file_c1_connector_v2_resource_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1142,7 +1305,7 @@ func (x *EncryptedData) String() string { func (*EncryptedData) ProtoMessage() {} func (x *EncryptedData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[16] + mi := &file_c1_connector_v2_resource_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1155,7 +1318,7 @@ func (x *EncryptedData) ProtoReflect() protoreflect.Message { // Deprecated: Use EncryptedData.ProtoReflect.Descriptor instead. func (*EncryptedData) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{17} } func (x *EncryptedData) GetProvider() string { @@ -1220,7 +1383,7 @@ type PlaintextData struct { func (x *PlaintextData) Reset() { *x = PlaintextData{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[17] + mi := &file_c1_connector_v2_resource_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1232,7 +1395,7 @@ func (x *PlaintextData) String() string { func (*PlaintextData) ProtoMessage() {} func (x *PlaintextData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[17] + mi := &file_c1_connector_v2_resource_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1245,7 +1408,7 @@ func (x *PlaintextData) ProtoReflect() protoreflect.Message { // Deprecated: Use PlaintextData.ProtoReflect.Descriptor instead. func (*PlaintextData) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{17} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{18} } func (x *PlaintextData) GetName() string { @@ -1291,7 +1454,7 @@ type EncryptionConfig struct { func (x *EncryptionConfig) Reset() { *x = EncryptionConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[18] + mi := &file_c1_connector_v2_resource_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1303,7 +1466,7 @@ func (x *EncryptionConfig) String() string { func (*EncryptionConfig) ProtoMessage() {} func (x *EncryptionConfig) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[18] + mi := &file_c1_connector_v2_resource_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1316,7 +1479,7 @@ func (x *EncryptionConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use EncryptionConfig.ProtoReflect.Descriptor instead. func (*EncryptionConfig) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{18} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{19} } func (x *EncryptionConfig) GetPrincipal() *Resource { @@ -1377,7 +1540,7 @@ type ResourceId struct { func (x *ResourceId) Reset() { *x = ResourceId{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[19] + mi := &file_c1_connector_v2_resource_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1389,7 +1552,7 @@ func (x *ResourceId) String() string { func (*ResourceId) ProtoMessage() {} func (x *ResourceId) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[19] + mi := &file_c1_connector_v2_resource_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1402,7 +1565,7 @@ func (x *ResourceId) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceId.ProtoReflect.Descriptor instead. func (*ResourceId) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{19} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{20} } func (x *ResourceId) GetResourceType() string { @@ -1442,7 +1605,7 @@ type Resource struct { func (x *Resource) Reset() { *x = Resource{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[20] + mi := &file_c1_connector_v2_resource_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1454,7 +1617,7 @@ func (x *Resource) String() string { func (*Resource) ProtoMessage() {} func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[20] + mi := &file_c1_connector_v2_resource_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1467,7 +1630,7 @@ func (x *Resource) ProtoReflect() protoreflect.Message { // Deprecated: Use Resource.ProtoReflect.Descriptor instead. func (*Resource) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{20} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{21} } func (x *Resource) GetId() *ResourceId { @@ -1539,7 +1702,7 @@ type ResourcesServiceListResourcesRequest struct { func (x *ResourcesServiceListResourcesRequest) Reset() { *x = ResourcesServiceListResourcesRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[21] + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1551,7 +1714,7 @@ func (x *ResourcesServiceListResourcesRequest) String() string { func (*ResourcesServiceListResourcesRequest) ProtoMessage() {} func (x *ResourcesServiceListResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[21] + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1564,7 +1727,7 @@ func (x *ResourcesServiceListResourcesRequest) ProtoReflect() protoreflect.Messa // Deprecated: Use ResourcesServiceListResourcesRequest.ProtoReflect.Descriptor instead. func (*ResourcesServiceListResourcesRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{21} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{22} } func (x *ResourcesServiceListResourcesRequest) GetResourceTypeId() string { @@ -1613,7 +1776,7 @@ type ResourcesServiceListResourcesResponse struct { func (x *ResourcesServiceListResourcesResponse) Reset() { *x = ResourcesServiceListResourcesResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1625,7 +1788,7 @@ func (x *ResourcesServiceListResourcesResponse) String() string { func (*ResourcesServiceListResourcesResponse) ProtoMessage() {} func (x *ResourcesServiceListResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1638,7 +1801,7 @@ func (x *ResourcesServiceListResourcesResponse) ProtoReflect() protoreflect.Mess // Deprecated: Use ResourcesServiceListResourcesResponse.ProtoReflect.Descriptor instead. func (*ResourcesServiceListResourcesResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{22} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{23} } func (x *ResourcesServiceListResourcesResponse) GetList() []*Resource { @@ -1673,7 +1836,7 @@ type ResourceGetterServiceGetResourceRequest struct { func (x *ResourceGetterServiceGetResourceRequest) Reset() { *x = ResourceGetterServiceGetResourceRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1685,7 +1848,7 @@ func (x *ResourceGetterServiceGetResourceRequest) String() string { func (*ResourceGetterServiceGetResourceRequest) ProtoMessage() {} func (x *ResourceGetterServiceGetResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1698,7 +1861,7 @@ func (x *ResourceGetterServiceGetResourceRequest) ProtoReflect() protoreflect.Me // Deprecated: Use ResourceGetterServiceGetResourceRequest.ProtoReflect.Descriptor instead. func (*ResourceGetterServiceGetResourceRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{23} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{24} } func (x *ResourceGetterServiceGetResourceRequest) GetResourceId() *ResourceId { @@ -1732,7 +1895,7 @@ type ResourceGetterServiceGetResourceResponse struct { func (x *ResourceGetterServiceGetResourceResponse) Reset() { *x = ResourceGetterServiceGetResourceResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1744,7 +1907,7 @@ func (x *ResourceGetterServiceGetResourceResponse) String() string { func (*ResourceGetterServiceGetResourceResponse) ProtoMessage() {} func (x *ResourceGetterServiceGetResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1757,7 +1920,7 @@ func (x *ResourceGetterServiceGetResourceResponse) ProtoReflect() protoreflect.M // Deprecated: Use ResourceGetterServiceGetResourceResponse.ProtoReflect.Descriptor instead. func (*ResourceGetterServiceGetResourceResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{24} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{25} } func (x *ResourceGetterServiceGetResourceResponse) GetResource() *Resource { @@ -1785,7 +1948,7 @@ type ExternalId struct { func (x *ExternalId) Reset() { *x = ExternalId{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1797,7 +1960,7 @@ func (x *ExternalId) String() string { func (*ExternalId) ProtoMessage() {} func (x *ExternalId) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1810,7 +1973,7 @@ func (x *ExternalId) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalId.ProtoReflect.Descriptor instead. func (*ExternalId) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{25} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{26} } func (x *ExternalId) GetId() string { @@ -1845,7 +2008,7 @@ type AccountInfo_Email struct { func (x *AccountInfo_Email) Reset() { *x = AccountInfo_Email{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1857,7 +2020,7 @@ func (x *AccountInfo_Email) String() string { func (*AccountInfo_Email) ProtoMessage() {} func (x *AccountInfo_Email) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1897,7 +2060,7 @@ type CredentialOptions_RandomPassword struct { func (x *CredentialOptions_RandomPassword) Reset() { *x = CredentialOptions_RandomPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1909,7 +2072,7 @@ func (x *CredentialOptions_RandomPassword) String() string { func (*CredentialOptions_RandomPassword) ProtoMessage() {} func (x *CredentialOptions_RandomPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1947,7 +2110,7 @@ type CredentialOptions_NoPassword struct { func (x *CredentialOptions_NoPassword) Reset() { *x = CredentialOptions_NoPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1959,7 +2122,7 @@ func (x *CredentialOptions_NoPassword) String() string { func (*CredentialOptions_NoPassword) ProtoMessage() {} func (x *CredentialOptions_NoPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1984,7 +2147,7 @@ type CredentialOptions_SSO struct { func (x *CredentialOptions_SSO) Reset() { *x = CredentialOptions_SSO{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1996,7 +2159,7 @@ func (x *CredentialOptions_SSO) String() string { func (*CredentialOptions_SSO) ProtoMessage() {} func (x *CredentialOptions_SSO) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2019,6 +2182,226 @@ func (x *CredentialOptions_SSO) GetSsoProvider() string { return "" } +type CredentialOptions_EncryptedPassword struct { + 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 +} + +func (x *CredentialOptions_EncryptedPassword) Reset() { + *x = CredentialOptions_EncryptedPassword{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialOptions_EncryptedPassword) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialOptions_EncryptedPassword) ProtoMessage() {} + +func (x *CredentialOptions_EncryptedPassword) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + 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 + } + return nil +} + +type LocalCredentialOptions_RandomPassword struct { + 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 + sizeCache protoimpl.SizeCache +} + +func (x *LocalCredentialOptions_RandomPassword) Reset() { + *x = LocalCredentialOptions_RandomPassword{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LocalCredentialOptions_RandomPassword) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalCredentialOptions_RandomPassword) ProtoMessage() {} + +func (x *LocalCredentialOptions_RandomPassword) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + 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 + } + return 0 +} + +func (x *LocalCredentialOptions_RandomPassword) GetConstraints() []*PasswordConstraint { + if x != nil { + return x.Constraints + } + return nil +} + +type LocalCredentialOptions_NoPassword struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LocalCredentialOptions_NoPassword) Reset() { + *x = LocalCredentialOptions_NoPassword{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LocalCredentialOptions_NoPassword) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalCredentialOptions_NoPassword) ProtoMessage() {} + +func (x *LocalCredentialOptions_NoPassword) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + 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_SSO struct { + 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 +} + +func (x *LocalCredentialOptions_SSO) Reset() { + *x = LocalCredentialOptions_SSO{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LocalCredentialOptions_SSO) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalCredentialOptions_SSO) ProtoMessage() {} + +func (x *LocalCredentialOptions_SSO) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + 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 + } + return "" +} + +type LocalCredentialOptions_PlaintextPassword struct { + 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 +} + +func (x *LocalCredentialOptions_PlaintextPassword) Reset() { + *x = LocalCredentialOptions_PlaintextPassword{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LocalCredentialOptions_PlaintextPassword) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalCredentialOptions_PlaintextPassword) ProtoMessage() {} + +func (x *LocalCredentialOptions_PlaintextPassword) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + 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 + } + return "" +} + type CreateAccountResponse_SuccessResult struct { state protoimpl.MessageState `protogen:"open.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` @@ -2029,7 +2412,7 @@ type CreateAccountResponse_SuccessResult struct { func (x *CreateAccountResponse_SuccessResult) Reset() { *x = CreateAccountResponse_SuccessResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[30] + mi := &file_c1_connector_v2_resource_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2041,7 +2424,7 @@ func (x *CreateAccountResponse_SuccessResult) String() string { func (*CreateAccountResponse_SuccessResult) ProtoMessage() {} func (x *CreateAccountResponse_SuccessResult) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[30] + mi := &file_c1_connector_v2_resource_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2054,7 +2437,7 @@ func (x *CreateAccountResponse_SuccessResult) ProtoReflect() protoreflect.Messag // Deprecated: Use CreateAccountResponse_SuccessResult.ProtoReflect.Descriptor instead. func (*CreateAccountResponse_SuccessResult) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{15, 0} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16, 0} } func (x *CreateAccountResponse_SuccessResult) GetResource() *Resource { @@ -2082,7 +2465,7 @@ type CreateAccountResponse_ActionRequiredResult struct { func (x *CreateAccountResponse_ActionRequiredResult) Reset() { *x = CreateAccountResponse_ActionRequiredResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[31] + mi := &file_c1_connector_v2_resource_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2094,7 +2477,7 @@ func (x *CreateAccountResponse_ActionRequiredResult) String() string { func (*CreateAccountResponse_ActionRequiredResult) ProtoMessage() {} func (x *CreateAccountResponse_ActionRequiredResult) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[31] + mi := &file_c1_connector_v2_resource_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2107,7 +2490,7 @@ func (x *CreateAccountResponse_ActionRequiredResult) ProtoReflect() protoreflect // Deprecated: Use CreateAccountResponse_ActionRequiredResult.ProtoReflect.Descriptor instead. func (*CreateAccountResponse_ActionRequiredResult) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{15, 1} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16, 1} } func (x *CreateAccountResponse_ActionRequiredResult) GetResource() *Resource { @@ -2140,7 +2523,7 @@ type EncryptionConfig_JWKPublicKeyConfig struct { func (x *EncryptionConfig_JWKPublicKeyConfig) Reset() { *x = EncryptionConfig_JWKPublicKeyConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + mi := &file_c1_connector_v2_resource_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2152,7 +2535,7 @@ func (x *EncryptionConfig_JWKPublicKeyConfig) String() string { func (*EncryptionConfig_JWKPublicKeyConfig) ProtoMessage() {} func (x *EncryptionConfig_JWKPublicKeyConfig) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + mi := &file_c1_connector_v2_resource_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2165,7 +2548,7 @@ func (x *EncryptionConfig_JWKPublicKeyConfig) ProtoReflect() protoreflect.Messag // Deprecated: Use EncryptionConfig_JWKPublicKeyConfig.ProtoReflect.Descriptor instead. func (*EncryptionConfig_JWKPublicKeyConfig) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{18, 0} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{19, 0} } func (x *EncryptionConfig_JWKPublicKeyConfig) GetPubKey() []byte { @@ -2255,386 +2638,457 @@ var file_c1_connector_v2_resource_proto_rawDesc = string([]byte{ 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, 0x55, 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, 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, 0x57, 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, 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, - 0xbe, 0x03, 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, 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, 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, + 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, - 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, + 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, 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, + 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, 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, 0xc1, 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, 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, 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, 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, + 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, 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, 0xf4, 0x01, 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, 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, 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, + 0xc1, 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, 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, + 0x6f, 0x6e, 0x73, 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, 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, + 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, 0xf4, 0x01, 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, 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, + 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, 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, 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, + 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, }) var ( @@ -2650,7 +3104,7 @@ func file_c1_connector_v2_resource_proto_rawDescGZIP() []byte { } var file_c1_connector_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_c1_connector_v2_resource_proto_goTypes = []any{ (ResourceType_Trait)(0), // 0: c1.connector.v2.ResourceType.Trait (Resource_CreationSource)(0), // 1: c1.connector.v2.Resource.CreationSource @@ -2667,101 +3121,116 @@ var file_c1_connector_v2_resource_proto_goTypes = []any{ (*RotateCredentialResponse)(nil), // 12: c1.connector.v2.RotateCredentialResponse (*AccountInfo)(nil), // 13: c1.connector.v2.AccountInfo (*CredentialOptions)(nil), // 14: c1.connector.v2.CredentialOptions - (*PasswordConstraint)(nil), // 15: c1.connector.v2.PasswordConstraint - (*CreateAccountRequest)(nil), // 16: c1.connector.v2.CreateAccountRequest - (*CreateAccountResponse)(nil), // 17: c1.connector.v2.CreateAccountResponse - (*EncryptedData)(nil), // 18: c1.connector.v2.EncryptedData - (*PlaintextData)(nil), // 19: c1.connector.v2.PlaintextData - (*EncryptionConfig)(nil), // 20: c1.connector.v2.EncryptionConfig - (*ResourceId)(nil), // 21: c1.connector.v2.ResourceId - (*Resource)(nil), // 22: c1.connector.v2.Resource - (*ResourcesServiceListResourcesRequest)(nil), // 23: c1.connector.v2.ResourcesServiceListResourcesRequest - (*ResourcesServiceListResourcesResponse)(nil), // 24: c1.connector.v2.ResourcesServiceListResourcesResponse - (*ResourceGetterServiceGetResourceRequest)(nil), // 25: c1.connector.v2.ResourceGetterServiceGetResourceRequest - (*ResourceGetterServiceGetResourceResponse)(nil), // 26: c1.connector.v2.ResourceGetterServiceGetResourceResponse - (*ExternalId)(nil), // 27: c1.connector.v2.ExternalId - (*AccountInfo_Email)(nil), // 28: c1.connector.v2.AccountInfo.Email - (*CredentialOptions_RandomPassword)(nil), // 29: c1.connector.v2.CredentialOptions.RandomPassword - (*CredentialOptions_NoPassword)(nil), // 30: c1.connector.v2.CredentialOptions.NoPassword - (*CredentialOptions_SSO)(nil), // 31: c1.connector.v2.CredentialOptions.SSO - (*CreateAccountResponse_SuccessResult)(nil), // 32: c1.connector.v2.CreateAccountResponse.SuccessResult - (*CreateAccountResponse_ActionRequiredResult)(nil), // 33: c1.connector.v2.CreateAccountResponse.ActionRequiredResult - (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 34: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig - (*anypb.Any)(nil), // 35: google.protobuf.Any - (*structpb.Struct)(nil), // 36: google.protobuf.Struct + (*LocalCredentialOptions)(nil), // 15: c1.connector.v2.LocalCredentialOptions + (*PasswordConstraint)(nil), // 16: c1.connector.v2.PasswordConstraint + (*CreateAccountRequest)(nil), // 17: c1.connector.v2.CreateAccountRequest + (*CreateAccountResponse)(nil), // 18: c1.connector.v2.CreateAccountResponse + (*EncryptedData)(nil), // 19: c1.connector.v2.EncryptedData + (*PlaintextData)(nil), // 20: c1.connector.v2.PlaintextData + (*EncryptionConfig)(nil), // 21: c1.connector.v2.EncryptionConfig + (*ResourceId)(nil), // 22: c1.connector.v2.ResourceId + (*Resource)(nil), // 23: c1.connector.v2.Resource + (*ResourcesServiceListResourcesRequest)(nil), // 24: c1.connector.v2.ResourcesServiceListResourcesRequest + (*ResourcesServiceListResourcesResponse)(nil), // 25: c1.connector.v2.ResourcesServiceListResourcesResponse + (*ResourceGetterServiceGetResourceRequest)(nil), // 26: c1.connector.v2.ResourceGetterServiceGetResourceRequest + (*ResourceGetterServiceGetResourceResponse)(nil), // 27: c1.connector.v2.ResourceGetterServiceGetResourceResponse + (*ExternalId)(nil), // 28: c1.connector.v2.ExternalId + (*AccountInfo_Email)(nil), // 29: c1.connector.v2.AccountInfo.Email + (*CredentialOptions_RandomPassword)(nil), // 30: c1.connector.v2.CredentialOptions.RandomPassword + (*CredentialOptions_NoPassword)(nil), // 31: c1.connector.v2.CredentialOptions.NoPassword + (*CredentialOptions_SSO)(nil), // 32: c1.connector.v2.CredentialOptions.SSO + (*CredentialOptions_EncryptedPassword)(nil), // 33: c1.connector.v2.CredentialOptions.EncryptedPassword + (*LocalCredentialOptions_RandomPassword)(nil), // 34: c1.connector.v2.LocalCredentialOptions.RandomPassword + (*LocalCredentialOptions_NoPassword)(nil), // 35: c1.connector.v2.LocalCredentialOptions.NoPassword + (*LocalCredentialOptions_SSO)(nil), // 36: c1.connector.v2.LocalCredentialOptions.SSO + (*LocalCredentialOptions_PlaintextPassword)(nil), // 37: c1.connector.v2.LocalCredentialOptions.PlaintextPassword + (*CreateAccountResponse_SuccessResult)(nil), // 38: c1.connector.v2.CreateAccountResponse.SuccessResult + (*CreateAccountResponse_ActionRequiredResult)(nil), // 39: c1.connector.v2.CreateAccountResponse.ActionRequiredResult + (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 40: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + (*anypb.Any)(nil), // 41: google.protobuf.Any + (*structpb.Struct)(nil), // 42: google.protobuf.Struct } var file_c1_connector_v2_resource_proto_depIdxs = []int32{ 0, // 0: c1.connector.v2.ResourceType.traits:type_name -> c1.connector.v2.ResourceType.Trait - 35, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any - 22, // 2: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.parent:type_name -> c1.connector.v2.Resource - 35, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any + 41, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any + 23, // 2: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.parent:type_name -> c1.connector.v2.Resource + 41, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any 2, // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.list:type_name -> c1.connector.v2.ResourceType - 35, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any - 22, // 6: c1.connector.v2.CreateResourceRequest.resource:type_name -> c1.connector.v2.Resource - 22, // 7: c1.connector.v2.CreateResourceResponse.created:type_name -> c1.connector.v2.Resource - 35, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any - 21, // 9: c1.connector.v2.DeleteResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 35, // 10: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any - 21, // 11: c1.connector.v2.DeleteResourceV2Request.resource_id:type_name -> c1.connector.v2.ResourceId - 35, // 12: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any - 21, // 13: c1.connector.v2.RotateCredentialRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 14, // 14: c1.connector.v2.RotateCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions - 20, // 15: c1.connector.v2.RotateCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 18, // 16: c1.connector.v2.RotateCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData - 21, // 17: c1.connector.v2.RotateCredentialResponse.resource_id:type_name -> c1.connector.v2.ResourceId - 35, // 18: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any - 28, // 19: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email - 36, // 20: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct - 29, // 21: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword - 30, // 22: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword - 31, // 23: c1.connector.v2.CredentialOptions.sso:type_name -> c1.connector.v2.CredentialOptions.SSO - 13, // 24: c1.connector.v2.CreateAccountRequest.account_info:type_name -> c1.connector.v2.AccountInfo - 14, // 25: c1.connector.v2.CreateAccountRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions - 20, // 26: c1.connector.v2.CreateAccountRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 32, // 27: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult - 33, // 28: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult - 18, // 29: c1.connector.v2.CreateAccountResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData - 35, // 30: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any - 22, // 31: c1.connector.v2.EncryptionConfig.principal:type_name -> c1.connector.v2.Resource - 34, // 32: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig - 21, // 33: c1.connector.v2.Resource.id:type_name -> c1.connector.v2.ResourceId - 21, // 34: c1.connector.v2.Resource.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 35, // 35: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any - 27, // 36: c1.connector.v2.Resource.external_id:type_name -> c1.connector.v2.ExternalId - 1, // 37: c1.connector.v2.Resource.creation_source:type_name -> c1.connector.v2.Resource.CreationSource - 21, // 38: c1.connector.v2.ResourcesServiceListResourcesRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 35, // 39: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any - 22, // 40: c1.connector.v2.ResourcesServiceListResourcesResponse.list:type_name -> c1.connector.v2.Resource - 35, // 41: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any - 21, // 42: c1.connector.v2.ResourceGetterServiceGetResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 21, // 43: c1.connector.v2.ResourceGetterServiceGetResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 35, // 44: c1.connector.v2.ResourceGetterServiceGetResourceRequest.annotations:type_name -> google.protobuf.Any - 22, // 45: c1.connector.v2.ResourceGetterServiceGetResourceResponse.resource:type_name -> c1.connector.v2.Resource - 35, // 46: c1.connector.v2.ResourceGetterServiceGetResourceResponse.annotations:type_name -> google.protobuf.Any - 15, // 47: c1.connector.v2.CredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint - 22, // 48: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource - 22, // 49: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource - 3, // 50: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest - 23, // 51: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest - 25, // 52: c1.connector.v2.ResourceGetterService.GetResource:input_type -> c1.connector.v2.ResourceGetterServiceGetResourceRequest - 5, // 53: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest - 7, // 54: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest - 9, // 55: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request - 11, // 56: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest - 16, // 57: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest - 4, // 58: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse - 24, // 59: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse - 26, // 60: c1.connector.v2.ResourceGetterService.GetResource:output_type -> c1.connector.v2.ResourceGetterServiceGetResourceResponse - 6, // 61: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse - 8, // 62: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse - 10, // 63: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response - 12, // 64: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse - 17, // 65: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse - 58, // [58:66] is the sub-list for method output_type - 50, // [50:58] is the sub-list for method input_type - 50, // [50:50] is the sub-list for extension type_name - 50, // [50:50] is the sub-list for extension extendee - 0, // [0:50] is the sub-list for field type_name + 41, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any + 23, // 6: c1.connector.v2.CreateResourceRequest.resource:type_name -> c1.connector.v2.Resource + 23, // 7: c1.connector.v2.CreateResourceResponse.created:type_name -> c1.connector.v2.Resource + 41, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any + 22, // 9: c1.connector.v2.DeleteResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 22, // 10: c1.connector.v2.DeleteResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 41, // 11: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any + 22, // 12: c1.connector.v2.DeleteResourceV2Request.resource_id:type_name -> c1.connector.v2.ResourceId + 22, // 13: c1.connector.v2.DeleteResourceV2Request.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 41, // 14: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any + 22, // 15: c1.connector.v2.RotateCredentialRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 14, // 16: c1.connector.v2.RotateCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions + 21, // 17: c1.connector.v2.RotateCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 19, // 18: c1.connector.v2.RotateCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 22, // 19: c1.connector.v2.RotateCredentialResponse.resource_id:type_name -> c1.connector.v2.ResourceId + 41, // 20: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any + 29, // 21: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email + 42, // 22: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct + 30, // 23: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword + 31, // 24: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword + 32, // 25: c1.connector.v2.CredentialOptions.sso:type_name -> c1.connector.v2.CredentialOptions.SSO + 33, // 26: c1.connector.v2.CredentialOptions.encrypted_password:type_name -> c1.connector.v2.CredentialOptions.EncryptedPassword + 34, // 27: c1.connector.v2.LocalCredentialOptions.random_password:type_name -> c1.connector.v2.LocalCredentialOptions.RandomPassword + 35, // 28: c1.connector.v2.LocalCredentialOptions.no_password:type_name -> c1.connector.v2.LocalCredentialOptions.NoPassword + 36, // 29: c1.connector.v2.LocalCredentialOptions.sso:type_name -> c1.connector.v2.LocalCredentialOptions.SSO + 37, // 30: c1.connector.v2.LocalCredentialOptions.plaintext_password:type_name -> c1.connector.v2.LocalCredentialOptions.PlaintextPassword + 13, // 31: c1.connector.v2.CreateAccountRequest.account_info:type_name -> c1.connector.v2.AccountInfo + 14, // 32: c1.connector.v2.CreateAccountRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions + 21, // 33: c1.connector.v2.CreateAccountRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 38, // 34: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult + 39, // 35: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult + 19, // 36: c1.connector.v2.CreateAccountResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 41, // 37: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any + 23, // 38: c1.connector.v2.EncryptionConfig.principal:type_name -> c1.connector.v2.Resource + 40, // 39: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + 22, // 40: c1.connector.v2.Resource.id:type_name -> c1.connector.v2.ResourceId + 22, // 41: c1.connector.v2.Resource.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 41, // 42: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any + 28, // 43: c1.connector.v2.Resource.external_id:type_name -> c1.connector.v2.ExternalId + 1, // 44: c1.connector.v2.Resource.creation_source:type_name -> c1.connector.v2.Resource.CreationSource + 22, // 45: c1.connector.v2.ResourcesServiceListResourcesRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 41, // 46: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any + 23, // 47: c1.connector.v2.ResourcesServiceListResourcesResponse.list:type_name -> c1.connector.v2.Resource + 41, // 48: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any + 22, // 49: c1.connector.v2.ResourceGetterServiceGetResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 22, // 50: c1.connector.v2.ResourceGetterServiceGetResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 41, // 51: c1.connector.v2.ResourceGetterServiceGetResourceRequest.annotations:type_name -> google.protobuf.Any + 23, // 52: c1.connector.v2.ResourceGetterServiceGetResourceResponse.resource:type_name -> c1.connector.v2.Resource + 41, // 53: c1.connector.v2.ResourceGetterServiceGetResourceResponse.annotations:type_name -> google.protobuf.Any + 16, // 54: c1.connector.v2.CredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint + 19, // 55: c1.connector.v2.CredentialOptions.EncryptedPassword.encrypted_passwords:type_name -> c1.connector.v2.EncryptedData + 16, // 56: c1.connector.v2.LocalCredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint + 23, // 57: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource + 23, // 58: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource + 3, // 59: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest + 24, // 60: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest + 26, // 61: c1.connector.v2.ResourceGetterService.GetResource:input_type -> c1.connector.v2.ResourceGetterServiceGetResourceRequest + 5, // 62: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest + 7, // 63: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest + 9, // 64: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request + 11, // 65: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest + 17, // 66: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest + 4, // 67: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse + 25, // 68: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse + 27, // 69: c1.connector.v2.ResourceGetterService.GetResource:output_type -> c1.connector.v2.ResourceGetterServiceGetResourceResponse + 6, // 70: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse + 8, // 71: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse + 10, // 72: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response + 12, // 73: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse + 18, // 74: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse + 67, // [67:75] is the sub-list for method output_type + 59, // [59:67] is the sub-list for method input_type + 59, // [59:59] is the sub-list for extension type_name + 59, // [59:59] is the sub-list for extension extendee + 0, // [0:59] is the sub-list for field type_name } func init() { file_c1_connector_v2_resource_proto_init() } @@ -2773,12 +3242,19 @@ func file_c1_connector_v2_resource_proto_init() { (*CredentialOptions_RandomPassword_)(nil), (*CredentialOptions_NoPassword_)(nil), (*CredentialOptions_Sso)(nil), + (*CredentialOptions_EncryptedPassword_)(nil), + } + file_c1_connector_v2_resource_proto_msgTypes[13].OneofWrappers = []any{ + (*LocalCredentialOptions_RandomPassword_)(nil), + (*LocalCredentialOptions_NoPassword_)(nil), + (*LocalCredentialOptions_Sso)(nil), + (*LocalCredentialOptions_PlaintextPassword_)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[15].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[16].OneofWrappers = []any{ (*CreateAccountResponse_Success)(nil), (*CreateAccountResponse_ActionRequired)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[18].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[19].OneofWrappers = []any{ (*EncryptionConfig_JwkPublicKeyConfig)(nil), } type x struct{} @@ -2787,7 +3263,7 @@ func file_c1_connector_v2_resource_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_resource_proto_rawDesc), len(file_c1_connector_v2_resource_proto_rawDesc)), NumEnums: 2, - NumMessages: 33, + NumMessages: 39, NumExtensions: 0, NumServices: 7, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.validate.go index db1dd836..bd2901cb 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.validate.go @@ -981,6 +981,35 @@ func (m *DeleteResourceRequest) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetParentResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DeleteResourceRequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DeleteResourceRequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetParentResourceId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DeleteResourceRequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return DeleteResourceRequestMultiError(errors) } @@ -1248,6 +1277,35 @@ func (m *DeleteResourceV2Request) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetParentResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DeleteResourceV2RequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DeleteResourceV2RequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetParentResourceId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DeleteResourceV2RequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return DeleteResourceV2RequestMultiError(errors) } @@ -2043,6 +2101,8 @@ func (m *CredentialOptions) validate(all bool) error { var errors []error + // no validation rules for ForceChangeAtNextLogin + switch v := m.Options.(type) { case *CredentialOptions_RandomPassword_: if v == nil { @@ -2167,6 +2227,47 @@ func (m *CredentialOptions) validate(all bool) error { } } + case *CredentialOptions_EncryptedPassword_: + if v == nil { + err := CredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetEncryptedPassword()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialOptionsValidationError{ + field: "EncryptedPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialOptionsValidationError{ + field: "EncryptedPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEncryptedPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CredentialOptionsValidationError{ + field: "EncryptedPassword", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -2251,46 +2352,213 @@ var _ interface { ErrorName() string } = CredentialOptionsValidationError{} -// Validate checks the field values on PasswordConstraint with the rules +// Validate checks the field values on LocalCredentialOptions with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. -func (m *PasswordConstraint) Validate() error { +func (m *LocalCredentialOptions) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on PasswordConstraint with the rules +// ValidateAll checks the field values on LocalCredentialOptions with the rules // defined in the proto definition for this message. If any rules are // violated, the result is a list of violation errors wrapped in -// PasswordConstraintMultiError, or nil if none found. -func (m *PasswordConstraint) ValidateAll() error { +// LocalCredentialOptionsMultiError, or nil if none found. +func (m *LocalCredentialOptions) ValidateAll() error { return m.validate(true) } -func (m *PasswordConstraint) validate(all bool) error { +func (m *LocalCredentialOptions) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for CharSet + // no validation rules for ForceChangeAtNextLogin - // no validation rules for MinCount + switch v := m.Options.(type) { + case *LocalCredentialOptions_RandomPassword_: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRandomPassword()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "RandomPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "RandomPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRandomPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "RandomPassword", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *LocalCredentialOptions_NoPassword_: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetNoPassword()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "NoPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "NoPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNoPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "NoPassword", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *LocalCredentialOptions_Sso: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetSso()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "Sso", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "Sso", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetSso()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "Sso", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *LocalCredentialOptions_PlaintextPassword_: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPlaintextPassword()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "PlaintextPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "PlaintextPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPlaintextPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "PlaintextPassword", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } if len(errors) > 0 { - return PasswordConstraintMultiError(errors) + return LocalCredentialOptionsMultiError(errors) } return nil } -// PasswordConstraintMultiError is an error wrapping multiple validation errors -// returned by PasswordConstraint.ValidateAll() if the designated constraints -// aren't met. -type PasswordConstraintMultiError []error +// LocalCredentialOptionsMultiError is an error wrapping multiple validation +// errors returned by LocalCredentialOptions.ValidateAll() if the designated +// constraints aren't met. +type LocalCredentialOptionsMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m PasswordConstraintMultiError) Error() string { +func (m LocalCredentialOptionsMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -2299,11 +2567,117 @@ func (m PasswordConstraintMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m PasswordConstraintMultiError) AllErrors() []error { return m } +func (m LocalCredentialOptionsMultiError) AllErrors() []error { return m } -// PasswordConstraintValidationError is the validation error returned by -// PasswordConstraint.Validate if the designated constraints aren't met. -type PasswordConstraintValidationError struct { +// LocalCredentialOptionsValidationError is the validation error returned by +// LocalCredentialOptions.Validate if the designated constraints aren't met. +type LocalCredentialOptionsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LocalCredentialOptionsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LocalCredentialOptionsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LocalCredentialOptionsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LocalCredentialOptionsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LocalCredentialOptionsValidationError) ErrorName() string { + return "LocalCredentialOptionsValidationError" +} + +// Error satisfies the builtin error interface +func (e LocalCredentialOptionsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLocalCredentialOptions.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LocalCredentialOptionsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LocalCredentialOptionsValidationError{} + +// Validate checks the field values on PasswordConstraint with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *PasswordConstraint) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PasswordConstraint with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// PasswordConstraintMultiError, or nil if none found. +func (m *PasswordConstraint) ValidateAll() error { + return m.validate(true) +} + +func (m *PasswordConstraint) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for CharSet + + // no validation rules for MinCount + + if len(errors) > 0 { + return PasswordConstraintMultiError(errors) + } + + return nil +} + +// PasswordConstraintMultiError is an error wrapping multiple validation errors +// returned by PasswordConstraint.ValidateAll() if the designated constraints +// aren't met. +type PasswordConstraintMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PasswordConstraintMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PasswordConstraintMultiError) AllErrors() []error { return m } + +// PasswordConstraintValidationError is the validation error returned by +// PasswordConstraint.Validate if the designated constraints aren't met. +type PasswordConstraintValidationError struct { field string reason string cause error @@ -4976,6 +5350,623 @@ var _ interface { ErrorName() string } = CredentialOptions_SSOValidationError{} +// Validate checks the field values on CredentialOptions_EncryptedPassword with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *CredentialOptions_EncryptedPassword) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CredentialOptions_EncryptedPassword +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// CredentialOptions_EncryptedPasswordMultiError, or nil if none found. +func (m *CredentialOptions_EncryptedPassword) ValidateAll() error { + return m.validate(true) +} + +func (m *CredentialOptions_EncryptedPassword) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(m.GetEncryptedPasswords()) < 1 { + err := CredentialOptions_EncryptedPasswordValidationError{ + field: "EncryptedPasswords", + reason: "value must contain at least 1 item(s)", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetEncryptedPasswords() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialOptions_EncryptedPasswordValidationError{ + field: fmt.Sprintf("EncryptedPasswords[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialOptions_EncryptedPasswordValidationError{ + field: fmt.Sprintf("EncryptedPasswords[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CredentialOptions_EncryptedPasswordValidationError{ + field: fmt.Sprintf("EncryptedPasswords[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return CredentialOptions_EncryptedPasswordMultiError(errors) + } + + return nil +} + +// CredentialOptions_EncryptedPasswordMultiError is an error wrapping multiple +// validation errors returned by +// CredentialOptions_EncryptedPassword.ValidateAll() if the designated +// constraints aren't met. +type CredentialOptions_EncryptedPasswordMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CredentialOptions_EncryptedPasswordMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CredentialOptions_EncryptedPasswordMultiError) AllErrors() []error { return m } + +// CredentialOptions_EncryptedPasswordValidationError is the validation error +// returned by CredentialOptions_EncryptedPassword.Validate if the designated +// constraints aren't met. +type CredentialOptions_EncryptedPasswordValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CredentialOptions_EncryptedPasswordValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CredentialOptions_EncryptedPasswordValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CredentialOptions_EncryptedPasswordValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CredentialOptions_EncryptedPasswordValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CredentialOptions_EncryptedPasswordValidationError) ErrorName() string { + return "CredentialOptions_EncryptedPasswordValidationError" +} + +// Error satisfies the builtin error interface +func (e CredentialOptions_EncryptedPasswordValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCredentialOptions_EncryptedPassword.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CredentialOptions_EncryptedPasswordValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CredentialOptions_EncryptedPasswordValidationError{} + +// Validate checks the field values on LocalCredentialOptions_RandomPassword +// with the rules defined in the proto definition for this message. If any +// rules are violated, the first error encountered is returned, or nil if +// there are no violations. +func (m *LocalCredentialOptions_RandomPassword) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LocalCredentialOptions_RandomPassword +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// LocalCredentialOptions_RandomPasswordMultiError, or nil if none found. +func (m *LocalCredentialOptions_RandomPassword) ValidateAll() error { + return m.validate(true) +} + +func (m *LocalCredentialOptions_RandomPassword) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if val := m.GetLength(); val < 8 || val > 64 { + err := LocalCredentialOptions_RandomPasswordValidationError{ + field: "Length", + reason: "value must be inside range [8, 64]", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetConstraints() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptions_RandomPasswordValidationError{ + field: fmt.Sprintf("Constraints[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptions_RandomPasswordValidationError{ + field: fmt.Sprintf("Constraints[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptions_RandomPasswordValidationError{ + field: fmt.Sprintf("Constraints[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return LocalCredentialOptions_RandomPasswordMultiError(errors) + } + + return nil +} + +// LocalCredentialOptions_RandomPasswordMultiError is an error wrapping +// multiple validation errors returned by +// LocalCredentialOptions_RandomPassword.ValidateAll() if the designated +// constraints aren't met. +type LocalCredentialOptions_RandomPasswordMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LocalCredentialOptions_RandomPasswordMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LocalCredentialOptions_RandomPasswordMultiError) AllErrors() []error { return m } + +// LocalCredentialOptions_RandomPasswordValidationError is the validation error +// returned by LocalCredentialOptions_RandomPassword.Validate if the +// designated constraints aren't met. +type LocalCredentialOptions_RandomPasswordValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LocalCredentialOptions_RandomPasswordValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LocalCredentialOptions_RandomPasswordValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LocalCredentialOptions_RandomPasswordValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LocalCredentialOptions_RandomPasswordValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LocalCredentialOptions_RandomPasswordValidationError) ErrorName() string { + return "LocalCredentialOptions_RandomPasswordValidationError" +} + +// Error satisfies the builtin error interface +func (e LocalCredentialOptions_RandomPasswordValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLocalCredentialOptions_RandomPassword.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LocalCredentialOptions_RandomPasswordValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LocalCredentialOptions_RandomPasswordValidationError{} + +// Validate checks the field values on LocalCredentialOptions_NoPassword with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *LocalCredentialOptions_NoPassword) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LocalCredentialOptions_NoPassword +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// LocalCredentialOptions_NoPasswordMultiError, or nil if none found. +func (m *LocalCredentialOptions_NoPassword) ValidateAll() error { + return m.validate(true) +} + +func (m *LocalCredentialOptions_NoPassword) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return LocalCredentialOptions_NoPasswordMultiError(errors) + } + + return nil +} + +// LocalCredentialOptions_NoPasswordMultiError is an error wrapping multiple +// validation errors returned by +// LocalCredentialOptions_NoPassword.ValidateAll() if the designated +// constraints aren't met. +type LocalCredentialOptions_NoPasswordMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LocalCredentialOptions_NoPasswordMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LocalCredentialOptions_NoPasswordMultiError) AllErrors() []error { return m } + +// LocalCredentialOptions_NoPasswordValidationError is the validation error +// returned by LocalCredentialOptions_NoPassword.Validate if the designated +// constraints aren't met. +type LocalCredentialOptions_NoPasswordValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LocalCredentialOptions_NoPasswordValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LocalCredentialOptions_NoPasswordValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LocalCredentialOptions_NoPasswordValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LocalCredentialOptions_NoPasswordValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LocalCredentialOptions_NoPasswordValidationError) ErrorName() string { + return "LocalCredentialOptions_NoPasswordValidationError" +} + +// Error satisfies the builtin error interface +func (e LocalCredentialOptions_NoPasswordValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLocalCredentialOptions_NoPassword.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LocalCredentialOptions_NoPasswordValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LocalCredentialOptions_NoPasswordValidationError{} + +// Validate checks the field values on LocalCredentialOptions_SSO with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *LocalCredentialOptions_SSO) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LocalCredentialOptions_SSO with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// LocalCredentialOptions_SSOMultiError, or nil if none found. +func (m *LocalCredentialOptions_SSO) ValidateAll() error { + return m.validate(true) +} + +func (m *LocalCredentialOptions_SSO) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for SsoProvider + + if len(errors) > 0 { + return LocalCredentialOptions_SSOMultiError(errors) + } + + return nil +} + +// LocalCredentialOptions_SSOMultiError is an error wrapping multiple +// validation errors returned by LocalCredentialOptions_SSO.ValidateAll() if +// the designated constraints aren't met. +type LocalCredentialOptions_SSOMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LocalCredentialOptions_SSOMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LocalCredentialOptions_SSOMultiError) AllErrors() []error { return m } + +// LocalCredentialOptions_SSOValidationError is the validation error returned +// by LocalCredentialOptions_SSO.Validate if the designated constraints aren't met. +type LocalCredentialOptions_SSOValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LocalCredentialOptions_SSOValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LocalCredentialOptions_SSOValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LocalCredentialOptions_SSOValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LocalCredentialOptions_SSOValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LocalCredentialOptions_SSOValidationError) ErrorName() string { + return "LocalCredentialOptions_SSOValidationError" +} + +// Error satisfies the builtin error interface +func (e LocalCredentialOptions_SSOValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLocalCredentialOptions_SSO.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LocalCredentialOptions_SSOValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LocalCredentialOptions_SSOValidationError{} + +// Validate checks the field values on LocalCredentialOptions_PlaintextPassword +// with the rules defined in the proto definition for this message. If any +// rules are violated, the first error encountered is returned, or nil if +// there are no violations. +func (m *LocalCredentialOptions_PlaintextPassword) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on +// LocalCredentialOptions_PlaintextPassword with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in +// LocalCredentialOptions_PlaintextPasswordMultiError, or nil if none found. +func (m *LocalCredentialOptions_PlaintextPassword) ValidateAll() error { + return m.validate(true) +} + +func (m *LocalCredentialOptions_PlaintextPassword) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for PlaintextPassword + + if len(errors) > 0 { + return LocalCredentialOptions_PlaintextPasswordMultiError(errors) + } + + return nil +} + +// LocalCredentialOptions_PlaintextPasswordMultiError is an error wrapping +// multiple validation errors returned by +// LocalCredentialOptions_PlaintextPassword.ValidateAll() if the designated +// constraints aren't met. +type LocalCredentialOptions_PlaintextPasswordMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LocalCredentialOptions_PlaintextPasswordMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LocalCredentialOptions_PlaintextPasswordMultiError) AllErrors() []error { return m } + +// LocalCredentialOptions_PlaintextPasswordValidationError is the validation +// error returned by LocalCredentialOptions_PlaintextPassword.Validate if the +// designated constraints aren't met. +type LocalCredentialOptions_PlaintextPasswordValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LocalCredentialOptions_PlaintextPasswordValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LocalCredentialOptions_PlaintextPasswordValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LocalCredentialOptions_PlaintextPasswordValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LocalCredentialOptions_PlaintextPasswordValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LocalCredentialOptions_PlaintextPasswordValidationError) ErrorName() string { + return "LocalCredentialOptions_PlaintextPasswordValidationError" +} + +// Error satisfies the builtin error interface +func (e LocalCredentialOptions_PlaintextPasswordValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLocalCredentialOptions_PlaintextPassword.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LocalCredentialOptions_PlaintextPasswordValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LocalCredentialOptions_PlaintextPasswordValidationError{} + // Validate checks the field values on CreateAccountResponse_SuccessResult with // the rules defined in the proto definition for this message. If any rules // are violated, the first error encountered is returned, or nil if there are diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go index cc49f178..4190d800 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go @@ -1315,10 +1315,12 @@ func (x *Task_HelloTask) GetAnnotations() []*anypb.Any { } type Task_SyncFullTask struct { - 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 + state protoimpl.MessageState `protogen:"open.v1"` + Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` + SkipExpandGrants bool `protobuf:"varint,2,opt,name=skip_expand_grants,json=skipExpandGrants,proto3" json:"skip_expand_grants,omitempty"` + SkipEntitlementsAndGrants bool `protobuf:"varint,3,opt,name=skip_entitlements_and_grants,json=skipEntitlementsAndGrants,proto3" json:"skip_entitlements_and_grants,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Task_SyncFullTask) Reset() { @@ -1358,6 +1360,20 @@ func (x *Task_SyncFullTask) GetAnnotations() []*anypb.Any { return nil } +func (x *Task_SyncFullTask) GetSkipExpandGrants() bool { + if x != nil { + return x.SkipExpandGrants + } + return false +} + +func (x *Task_SyncFullTask) GetSkipEntitlementsAndGrants() bool { + if x != nil { + return x.SkipEntitlementsAndGrants + } + return false +} + type Task_EventFeedTask struct { state protoimpl.MessageState `protogen:"open.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -1635,10 +1651,11 @@ func (x *Task_CreateResourceTask) GetResource() *v2.Resource { } type Task_DeleteResourceTask struct { - state protoimpl.MessageState `protogen:"open.v1"` - ResourceId *v2.ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ResourceId *v2.ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + ParentResourceId *v2.ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Task_DeleteResourceTask) Reset() { @@ -1678,6 +1695,13 @@ func (x *Task_DeleteResourceTask) GetResourceId() *v2.ResourceId { return nil } +func (x *Task_DeleteResourceTask) GetParentResourceId() *v2.ResourceId { + if x != nil { + return x.ParentResourceId + } + return nil +} + type Task_RotateCredentialsTask struct { state protoimpl.MessageState `protogen:"open.v1"` ResourceId *v2.ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` @@ -2821,7 +2845,7 @@ var file_c1_connectorapi_baton_v1_baton_proto_rawDesc = string([]byte{ 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 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, 0x9d, 0x26, 0x0a, 0x04, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x27, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, @@ -2952,11 +2976,18 @@ var file_c1_connectorapi_baton_v1_baton_proto_rawDesc = string([]byte{ 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, 0x1a, - 0x46, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x61, 0x73, 0x6b, 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, 0x1a, 0x7e, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0xb5, 0x01, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x61, 0x73, 0x6b, + 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, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x6b, 0x69, 0x70, + 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x6b, 0x69, 0x70, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, + 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x1c, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f, + 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x73, 0x6b, + 0x69, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x41, 0x6e, + 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x1a, 0x7e, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 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, @@ -3007,391 +3038,396 @@ var file_c1_connectorapi_baton_v1_baton_proto_rawDesc = string([]byte{ 0x61, 0x73, 0x6b, 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, 0x1a, 0x52, 0x0a, 0x12, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, - 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, 0x1a, 0xfa, - 0x01, 0x0a, 0x15, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x54, 0x61, 0x73, 0x6b, 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, 0x1a, 0xd5, 0x01, 0x0a, 0x10, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, - 0x12, 0x45, 0x0a, 0x0e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x9d, 0x01, 0x0a, 0x12, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x73, + 0x6b, 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, 0x1a, 0xfa, 0x01, 0x0a, 0x15, 0x52, + 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, + 0x54, 0x61, 0x73, 0x6b, 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, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x0c, 0x74, - 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 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, 0x71, 0x0a, 0x15, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x58, 0x0a, 0x0f, - 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x63, 0x6b, - 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x6b, 0x0a, 0x12, 0x42, 0x75, 0x6c, 0x6b, 0x47, 0x65, - 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x55, 0x0a, 0x0f, - 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, - 0x61, 0x73, 0x6b, 0x52, 0x0e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x73, 0x1a, 0x4f, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x54, 0x61, 0x73, 0x6b, 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, 0x1a, 0x64, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x49, 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, 0x1a, 0x4f, 0x0a, 0x15, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x54, - 0x61, 0x73, 0x6b, 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, 0x1a, 0x61, 0x0a, 0x13, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, - 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 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, 0x1a, 0x8b, - 0x01, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x54, - 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, - 0x02, 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, 0x04, - 0x61, 0x72, 0x67, 0x73, 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, 0x6e, 0x0a, 0x10, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x61, 0x73, 0x6b, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 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, 0x1a, 0x8e, 0x01, 0x0a, - 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x69, 0x66, 0x66, 0x54, - 0x61, 0x73, 0x6b, 0x12, 0x20, 0x0a, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x53, - 0x79, 0x6e, 0x63, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x79, 0x6e, - 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, - 0x79, 0x6e, 0x63, 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, 0x1a, 0xf9, 0x01, - 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x12, 0x68, - 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x79, - 0x6e, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x63, 0x31, 0x2e, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, - 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 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, 0x1a, 0xd5, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x45, 0x0a, 0x0e, + 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x0c, 0x74, 0x69, 0x63, 0x6b, 0x65, + 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 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, + 0x71, 0x0a, 0x15, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x58, 0x0a, 0x0f, 0x74, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, + 0x6b, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x0e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x1a, 0x6b, 0x0a, 0x12, 0x42, 0x75, 0x6c, 0x6b, 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x55, 0x0a, 0x0f, 0x74, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, + 0x6b, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x0e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, + 0x4f, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x73, 0x54, 0x61, 0x73, 0x6b, 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, - 0x1a, 0x47, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, - 0x79, 0x6e, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, - 0x12, 0x17, 0x0a, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x22, 0x73, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, - 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, - 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x04, 0x42, 0x0b, - 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xf3, 0x07, 0x0a, 0x18, - 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, - 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x32, 0x0a, - 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, - 0xfa, 0x42, 0x16, 0x72, 0x14, 0x32, 0x12, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, - 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x7c, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, - 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, - 0x6e, 0x66, 0x6f, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5c, 0x0a, 0x07, 0x6f, 0x73, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x53, - 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, - 0x6f, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5b, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, - 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x06, 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, 0x42, 0x08, - 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x95, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x2d, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, - 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, - 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x0f, 0x70, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0e, 0x70, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x81, 0x03, - 0x0a, 0x06, 0x4f, 0x53, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, - 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x1a, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, - 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, - 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x35, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, - 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x0f, 0x70, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, - 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, - 0x12, 0x31, 0x0a, 0x0e, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, - 0x01, 0x18, 0x80, 0x02, 0x52, 0x0d, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x0b, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, - 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, - 0x01, 0x18, 0x80, 0x02, 0x52, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x63, 0x68, - 0x12, 0x3f, 0x0a, 0x15, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x14, 0x76, 0x69, 0x72, - 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x22, 0x53, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 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, + 0x1a, 0x64, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, + 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x49, 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, 0x41, 0x0a, 0x1a, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4f, 0x0a, 0x15, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x54, 0x61, 0x73, 0x6b, 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, 0x1a, 0x61, 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 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, 0x1a, 0x8b, 0x01, 0x0a, 0x10, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 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, 0x04, 0x61, 0x72, 0x67, 0x73, + 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, 0x6e, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 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, 0x1a, 0x8e, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x69, 0x66, 0x66, 0x54, 0x61, 0x73, 0x6b, 0x12, + 0x20, 0x0a, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x49, + 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x79, 0x6e, 0x63, 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, 0x1a, 0xf9, 0x01, 0x0a, 0x0c, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x12, 0x68, 0x0a, 0x11, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x53, 0x79, 0x6e, + 0x63, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, + 0x6e, 0x63, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, + 0x79, 0x6e, 0x63, 0x73, 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, 0x1a, 0x47, 0x0a, 0x0f, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x12, + 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, 0x07, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x79, 0x6e, 0x63, 0x49, 0x64, 0x22, 0x73, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, + 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x4e, + 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x04, 0x42, 0x0b, 0x0a, 0x09, 0x74, 0x61, + 0x73, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xf3, 0x07, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, - 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x22, 0x83, 0x02, 0x0a, 0x1b, 0x42, 0x61, - 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x61, 0x73, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, - 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x07, 0x74, 0x61, 0x73, + 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xfa, 0x42, 0x16, 0x72, + 0x14, 0x32, 0x12, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, + 0x32, 0x37, 0x7d, 0x7c, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x65, 0x0a, + 0x0a, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, + 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5c, 0x0a, 0x07, 0x6f, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, + 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x53, 0x49, 0x6e, 0x66, 0x6f, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6f, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x5b, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, + 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, + 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x1a, 0x95, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x2d, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, + 0x02, 0x52, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, + 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x07, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x81, 0x03, 0x0a, 0x06, 0x4f, 0x53, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, + 0x80, 0x02, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x02, + 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, + 0x01, 0x18, 0x80, 0x02, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, + 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x12, 0x35, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, + 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0e, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x31, 0x0a, 0x0e, + 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, + 0x52, 0x0d, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x2b, 0x0a, 0x0b, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, + 0x52, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x63, 0x68, 0x12, 0x3f, 0x0a, 0x15, + 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, + 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x14, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x53, 0x0a, + 0x19, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, + 0x6c, 0x6f, 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, 0x41, 0x0a, 0x1a, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, + 0x6f, 0x73, 0x74, 0x49, 0x64, 0x22, 0x83, 0x02, 0x0a, 0x1b, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x6f, 0x6c, + 0x6c, 0x12, 0x40, 0x0a, 0x0e, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 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, 0x22, 0xb8, 0x01, 0x0a, 0x1c, + 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, + 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, + 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, + 0x73, 0x6b, 0x49, 0x64, 0x12, 0x40, 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, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb7, 0x01, 0x0a, 0x1d, 0x42, 0x61, 0x74, 0x6f, 0x6e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x12, 0x40, 0x0a, 0x0e, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x65, - 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 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, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x65, - 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 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, 0x22, - 0xb8, 0x01, 0x0a, 0x1c, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0xa3, 0x05, 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x65, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x56, 0x0a, 0x03, 0x65, 0x6f, 0x66, 0x18, 0x66, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, + 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x45, 0x4f, 0x46, 0x48, 0x00, 0x52, 0x03, 0x65, 0x6f, 0x66, 0x1a, 0xaa, 0x01, + 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb7, 0x01, 0x0a, 0x1d, 0x42, - 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, - 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 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, 0xa3, 0x05, 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x65, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x63, 0x31, 0x2e, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x59, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, - 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, - 0x61, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x56, 0x0a, 0x03, 0x65, 0x6f, 0x66, - 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, - 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x4f, 0x46, 0x48, 0x00, 0x52, 0x03, 0x65, 0x6f, - 0x66, 0x1a, 0xaa, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, - 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, - 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, - 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, - 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x40, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, - 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x2d, - 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x7a, - 0x06, 0x10, 0x01, 0x18, 0x80, 0x80, 0x40, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x7f, 0x0a, - 0x09, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x4f, 0x46, 0x12, 0x30, 0x0a, 0x0f, 0x73, 0x68, - 0x61, 0x32, 0x35, 0x36, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0e, 0x73, 0x68, - 0x61, 0x32, 0x35, 0x36, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x40, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, - 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, - 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x59, 0x0a, 0x1f, 0x42, 0x61, - 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x41, 0x73, 0x73, 0x65, 0x74, 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, 0x8d, 0x05, 0x0a, 0x1d, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, - 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, - 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, - 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, - 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, - 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x55, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x2d, 0x0a, 0x0a, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x7a, 0x06, 0x10, 0x01, 0x18, + 0x80, 0x80, 0x40, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x7f, 0x0a, 0x09, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x45, 0x4f, 0x46, 0x12, 0x30, 0x0a, 0x0f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, + 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0e, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x40, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, 0x0a, 0x03, 0x6d, 0x73, + 0x67, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x59, 0x0a, 0x1f, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, + 0x74, 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, 0x8d, 0x05, 0x0a, 0x1d, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x5b, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x65, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, - 0xa0, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x6f, 0x6e, - 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0c, 0x6e, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x40, - 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, - 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, - 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, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x1a, 0x7d, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x40, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, - 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 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, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x12, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x58, 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 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, - 0x17, 0x0a, 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x30, 0x0a, 0x16, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x80, 0x06, 0x0a, 0x0c, 0x42, - 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x05, 0x48, - 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x32, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, + 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, + 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, + 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x55, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, + 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5b, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0xa0, 0x01, 0x0a, 0x05, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x74, + 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x6f, + 0x6e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x40, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, + 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 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, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x7d, + 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x40, 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, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 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, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, + 0x0b, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x03, 0xf8, 0x42, + 0x01, 0x22, 0x58, 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 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, 0x17, 0x0a, 0x15, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x30, 0x0a, 0x16, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, + 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x80, 0x06, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x6f, 0x6e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f, + 0x12, 0x32, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x78, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x34, 0x2e, 0x63, 0x31, 0x2e, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x78, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x34, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, + 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, + 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, + 0x61, 0x74, 0x12, 0x36, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, + 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x35, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, - 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x09, 0x48, 0x65, 0x61, - 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x36, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, - 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, - 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x37, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, - 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, - 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, - 0x0a, 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x38, 0x2e, + 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x54, 0x61, 0x73, 0x6b, 0x12, 0x37, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, + 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x75, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, - 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x0b, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, - 0x35, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x75, 0x63, 0x74, - 0x6f, 0x6e, 0x65, 0x2f, 0x63, 0x31, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x31, - 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x61, - 0x74, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x28, 0x01, 0x12, 0x75, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, + 0x67, 0x69, 0x6e, 0x67, 0x12, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, + 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x75, 0x63, 0x74, 0x6f, 0x6e, 0x65, 0x2f, + 0x63, 0x31, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2f, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -3527,47 +3563,48 @@ var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 53, // 55: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig 49, // 56: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource 54, // 57: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 54, // 58: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 52, // 59: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 53, // 60: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 55, // 61: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 56, // 62: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 44, // 63: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 24, // 64: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 28, // 65: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 44, // 66: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 44, // 67: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 44, // 68: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 44, // 69: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 57, // 70: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 44, // 71: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 44, // 72: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 44, // 73: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any - 35, // 74: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - 44, // 75: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any - 44, // 76: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 44, // 77: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 44, // 78: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 44, // 79: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 44, // 80: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 44, // 81: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 82: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 83: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 6, // 84: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 10, // 85: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 8, // 86: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 12, // 87: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 88: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 5, // 89: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 7, // 90: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 11, // 91: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 9, // 92: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 13, // 93: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 88, // [88:94] is the sub-list for method output_type - 82, // [82:88] is the sub-list for method input_type - 82, // [82:82] is the sub-list for extension type_name - 82, // [82:82] is the sub-list for extension extendee - 0, // [0:82] is the sub-list for field type_name + 54, // 58: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 54, // 59: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 52, // 60: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 53, // 61: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 55, // 62: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 56, // 63: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 44, // 64: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 24, // 65: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 28, // 66: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 44, // 67: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 44, // 68: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 44, // 69: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any + 44, // 70: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any + 57, // 71: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct + 44, // 72: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any + 44, // 73: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any + 44, // 74: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any + 35, // 75: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + 44, // 76: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any + 44, // 77: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 44, // 78: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 44, // 79: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 44, // 80: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 44, // 81: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 44, // 82: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 2, // 83: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest + 4, // 84: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest + 6, // 85: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest + 10, // 86: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest + 8, // 87: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest + 12, // 88: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 89: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 5, // 90: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 7, // 91: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 11, // 92: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 9, // 93: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 13, // 94: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 89, // [89:95] is the sub-list for method output_type + 83, // [83:89] is the sub-list for method input_type + 83, // [83:83] is the sub-list for extension type_name + 83, // [83:83] is the sub-list for extension extendee + 0, // [0:83] is the sub-list for field type_name } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go index 15741a2a..bf4b6afe 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go @@ -3414,6 +3414,10 @@ func (m *Task_SyncFullTask) validate(all bool) error { } + // no validation rules for SkipExpandGrants + + // no validation rules for SkipEntitlementsAndGrants + if len(errors) > 0 { return Task_SyncFullTaskMultiError(errors) } @@ -4419,6 +4423,35 @@ func (m *Task_DeleteResourceTask) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetParentResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Task_DeleteResourceTaskValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Task_DeleteResourceTaskValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetParentResourceId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Task_DeleteResourceTaskValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return Task_DeleteResourceTaskMultiError(errors) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.go new file mode 100644 index 00000000..8be34ae2 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.go @@ -0,0 +1,997 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.4 +// protoc (unknown) +// source: c1/connectorapi/baton/v1/session.proto + +package v1 + +import ( + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{0} +} + +func (x *GetRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +func (x *GetRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type GetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{1} +} + +func (x *GetResponse) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type GetManyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetManyRequest) Reset() { + *x = GetManyRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetManyRequest) ProtoMessage() {} + +func (x *GetManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetManyRequest.ProtoReflect.Descriptor instead. +func (*GetManyRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{2} +} + +func (x *GetManyRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +func (x *GetManyRequest) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +type GetManyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetManyResponse) Reset() { + *x = GetManyResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetManyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetManyResponse) ProtoMessage() {} + +func (x *GetManyResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetManyResponse.ProtoReflect.Descriptor instead. +func (*GetManyResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{3} +} + +func (x *GetManyResponse) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GetManyResponse) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type GetAllRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllRequest) Reset() { + *x = GetAllRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllRequest) ProtoMessage() {} + +func (x *GetAllRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllRequest.ProtoReflect.Descriptor instead. +func (*GetAllRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{4} +} + +func (x *GetAllRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +func (x *GetAllRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type GetAllResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllResponse) Reset() { + *x = GetAllResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllResponse) ProtoMessage() {} + +func (x *GetAllResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllResponse.ProtoReflect.Descriptor instead. +func (*GetAllResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{5} +} + +func (x *GetAllResponse) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GetAllResponse) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *GetAllResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +type SetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetRequest) Reset() { + *x = SetRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetRequest) ProtoMessage() {} + +func (x *SetRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetRequest.ProtoReflect.Descriptor instead. +func (*SetRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{6} +} + +func (x *SetRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +func (x *SetRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *SetRequest) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type SetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetResponse) Reset() { + *x = SetResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetResponse) ProtoMessage() {} + +func (x *SetResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetResponse.ProtoReflect.Descriptor instead. +func (*SetResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{7} +} + +type SetManyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + Values map[string][]byte `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetManyRequest) Reset() { + *x = SetManyRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetManyRequest) ProtoMessage() {} + +func (x *SetManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetManyRequest.ProtoReflect.Descriptor instead. +func (*SetManyRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{8} +} + +func (x *SetManyRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +func (x *SetManyRequest) GetValues() map[string][]byte { + if x != nil { + return x.Values + } + return nil +} + +type SetManyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetManyResponse) Reset() { + *x = SetManyResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetManyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetManyResponse) ProtoMessage() {} + +func (x *SetManyResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetManyResponse.ProtoReflect.Descriptor instead. +func (*SetManyResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{9} +} + +type DeleteRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{10} +} + +func (x *DeleteRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +func (x *DeleteRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type DeleteResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{11} +} + +type DeleteManyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteManyRequest) Reset() { + *x = DeleteManyRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteManyRequest) ProtoMessage() {} + +func (x *DeleteManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteManyRequest.ProtoReflect.Descriptor instead. +func (*DeleteManyRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{12} +} + +func (x *DeleteManyRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +func (x *DeleteManyRequest) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +type DeleteManyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteManyResponse) Reset() { + *x = DeleteManyResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteManyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteManyResponse) ProtoMessage() {} + +func (x *DeleteManyResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteManyResponse.ProtoReflect.Descriptor instead. +func (*DeleteManyResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{13} +} + +type ClearRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClearRequest) Reset() { + *x = ClearRequest{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClearRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearRequest) ProtoMessage() {} + +func (x *ClearRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearRequest.ProtoReflect.Descriptor instead. +func (*ClearRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{14} +} + +func (x *ClearRequest) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + +type ClearResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClearResponse) Reset() { + *x = ClearResponse{} + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClearResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearResponse) ProtoMessage() {} + +func (x *ClearResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_session_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearResponse.ProtoReflect.Descriptor instead. +func (*ClearResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP(), []int{15} +} + +var File_c1_connectorapi_baton_v1_session_proto protoreflect.FileDescriptor + +var file_c1_connectorapi_baton_v1_session_proto_rawDesc = string([]byte{ + 0x0a, 0x26, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, + 0x69, 0x2f, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 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, 0x5d, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, + 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, + 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, + 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x23, 0x0a, 0x0b, 0x47, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x6f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x31, 0x0a, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, + 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x73, 0x79, + 0x6e, 0x63, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x42, 0x16, 0xfa, 0x42, 0x13, 0x92, 0x01, 0x10, 0x08, 0x01, 0x10, 0xc8, 0x01, 0x18, + 0x01, 0x22, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, + 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x61, 0x0a, 0x0d, 0x47, + 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, + 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, + 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x60, + 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x7e, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, + 0x0a, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, + 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x49, + 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, + 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, + 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x18, 0x80, 0x80, 0x40, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x0d, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xe5, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, + 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x73, + 0x79, 0x6e, 0x63, 0x49, 0x64, 0x12, 0x65, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x17, 0xfa, 0x42, 0x14, + 0x9a, 0x01, 0x11, 0x22, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x2a, 0x06, 0x7a, 0x04, + 0x18, 0x80, 0x80, 0x40, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x4d, 0x61, + 0x6e, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0x0a, 0x0d, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, + 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, + 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x12, 0x1c, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, + 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x10, 0x0a, 0x0e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x70, + 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, + 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, + 0x73, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x42, 0x14, 0xfa, 0x42, 0x11, 0x92, 0x01, 0x0e, 0x08, 0x01, 0x10, 0xc8, + 0x01, 0x22, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, + 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x0a, 0x0c, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, + 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, + 0x24, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x6c, 0x65, + 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8e, 0x06, 0x0a, 0x13, 0x42, + 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x54, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x24, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, + 0x61, 0x6e, 0x79, 0x12, 0x28, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x5f, 0x0a, 0x06, + 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x27, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x54, 0x0a, + 0x03, 0x53, 0x65, 0x74, 0x12, 0x24, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x28, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, + 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x61, 0x6e, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, + 0x27, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, + 0x6e, 0x79, 0x12, 0x2b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x5a, 0x0a, 0x05, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x12, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, + 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x75, 0x63, 0x74, 0x6f, 0x6e, + 0x65, 0x2f, 0x63, 0x31, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x31, 0x2f, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x61, 0x74, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_c1_connectorapi_baton_v1_session_proto_rawDescOnce sync.Once + file_c1_connectorapi_baton_v1_session_proto_rawDescData []byte +) + +func file_c1_connectorapi_baton_v1_session_proto_rawDescGZIP() []byte { + file_c1_connectorapi_baton_v1_session_proto_rawDescOnce.Do(func() { + file_c1_connectorapi_baton_v1_session_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_c1_connectorapi_baton_v1_session_proto_rawDesc), len(file_c1_connectorapi_baton_v1_session_proto_rawDesc))) + }) + return file_c1_connectorapi_baton_v1_session_proto_rawDescData +} + +var file_c1_connectorapi_baton_v1_session_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_c1_connectorapi_baton_v1_session_proto_goTypes = []any{ + (*GetRequest)(nil), // 0: c1.connectorapi.baton.v1.GetRequest + (*GetResponse)(nil), // 1: c1.connectorapi.baton.v1.GetResponse + (*GetManyRequest)(nil), // 2: c1.connectorapi.baton.v1.GetManyRequest + (*GetManyResponse)(nil), // 3: c1.connectorapi.baton.v1.GetManyResponse + (*GetAllRequest)(nil), // 4: c1.connectorapi.baton.v1.GetAllRequest + (*GetAllResponse)(nil), // 5: c1.connectorapi.baton.v1.GetAllResponse + (*SetRequest)(nil), // 6: c1.connectorapi.baton.v1.SetRequest + (*SetResponse)(nil), // 7: c1.connectorapi.baton.v1.SetResponse + (*SetManyRequest)(nil), // 8: c1.connectorapi.baton.v1.SetManyRequest + (*SetManyResponse)(nil), // 9: c1.connectorapi.baton.v1.SetManyResponse + (*DeleteRequest)(nil), // 10: c1.connectorapi.baton.v1.DeleteRequest + (*DeleteResponse)(nil), // 11: c1.connectorapi.baton.v1.DeleteResponse + (*DeleteManyRequest)(nil), // 12: c1.connectorapi.baton.v1.DeleteManyRequest + (*DeleteManyResponse)(nil), // 13: c1.connectorapi.baton.v1.DeleteManyResponse + (*ClearRequest)(nil), // 14: c1.connectorapi.baton.v1.ClearRequest + (*ClearResponse)(nil), // 15: c1.connectorapi.baton.v1.ClearResponse + nil, // 16: c1.connectorapi.baton.v1.SetManyRequest.ValuesEntry +} +var file_c1_connectorapi_baton_v1_session_proto_depIdxs = []int32{ + 16, // 0: c1.connectorapi.baton.v1.SetManyRequest.values:type_name -> c1.connectorapi.baton.v1.SetManyRequest.ValuesEntry + 0, // 1: c1.connectorapi.baton.v1.BatonSessionService.Get:input_type -> c1.connectorapi.baton.v1.GetRequest + 2, // 2: c1.connectorapi.baton.v1.BatonSessionService.GetMany:input_type -> c1.connectorapi.baton.v1.GetManyRequest + 4, // 3: c1.connectorapi.baton.v1.BatonSessionService.GetAll:input_type -> c1.connectorapi.baton.v1.GetAllRequest + 6, // 4: c1.connectorapi.baton.v1.BatonSessionService.Set:input_type -> c1.connectorapi.baton.v1.SetRequest + 8, // 5: c1.connectorapi.baton.v1.BatonSessionService.SetMany:input_type -> c1.connectorapi.baton.v1.SetManyRequest + 10, // 6: c1.connectorapi.baton.v1.BatonSessionService.Delete:input_type -> c1.connectorapi.baton.v1.DeleteRequest + 12, // 7: c1.connectorapi.baton.v1.BatonSessionService.DeleteMany:input_type -> c1.connectorapi.baton.v1.DeleteManyRequest + 14, // 8: c1.connectorapi.baton.v1.BatonSessionService.Clear:input_type -> c1.connectorapi.baton.v1.ClearRequest + 1, // 9: c1.connectorapi.baton.v1.BatonSessionService.Get:output_type -> c1.connectorapi.baton.v1.GetResponse + 3, // 10: c1.connectorapi.baton.v1.BatonSessionService.GetMany:output_type -> c1.connectorapi.baton.v1.GetManyResponse + 5, // 11: c1.connectorapi.baton.v1.BatonSessionService.GetAll:output_type -> c1.connectorapi.baton.v1.GetAllResponse + 7, // 12: c1.connectorapi.baton.v1.BatonSessionService.Set:output_type -> c1.connectorapi.baton.v1.SetResponse + 9, // 13: c1.connectorapi.baton.v1.BatonSessionService.SetMany:output_type -> c1.connectorapi.baton.v1.SetManyResponse + 11, // 14: c1.connectorapi.baton.v1.BatonSessionService.Delete:output_type -> c1.connectorapi.baton.v1.DeleteResponse + 13, // 15: c1.connectorapi.baton.v1.BatonSessionService.DeleteMany:output_type -> c1.connectorapi.baton.v1.DeleteManyResponse + 15, // 16: c1.connectorapi.baton.v1.BatonSessionService.Clear:output_type -> c1.connectorapi.baton.v1.ClearResponse + 9, // [9:17] is the sub-list for method output_type + 1, // [1:9] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_c1_connectorapi_baton_v1_session_proto_init() } +func file_c1_connectorapi_baton_v1_session_proto_init() { + if File_c1_connectorapi_baton_v1_session_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connectorapi_baton_v1_session_proto_rawDesc), len(file_c1_connectorapi_baton_v1_session_proto_rawDesc)), + NumEnums: 0, + NumMessages: 17, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_c1_connectorapi_baton_v1_session_proto_goTypes, + DependencyIndexes: file_c1_connectorapi_baton_v1_session_proto_depIdxs, + MessageInfos: file_c1_connectorapi_baton_v1_session_proto_msgTypes, + }.Build() + File_c1_connectorapi_baton_v1_session_proto = out.File + file_c1_connectorapi_baton_v1_session_proto_goTypes = nil + file_c1_connectorapi_baton_v1_session_proto_depIdxs = nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.validate.go new file mode 100644 index 00000000..fcf133ae --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session.pb.validate.go @@ -0,0 +1,1903 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: c1/connectorapi/baton/v1/session.proto + +package v1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on GetRequest with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetRequestMultiError, or +// nil if none found. +func (m *GetRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_GetRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := GetRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := utf8.RuneCountInString(m.GetKey()); l < 1 || l > 256 { + err := GetRequestValidationError{ + field: "Key", + reason: "value length must be between 1 and 256 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return GetRequestMultiError(errors) + } + + return nil +} + +// GetRequestMultiError is an error wrapping multiple validation errors +// returned by GetRequest.ValidateAll() if the designated constraints aren't met. +type GetRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetRequestMultiError) AllErrors() []error { return m } + +// GetRequestValidationError is the validation error returned by +// GetRequest.Validate if the designated constraints aren't met. +type GetRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetRequestValidationError) ErrorName() string { return "GetRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetRequestValidationError{} + +var _GetRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on GetResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetResponseMultiError, or +// nil if none found. +func (m *GetResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Value + + if len(errors) > 0 { + return GetResponseMultiError(errors) + } + + return nil +} + +// GetResponseMultiError is an error wrapping multiple validation errors +// returned by GetResponse.ValidateAll() if the designated constraints aren't met. +type GetResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetResponseMultiError) AllErrors() []error { return m } + +// GetResponseValidationError is the validation error returned by +// GetResponse.Validate if the designated constraints aren't met. +type GetResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetResponseValidationError) ErrorName() string { return "GetResponseValidationError" } + +// Error satisfies the builtin error interface +func (e GetResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetResponseValidationError{} + +// Validate checks the field values on GetManyRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetManyRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetManyRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetManyRequestMultiError, +// or nil if none found. +func (m *GetManyRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetManyRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_GetManyRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := GetManyRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := len(m.GetKeys()); l < 1 || l > 200 { + err := GetManyRequestValidationError{ + field: "Keys", + reason: "value must contain between 1 and 200 items, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + _GetManyRequest_Keys_Unique := make(map[string]struct{}, len(m.GetKeys())) + + for idx, item := range m.GetKeys() { + _, _ = idx, item + + if _, exists := _GetManyRequest_Keys_Unique[item]; exists { + err := GetManyRequestValidationError{ + field: fmt.Sprintf("Keys[%v]", idx), + reason: "repeated value must contain unique items", + } + if !all { + return err + } + errors = append(errors, err) + } else { + _GetManyRequest_Keys_Unique[item] = struct{}{} + } + + if l := utf8.RuneCountInString(item); l < 1 || l > 256 { + err := GetManyRequestValidationError{ + field: fmt.Sprintf("Keys[%v]", idx), + reason: "value length must be between 1 and 256 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if len(errors) > 0 { + return GetManyRequestMultiError(errors) + } + + return nil +} + +// GetManyRequestMultiError is an error wrapping multiple validation errors +// returned by GetManyRequest.ValidateAll() if the designated constraints +// aren't met. +type GetManyRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetManyRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetManyRequestMultiError) AllErrors() []error { return m } + +// GetManyRequestValidationError is the validation error returned by +// GetManyRequest.Validate if the designated constraints aren't met. +type GetManyRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetManyRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetManyRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetManyRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetManyRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetManyRequestValidationError) ErrorName() string { return "GetManyRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetManyRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetManyRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetManyRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetManyRequestValidationError{} + +var _GetManyRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on GetManyResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *GetManyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetManyResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetManyResponseMultiError, or nil if none found. +func (m *GetManyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetManyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Key + + // no validation rules for Value + + if len(errors) > 0 { + return GetManyResponseMultiError(errors) + } + + return nil +} + +// GetManyResponseMultiError is an error wrapping multiple validation errors +// returned by GetManyResponse.ValidateAll() if the designated constraints +// aren't met. +type GetManyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetManyResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetManyResponseMultiError) AllErrors() []error { return m } + +// GetManyResponseValidationError is the validation error returned by +// GetManyResponse.Validate if the designated constraints aren't met. +type GetManyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetManyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetManyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetManyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetManyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetManyResponseValidationError) ErrorName() string { return "GetManyResponseValidationError" } + +// Error satisfies the builtin error interface +func (e GetManyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetManyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetManyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetManyResponseValidationError{} + +// Validate checks the field values on GetAllRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetAllRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAllRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetAllRequestMultiError, or +// nil if none found. +func (m *GetAllRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAllRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_GetAllRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := GetAllRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for PageToken + + if len(errors) > 0 { + return GetAllRequestMultiError(errors) + } + + return nil +} + +// GetAllRequestMultiError is an error wrapping multiple validation errors +// returned by GetAllRequest.ValidateAll() if the designated constraints +// aren't met. +type GetAllRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAllRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAllRequestMultiError) AllErrors() []error { return m } + +// GetAllRequestValidationError is the validation error returned by +// GetAllRequest.Validate if the designated constraints aren't met. +type GetAllRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAllRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAllRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAllRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAllRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAllRequestValidationError) ErrorName() string { return "GetAllRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetAllRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAllRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAllRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAllRequestValidationError{} + +var _GetAllRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on GetAllResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *GetAllResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAllResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in GetAllResponseMultiError, +// or nil if none found. +func (m *GetAllResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAllResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Key + + // no validation rules for Value + + // no validation rules for NextPageToken + + if len(errors) > 0 { + return GetAllResponseMultiError(errors) + } + + return nil +} + +// GetAllResponseMultiError is an error wrapping multiple validation errors +// returned by GetAllResponse.ValidateAll() if the designated constraints +// aren't met. +type GetAllResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAllResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAllResponseMultiError) AllErrors() []error { return m } + +// GetAllResponseValidationError is the validation error returned by +// GetAllResponse.Validate if the designated constraints aren't met. +type GetAllResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAllResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAllResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAllResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAllResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAllResponseValidationError) ErrorName() string { return "GetAllResponseValidationError" } + +// Error satisfies the builtin error interface +func (e GetAllResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAllResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAllResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAllResponseValidationError{} + +// Validate checks the field values on SetRequest with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *SetRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SetRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in SetRequestMultiError, or +// nil if none found. +func (m *SetRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *SetRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_SetRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := SetRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := utf8.RuneCountInString(m.GetKey()); l < 1 || l > 256 { + err := SetRequestValidationError{ + field: "Key", + reason: "value length must be between 1 and 256 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(m.GetValue()) > 1048576 { + err := SetRequestValidationError{ + field: "Value", + reason: "value length must be at most 1048576 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return SetRequestMultiError(errors) + } + + return nil +} + +// SetRequestMultiError is an error wrapping multiple validation errors +// returned by SetRequest.ValidateAll() if the designated constraints aren't met. +type SetRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SetRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SetRequestMultiError) AllErrors() []error { return m } + +// SetRequestValidationError is the validation error returned by +// SetRequest.Validate if the designated constraints aren't met. +type SetRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SetRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SetRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SetRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SetRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SetRequestValidationError) ErrorName() string { return "SetRequestValidationError" } + +// Error satisfies the builtin error interface +func (e SetRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSetRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SetRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SetRequestValidationError{} + +var _SetRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on SetResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *SetResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SetResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in SetResponseMultiError, or +// nil if none found. +func (m *SetResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *SetResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return SetResponseMultiError(errors) + } + + return nil +} + +// SetResponseMultiError is an error wrapping multiple validation errors +// returned by SetResponse.ValidateAll() if the designated constraints aren't met. +type SetResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SetResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SetResponseMultiError) AllErrors() []error { return m } + +// SetResponseValidationError is the validation error returned by +// SetResponse.Validate if the designated constraints aren't met. +type SetResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SetResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SetResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SetResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SetResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SetResponseValidationError) ErrorName() string { return "SetResponseValidationError" } + +// Error satisfies the builtin error interface +func (e SetResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSetResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SetResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SetResponseValidationError{} + +// Validate checks the field values on SetManyRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *SetManyRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SetManyRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in SetManyRequestMultiError, +// or nil if none found. +func (m *SetManyRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *SetManyRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_SetManyRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := SetManyRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + { + sorted_keys := make([]string, len(m.GetValues())) + i := 0 + for key := range m.GetValues() { + sorted_keys[i] = key + i++ + } + sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) + for _, key := range sorted_keys { + val := m.GetValues()[key] + _ = val + + if l := utf8.RuneCountInString(key); l < 1 || l > 256 { + err := SetManyRequestValidationError{ + field: fmt.Sprintf("Values[%v]", key), + reason: "value length must be between 1 and 256 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(val) > 1048576 { + err := SetManyRequestValidationError{ + field: fmt.Sprintf("Values[%v]", key), + reason: "value length must be at most 1048576 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + } + + if len(errors) > 0 { + return SetManyRequestMultiError(errors) + } + + return nil +} + +// SetManyRequestMultiError is an error wrapping multiple validation errors +// returned by SetManyRequest.ValidateAll() if the designated constraints +// aren't met. +type SetManyRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SetManyRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SetManyRequestMultiError) AllErrors() []error { return m } + +// SetManyRequestValidationError is the validation error returned by +// SetManyRequest.Validate if the designated constraints aren't met. +type SetManyRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SetManyRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SetManyRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SetManyRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SetManyRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SetManyRequestValidationError) ErrorName() string { return "SetManyRequestValidationError" } + +// Error satisfies the builtin error interface +func (e SetManyRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSetManyRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SetManyRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SetManyRequestValidationError{} + +var _SetManyRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on SetManyResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *SetManyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SetManyResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SetManyResponseMultiError, or nil if none found. +func (m *SetManyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *SetManyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return SetManyResponseMultiError(errors) + } + + return nil +} + +// SetManyResponseMultiError is an error wrapping multiple validation errors +// returned by SetManyResponse.ValidateAll() if the designated constraints +// aren't met. +type SetManyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SetManyResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SetManyResponseMultiError) AllErrors() []error { return m } + +// SetManyResponseValidationError is the validation error returned by +// SetManyResponse.Validate if the designated constraints aren't met. +type SetManyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SetManyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SetManyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SetManyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SetManyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SetManyResponseValidationError) ErrorName() string { return "SetManyResponseValidationError" } + +// Error satisfies the builtin error interface +func (e SetManyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSetManyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SetManyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SetManyResponseValidationError{} + +// Validate checks the field values on DeleteRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *DeleteRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in DeleteRequestMultiError, or +// nil if none found. +func (m *DeleteRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_DeleteRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := DeleteRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := utf8.RuneCountInString(m.GetKey()); l < 1 || l > 256 { + err := DeleteRequestValidationError{ + field: "Key", + reason: "value length must be between 1 and 256 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return DeleteRequestMultiError(errors) + } + + return nil +} + +// DeleteRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteRequestMultiError) AllErrors() []error { return m } + +// DeleteRequestValidationError is the validation error returned by +// DeleteRequest.Validate if the designated constraints aren't met. +type DeleteRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteRequestValidationError) ErrorName() string { return "DeleteRequestValidationError" } + +// Error satisfies the builtin error interface +func (e DeleteRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteRequestValidationError{} + +var _DeleteRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on DeleteResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *DeleteResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in DeleteResponseMultiError, +// or nil if none found. +func (m *DeleteResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return DeleteResponseMultiError(errors) + } + + return nil +} + +// DeleteResponseMultiError is an error wrapping multiple validation errors +// returned by DeleteResponse.ValidateAll() if the designated constraints +// aren't met. +type DeleteResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteResponseMultiError) AllErrors() []error { return m } + +// DeleteResponseValidationError is the validation error returned by +// DeleteResponse.Validate if the designated constraints aren't met. +type DeleteResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteResponseValidationError) ErrorName() string { return "DeleteResponseValidationError" } + +// Error satisfies the builtin error interface +func (e DeleteResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteResponseValidationError{} + +// Validate checks the field values on DeleteManyRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *DeleteManyRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteManyRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteManyRequestMultiError, or nil if none found. +func (m *DeleteManyRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteManyRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_DeleteManyRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := DeleteManyRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := len(m.GetKeys()); l < 1 || l > 200 { + err := DeleteManyRequestValidationError{ + field: "Keys", + reason: "value must contain between 1 and 200 items, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetKeys() { + _, _ = idx, item + + if l := utf8.RuneCountInString(item); l < 1 || l > 256 { + err := DeleteManyRequestValidationError{ + field: fmt.Sprintf("Keys[%v]", idx), + reason: "value length must be between 1 and 256 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if len(errors) > 0 { + return DeleteManyRequestMultiError(errors) + } + + return nil +} + +// DeleteManyRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteManyRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteManyRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteManyRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteManyRequestMultiError) AllErrors() []error { return m } + +// DeleteManyRequestValidationError is the validation error returned by +// DeleteManyRequest.Validate if the designated constraints aren't met. +type DeleteManyRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteManyRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteManyRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteManyRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteManyRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteManyRequestValidationError) ErrorName() string { + return "DeleteManyRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteManyRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteManyRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteManyRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteManyRequestValidationError{} + +var _DeleteManyRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on DeleteManyResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteManyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteManyResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteManyResponseMultiError, or nil if none found. +func (m *DeleteManyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteManyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return DeleteManyResponseMultiError(errors) + } + + return nil +} + +// DeleteManyResponseMultiError is an error wrapping multiple validation errors +// returned by DeleteManyResponse.ValidateAll() if the designated constraints +// aren't met. +type DeleteManyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteManyResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteManyResponseMultiError) AllErrors() []error { return m } + +// DeleteManyResponseValidationError is the validation error returned by +// DeleteManyResponse.Validate if the designated constraints aren't met. +type DeleteManyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteManyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteManyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteManyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteManyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteManyResponseValidationError) ErrorName() string { + return "DeleteManyResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteManyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteManyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteManyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteManyResponseValidationError{} + +// Validate checks the field values on ClearRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *ClearRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ClearRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ClearRequestMultiError, or +// nil if none found. +func (m *ClearRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ClearRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if !_ClearRequest_SyncId_Pattern.MatchString(m.GetSyncId()) { + err := ClearRequestValidationError{ + field: "SyncId", + reason: "value does not match regex pattern \"^[a-zA-Z0-9]{27}$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ClearRequestMultiError(errors) + } + + return nil +} + +// ClearRequestMultiError is an error wrapping multiple validation errors +// returned by ClearRequest.ValidateAll() if the designated constraints aren't met. +type ClearRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ClearRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ClearRequestMultiError) AllErrors() []error { return m } + +// ClearRequestValidationError is the validation error returned by +// ClearRequest.Validate if the designated constraints aren't met. +type ClearRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ClearRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ClearRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ClearRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ClearRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ClearRequestValidationError) ErrorName() string { return "ClearRequestValidationError" } + +// Error satisfies the builtin error interface +func (e ClearRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClearRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ClearRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ClearRequestValidationError{} + +var _ClearRequest_SyncId_Pattern = regexp.MustCompile("^[a-zA-Z0-9]{27}$") + +// Validate checks the field values on ClearResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *ClearResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ClearResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ClearResponseMultiError, or +// nil if none found. +func (m *ClearResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ClearResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return ClearResponseMultiError(errors) + } + + return nil +} + +// ClearResponseMultiError is an error wrapping multiple validation errors +// returned by ClearResponse.ValidateAll() if the designated constraints +// aren't met. +type ClearResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ClearResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ClearResponseMultiError) AllErrors() []error { return m } + +// ClearResponseValidationError is the validation error returned by +// ClearResponse.Validate if the designated constraints aren't met. +type ClearResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ClearResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ClearResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ClearResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ClearResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ClearResponseValidationError) ErrorName() string { return "ClearResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ClearResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sClearResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ClearResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ClearResponseValidationError{} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session_grpc.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session_grpc.pb.go new file mode 100644 index 00000000..d5201be2 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/session_grpc.pb.go @@ -0,0 +1,392 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: c1/connectorapi/baton/v1/session.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + BatonSessionService_Get_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/Get" + BatonSessionService_GetMany_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/GetMany" + BatonSessionService_GetAll_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/GetAll" + BatonSessionService_Set_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/Set" + BatonSessionService_SetMany_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/SetMany" + BatonSessionService_Delete_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/Delete" + BatonSessionService_DeleteMany_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/DeleteMany" + BatonSessionService_Clear_FullMethodName = "/c1.connectorapi.baton.v1.BatonSessionService/Clear" +) + +// BatonSessionServiceClient is the client API for BatonSessionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BatonSessionServiceClient interface { + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) + GetMany(ctx context.Context, in *GetManyRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetManyResponse], error) + GetAll(ctx context.Context, in *GetAllRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetAllResponse], error) + Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) + SetMany(ctx context.Context, in *SetManyRequest, opts ...grpc.CallOption) (*SetManyResponse, error) + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + DeleteMany(ctx context.Context, in *DeleteManyRequest, opts ...grpc.CallOption) (*DeleteManyResponse, error) + Clear(ctx context.Context, in *ClearRequest, opts ...grpc.CallOption) (*ClearResponse, error) +} + +type batonSessionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBatonSessionServiceClient(cc grpc.ClientConnInterface) BatonSessionServiceClient { + return &batonSessionServiceClient{cc} +} + +func (c *batonSessionServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetResponse) + err := c.cc.Invoke(ctx, BatonSessionService_Get_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *batonSessionServiceClient) GetMany(ctx context.Context, in *GetManyRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetManyResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BatonSessionService_ServiceDesc.Streams[0], BatonSessionService_GetMany_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetManyRequest, GetManyResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BatonSessionService_GetManyClient = grpc.ServerStreamingClient[GetManyResponse] + +func (c *batonSessionServiceClient) GetAll(ctx context.Context, in *GetAllRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetAllResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BatonSessionService_ServiceDesc.Streams[1], BatonSessionService_GetAll_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetAllRequest, GetAllResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BatonSessionService_GetAllClient = grpc.ServerStreamingClient[GetAllResponse] + +func (c *batonSessionServiceClient) Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SetResponse) + err := c.cc.Invoke(ctx, BatonSessionService_Set_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *batonSessionServiceClient) SetMany(ctx context.Context, in *SetManyRequest, opts ...grpc.CallOption) (*SetManyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SetManyResponse) + err := c.cc.Invoke(ctx, BatonSessionService_SetMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *batonSessionServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, BatonSessionService_Delete_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *batonSessionServiceClient) DeleteMany(ctx context.Context, in *DeleteManyRequest, opts ...grpc.CallOption) (*DeleteManyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteManyResponse) + err := c.cc.Invoke(ctx, BatonSessionService_DeleteMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *batonSessionServiceClient) Clear(ctx context.Context, in *ClearRequest, opts ...grpc.CallOption) (*ClearResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ClearResponse) + err := c.cc.Invoke(ctx, BatonSessionService_Clear_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BatonSessionServiceServer is the server API for BatonSessionService service. +// All implementations should embed UnimplementedBatonSessionServiceServer +// for forward compatibility. +type BatonSessionServiceServer interface { + Get(context.Context, *GetRequest) (*GetResponse, error) + GetMany(*GetManyRequest, grpc.ServerStreamingServer[GetManyResponse]) error + GetAll(*GetAllRequest, grpc.ServerStreamingServer[GetAllResponse]) error + Set(context.Context, *SetRequest) (*SetResponse, error) + SetMany(context.Context, *SetManyRequest) (*SetManyResponse, error) + Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) + DeleteMany(context.Context, *DeleteManyRequest) (*DeleteManyResponse, error) + Clear(context.Context, *ClearRequest) (*ClearResponse, error) +} + +// UnimplementedBatonSessionServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBatonSessionServiceServer struct{} + +func (UnimplementedBatonSessionServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedBatonSessionServiceServer) GetMany(*GetManyRequest, grpc.ServerStreamingServer[GetManyResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetMany not implemented") +} +func (UnimplementedBatonSessionServiceServer) GetAll(*GetAllRequest, grpc.ServerStreamingServer[GetAllResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedBatonSessionServiceServer) Set(context.Context, *SetRequest) (*SetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Set not implemented") +} +func (UnimplementedBatonSessionServiceServer) SetMany(context.Context, *SetManyRequest) (*SetManyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMany not implemented") +} +func (UnimplementedBatonSessionServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedBatonSessionServiceServer) DeleteMany(context.Context, *DeleteManyRequest) (*DeleteManyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMany not implemented") +} +func (UnimplementedBatonSessionServiceServer) Clear(context.Context, *ClearRequest) (*ClearResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Clear not implemented") +} +func (UnimplementedBatonSessionServiceServer) testEmbeddedByValue() {} + +// UnsafeBatonSessionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BatonSessionServiceServer will +// result in compilation errors. +type UnsafeBatonSessionServiceServer interface { + mustEmbedUnimplementedBatonSessionServiceServer() +} + +func RegisterBatonSessionServiceServer(s grpc.ServiceRegistrar, srv BatonSessionServiceServer) { + // If the following call pancis, it indicates UnimplementedBatonSessionServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&BatonSessionService_ServiceDesc, srv) +} + +func _BatonSessionService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BatonSessionServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BatonSessionService_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BatonSessionServiceServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BatonSessionService_GetMany_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetManyRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BatonSessionServiceServer).GetMany(m, &grpc.GenericServerStream[GetManyRequest, GetManyResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BatonSessionService_GetManyServer = grpc.ServerStreamingServer[GetManyResponse] + +func _BatonSessionService_GetAll_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetAllRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BatonSessionServiceServer).GetAll(m, &grpc.GenericServerStream[GetAllRequest, GetAllResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BatonSessionService_GetAllServer = grpc.ServerStreamingServer[GetAllResponse] + +func _BatonSessionService_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BatonSessionServiceServer).Set(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BatonSessionService_Set_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BatonSessionServiceServer).Set(ctx, req.(*SetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BatonSessionService_SetMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BatonSessionServiceServer).SetMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BatonSessionService_SetMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BatonSessionServiceServer).SetMany(ctx, req.(*SetManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BatonSessionService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BatonSessionServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BatonSessionService_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BatonSessionServiceServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BatonSessionService_DeleteMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BatonSessionServiceServer).DeleteMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BatonSessionService_DeleteMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BatonSessionServiceServer).DeleteMany(ctx, req.(*DeleteManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BatonSessionService_Clear_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BatonSessionServiceServer).Clear(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BatonSessionService_Clear_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BatonSessionServiceServer).Clear(ctx, req.(*ClearRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BatonSessionService_ServiceDesc is the grpc.ServiceDesc for BatonSessionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BatonSessionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "c1.connectorapi.baton.v1.BatonSessionService", + HandlerType: (*BatonSessionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _BatonSessionService_Get_Handler, + }, + { + MethodName: "Set", + Handler: _BatonSessionService_Set_Handler, + }, + { + MethodName: "SetMany", + Handler: _BatonSessionService_SetMany_Handler, + }, + { + MethodName: "Delete", + Handler: _BatonSessionService_Delete_Handler, + }, + { + MethodName: "DeleteMany", + Handler: _BatonSessionService_DeleteMany_Handler, + }, + { + MethodName: "Clear", + Handler: _BatonSessionService_Clear_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetMany", + Handler: _BatonSessionService_GetMany_Handler, + ServerStreams: true, + }, + { + StreamName: "GetAll", + Handler: _BatonSessionService_GetAll_Handler, + ServerStreams: true, + }, + }, + Metadata: "c1/connectorapi/baton/v1/session.proto", +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go b/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go index 0f062108..d0566e71 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go @@ -124,6 +124,7 @@ func (a *Annotations) WithRateLimiting(rateLimit *v2.RateLimitDescription) *Anno return a } +// NOTE: the store is the only usage of this. func GetSyncIdFromAnnotations(annos Annotations) (string, error) { syncDetails := &c1zpb.SyncDetails{} ok, err := annos.Pick(syncDetails) @@ -136,3 +137,13 @@ func GetSyncIdFromAnnotations(annos Annotations) (string, error) { return "", nil } + +// NOTE: this is used to communicate the active sync to the connector proper, for session storage. +func GetActiveSyncIdFromAnnotations(annos Annotations) (string, error) { + v2SyncId := &v2.ActiveSync{} + _, err := annos.Pick(v2SyncId) + if err != nil { + return "", err + } + return v2SyncId.GetId(), nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/bid/bid.go b/vendor/github.com/conductorone/baton-sdk/pkg/bid/bid.go index bf639b78..ff1b7890 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/bid/bid.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/bid/bid.go @@ -132,8 +132,11 @@ func resourcePartToStr(r *v2.Resource) (string, error) { } resourceType := escapeParts(rid.GetResourceType()) resource := escapeParts(rid.GetResource()) - if resourceType == "" || resource == "" { - return "", NewBidStringError(r, "resource type or id is empty") + if resourceType == "" { + return "", NewBidStringError(r, "resource type is empty") + } + if resource == "" { + return "", NewBidStringError(r, "resource id is empty") } prid := r.GetParentResourceId() if prid == nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go index e9402b39..32b0541f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go @@ -12,7 +12,18 @@ import ( "github.com/spf13/viper" ) -type GetConnectorFunc[T field.Configurable] func(context.Context, T) (types.ConnectorServer, error) +// GetConnectorFunc is a function type that creates a connector instance. +// It takes a context and configuration. The session cache constructor is retrieved from the context. +type GetConnectorFunc[T field.Configurable] func(ctx context.Context, cfg T) (types.ConnectorServer, error) + +// WithSessionCache creates a session cache using the provided constructor and adds it to the context. +func WithSessionCache(ctx context.Context, constructor types.SessionCacheConstructor) (context.Context, error) { + sessionCache, err := constructor(ctx) + if err != nil { + return ctx, fmt.Errorf("failed to create session cache: %w", err) + } + return context.WithValue(ctx, types.SessionCacheKey{}, sessionCache), nil +} func MakeGenericConfiguration[T field.Configurable](v *viper.Viper) (T, error) { // Create an instance of the struct type T using reflection diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go index a596cdcb..3f728655 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go @@ -23,8 +23,11 @@ import ( v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" v1 "github.com/conductorone/baton-sdk/pb/c1/connector_wrapper/v1" "github.com/conductorone/baton-sdk/pkg/connectorrunner" + "github.com/conductorone/baton-sdk/pkg/crypto" "github.com/conductorone/baton-sdk/pkg/field" "github.com/conductorone/baton-sdk/pkg/logging" + "github.com/conductorone/baton-sdk/pkg/session" + "github.com/conductorone/baton-sdk/pkg/types" "github.com/conductorone/baton-sdk/pkg/uotel" ) @@ -34,6 +37,11 @@ const ( type ContrainstSetter func(*cobra.Command, field.Configuration) error +// defaultSessionCacheConstructor creates a default in-memory session cache. +func defaultSessionCacheConstructor(ctx context.Context, opt ...types.SessionCacheConstructorOption) (types.SessionCache, error) { + return session.NewMemorySessionCache(ctx, opt...) +} + func MakeMainCommand[T field.Configurable]( ctx context.Context, name string, @@ -189,7 +197,14 @@ func MakeMainCommand[T field.Configurable]( profile, )) case v.GetString("invoke-action") != "": - invokeActionArgs := v.GetStringMap("invoke-action-args") + invokeActionArgsStr := v.GetString("invoke-action-args") + invokeActionArgs := map[string]any{} + if invokeActionArgsStr != "" { + err := json.Unmarshal([]byte(invokeActionArgsStr), &invokeActionArgs) + if err != nil { + return fmt.Errorf("failed to parse invoke-action-args: %w", err) + } + } invokeActionArgsStruct, err := structpb.NewStruct(invokeActionArgs) if err != nil { return fmt.Errorf("failed to parse invoke-action-args: %w", err) @@ -282,11 +297,19 @@ func MakeMainCommand[T field.Configurable]( opts = append(opts, connectorrunner.WithExternalResourceEntitlementFilter(externalResourceEntitlementIdFilter)) } + opts = append(opts, connectorrunner.WithSkipEntitlementsAndGrants(v.GetBool("skip-entitlements-and-grants"))) + t, err := MakeGenericConfiguration[T](v) if err != nil { return fmt.Errorf("failed to make configuration: %w", err) } + // Create session cache and add to context + runCtx, err = WithSessionCache(runCtx, defaultSessionCacheConstructor) + if err != nil { + return fmt.Errorf("failed to create session cache: %w", err) + } + c, err := getconnector(runCtx, t) if err != nil { return err @@ -397,6 +420,22 @@ func MakeGRPCServerCommand[T field.Configurable]( if err != nil { return fmt.Errorf("failed to make configuration: %w", err) } + + // Create session cache and add to context + runCtx, err = WithSessionCache(runCtx, defaultSessionCacheConstructor) + if err != nil { + return fmt.Errorf("failed to create session cache: %w", err) + } + + clientSecret := v.GetString("client-secret") + if clientSecret != "" { + secretJwk, err := crypto.ParseClientSecret([]byte(clientSecret), true) + if err != nil { + return err + } + runCtx = context.WithValue(runCtx, crypto.ContextClientSecretKey, secretJwk) + } + c, err := getconnector(runCtx, t) if err != nil { return err @@ -523,6 +562,12 @@ func MakeCapabilitiesCommand[T field.Configurable]( return fmt.Errorf("failed to make configuration: %w", err) } + // Create session cache and add to context + runCtx, err = WithSessionCache(runCtx, defaultSessionCacheConstructor) + if err != nil { + return fmt.Errorf("failed to create session cache: %w", err) + } + c, err := getconnector(runCtx, t) if err != nil { return err diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go index 4a521882..28ca3713 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go @@ -11,8 +11,10 @@ import ( "time" aws_lambda "github.com/aws/aws-lambda-go/lambda" + "github.com/conductorone/baton-sdk/pkg/crypto" "github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk" "github.com/conductorone/baton-sdk/pkg/logging" + "github.com/conductorone/baton-sdk/pkg/ugrpc" "github.com/mitchellh/mapstructure" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -26,6 +28,9 @@ import ( c1_lambda_grpc "github.com/conductorone/baton-sdk/pkg/lambda/grpc" c1_lambda_config "github.com/conductorone/baton-sdk/pkg/lambda/grpc/config" "github.com/conductorone/baton-sdk/pkg/lambda/grpc/middleware" + "github.com/conductorone/baton-sdk/pkg/session" + "github.com/conductorone/baton-sdk/pkg/types" + "google.golang.org/grpc" ) func OptionallyAddLambdaCommand[T field.Configurable]( @@ -101,17 +106,21 @@ func OptionallyAddLambdaCommand[T field.Configurable]( return err } - client, webKey, err := c1_lambda_config.GetConnectorConfigServiceClient( + // Create DPoP client with authentication + grpcClient, webKey, _, err := c1_lambda_config.NewDPoPClient( runCtx, v.GetString(field.LambdaServerClientIDField.GetName()), v.GetString(field.LambdaServerClientSecretField.GetName()), ) if err != nil { - return fmt.Errorf("lambda-run: failed to get connector manager client: %w", err) + return fmt.Errorf("lambda-run: failed to create DPoP client: %w", err) } + // Create connector config service client using the DPoP client + configClient := pb_connector_api.NewConnectorConfigServiceClient(grpcClient) + // Get configuration, convert it to viper flag values, then proceed. - config, err := client.GetConnectorConfig(runCtx, &pb_connector_api.GetConnectorConfigRequest{}) + config, err := configClient.GetConnectorConfig(runCtx, &pb_connector_api.GetConnectorConfigRequest{}) if err != nil { return fmt.Errorf("lambda-run: failed to get connector config: %w", err) } @@ -152,6 +161,23 @@ func OptionallyAddLambdaCommand[T field.Configurable]( return fmt.Errorf("lambda-run: failed to validate config: %w", err) } + // Create session cache and add to context + // Use the same DPoP credentials for the session cache + sessionCacheConstructor := createSessionCacheConstructor(grpcClient) + runCtx, err = WithSessionCache(runCtx, sessionCacheConstructor) + if err != nil { + return fmt.Errorf("lambda-run: failed to create session cache: %w", err) + } + + clientSecret := v.GetString("client-secret") + if clientSecret != "" { + secretJwk, err := crypto.ParseClientSecret([]byte(clientSecret), true) + if err != nil { + return err + } + runCtx = context.WithValue(runCtx, crypto.ContextClientSecretKey, secretJwk) + } + c, err := getconnector(runCtx, t) if err != nil { return fmt.Errorf("lambda-run: failed to get connector: %w", err) @@ -184,11 +210,24 @@ func OptionallyAddLambdaCommand[T field.Configurable]( TicketingEnabled: true, } - s := c1_lambda_grpc.NewServer(authOpt) + chain := ugrpc.ChainUnaryInterceptors(authOpt, ugrpc.SessionCacheUnaryInterceptor(runCtx)) + + s := c1_lambda_grpc.NewServer(chain) connector.Register(runCtx, s, c, opts) aws_lambda.StartWithOptions(s.Handler, aws_lambda.WithContext(runCtx)) return nil } + return nil } + +// createSessionCacheConstructor creates a session cache constructor function that uses the provided gRPC client +func createSessionCacheConstructor(grpcClient grpc.ClientConnInterface) types.SessionCacheConstructor { + return func(ctx context.Context, opt ...types.SessionCacheConstructorOption) (types.SessionCache, error) { + // Create the gRPC session client using the same gRPC connection + client := pb_connector_api.NewBatonSessionServiceClient(grpcClient) + // Create and return the session cache + return session.NewGRPCSessionCache(ctx, client, opt...) + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go index 4149a39b..cf2fab9b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go @@ -52,7 +52,7 @@ func DefineConfiguration[T field.Configurable]( uniqueFields := make(map[string]field.SchemaField) for _, f := range confschema.Fields { if s, ok := uniqueFields[f.FieldName]; ok { - if !(f.WasReExported || s.WasReExported) { + if !f.WasReExported && !s.WasReExported { return nil, nil, fmt.Errorf("multiple fields with the same name: %s.If you want to use a default field in the SDK, use ExportAs on the connector schema field", f.FieldName) } } @@ -140,7 +140,7 @@ func verifyStructFields[T field.Configurable](schema field.Configuration) error configType = configType.Elem() } if configType.Kind() != reflect.Struct { - return fmt.Errorf("T must be a struct type, got %v", configType.Kind()) + return fmt.Errorf("T must be a struct type, got %v", configType.Kind()) //nolint:staticcheck // we want to capital letter here } for _, field := range schema.Fields { fieldFound := false diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go index 96debae0..231b40cd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go @@ -8,6 +8,7 @@ import ( "sort" "time" + "github.com/go-jose/go-jose/v4" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.opentelemetry.io/otel" "go.uber.org/zap" @@ -23,6 +24,7 @@ import ( "github.com/conductorone/baton-sdk/pkg/metrics" "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/retry" + "github.com/conductorone/baton-sdk/pkg/session" "github.com/conductorone/baton-sdk/pkg/types" "github.com/conductorone/baton-sdk/pkg/types/tasks" "github.com/conductorone/baton-sdk/pkg/uhttp" @@ -87,6 +89,15 @@ type ResourceManager interface { ResourceDeleter } +// ResourceManagerV2 extends ResourceSyncer to add capabilities for creating resources. +// +// This is the recommended interface for implementing resource creation operations in new connectors. +type ResourceManagerV2 interface { + ResourceSyncer + Create(ctx context.Context, resource *v2.Resource) (*v2.Resource, annotations.Annotations, error) + ResourceDeleterV2 +} + // ResourceDeleter extends ResourceSyncer to add capabilities for deleting resources. // // Implementing this interface indicates the connector supports deleting resources @@ -96,6 +107,15 @@ type ResourceDeleter interface { Delete(ctx context.Context, resourceId *v2.ResourceId) (annotations.Annotations, error) } +// ResourceDeleterV2 extends ResourceSyncer to add capabilities for deleting resources. +// +// This is the recommended interface for implementing resource deletion operations in new connectors. +// It differs from ResourceDeleter by having the resource, not just the id. +type ResourceDeleterV2 interface { + ResourceSyncer + Delete(ctx context.Context, resourceId *v2.ResourceId, parentResourceID *v2.ResourceId) (annotations.Annotations, error) +} + // ResourceTargetedSyncer extends ResourceSyncer to add capabilities for directly syncing an individual resource // // Implementing this interface indicates the connector supports calling "get" on a resource @@ -120,10 +140,18 @@ type CreateAccountResponse interface { // represents users or accounts that can be provisioned. type AccountManager interface { ResourceSyncer - CreateAccount(ctx context.Context, accountInfo *v2.AccountInfo, credentialOptions *v2.CredentialOptions) (CreateAccountResponse, []*v2.PlaintextData, annotations.Annotations, error) + CreateAccount(ctx context.Context, + accountInfo *v2.AccountInfo, + credentialOptions *v2.LocalCredentialOptions) (CreateAccountResponse, []*v2.PlaintextData, annotations.Annotations, error) CreateAccountCapabilityDetails(ctx context.Context) (*v2.CredentialDetailsAccountProvisioning, annotations.Annotations, error) } +type OldAccountManager interface { + CreateAccount(ctx context.Context, + accountInfo *v2.AccountInfo, + credentialOptions *v2.CredentialOptions) (CreateAccountResponse, []*v2.PlaintextData, annotations.Annotations, error) +} + // CredentialManager extends ResourceSyncer to add capabilities for managing credentials. // // Implementing this interface indicates the connector supports rotating credentials @@ -131,10 +159,18 @@ type AccountManager interface { // or service accounts that have rotatable credentials. type CredentialManager interface { ResourceSyncer - Rotate(ctx context.Context, resourceId *v2.ResourceId, credentialOptions *v2.CredentialOptions) ([]*v2.PlaintextData, annotations.Annotations, error) + Rotate(ctx context.Context, + resourceId *v2.ResourceId, + credentialOptions *v2.LocalCredentialOptions) ([]*v2.PlaintextData, annotations.Annotations, error) RotateCapabilityDetails(ctx context.Context) (*v2.CredentialDetailsCredentialRotation, annotations.Annotations, error) } +type OldCredentialManager interface { + Rotate(ctx context.Context, + resourceId *v2.ResourceId, + credentialOptions *v2.CredentialOptions) ([]*v2.PlaintextData, annotations.Annotations, error) +} + // Compatibility interface lets us handle both EventFeed and EventProvider the same. type EventLister interface { ListEvents(ctx context.Context, earliestEvent *timestamppb.Timestamp, pToken *pagination.StreamToken) ([]*v2.Event, *pagination.StreamState, annotations.Annotations, error) @@ -243,7 +279,9 @@ type builderImpl struct { resourceProvisioners map[string]ResourceProvisioner resourceProvisionersV2 map[string]ResourceProvisionerV2 resourceManagers map[string]ResourceManager + resourceManagersV2 map[string]ResourceManagerV2 resourceDeleters map[string]ResourceDeleter + resourceDeletersV2 map[string]ResourceDeleterV2 resourceTargetedSyncers map[string]ResourceTargetedSyncer accountManager AccountManager actionManager CustomActionManager @@ -254,6 +292,7 @@ type builderImpl struct { ticketingEnabled bool m *metrics.M nowFunc func() time.Time + clientSecret *jose.JSONWebKey } func (b *builderImpl) BulkCreateTickets(ctx context.Context, request *v2.TicketsServiceBulkCreateTicketsRequest) (*v2.TicketsServiceBulkCreateTicketsResponse, error) { @@ -326,7 +365,7 @@ func (b *builderImpl) ListTicketSchemas(ctx context.Context, request *v2.Tickets } retryer := retry.NewRetryer(ctx, retry.RetryConfig{ - MaxAttempts: 0, + MaxAttempts: 10, InitialDelay: 15 * time.Second, MaxDelay: 0, }) @@ -461,12 +500,17 @@ func (b *builderImpl) GetTicketSchema(ctx context.Context, request *v2.TicketsSe func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.ConnectorServer, error) { switch c := in.(type) { case ConnectorBuilder: + clientSecretValue := ctx.Value(crypto.ContextClientSecretKey) + clientSecretJWK, _ := clientSecretValue.(*jose.JSONWebKey) + ret := &builderImpl{ resourceBuilders: make(map[string]ResourceSyncer), resourceProvisioners: make(map[string]ResourceProvisioner), resourceProvisionersV2: make(map[string]ResourceProvisionerV2), resourceManagers: make(map[string]ResourceManager), + resourceManagersV2: make(map[string]ResourceManagerV2), resourceDeleters: make(map[string]ResourceDeleter), + resourceDeletersV2: make(map[string]ResourceDeleterV2), resourceTargetedSyncers: make(map[string]ResourceTargetedSyncer), accountManager: nil, actionManager: nil, @@ -475,6 +519,7 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne cb: c, ticketManager: nil, nowFunc: time.Now, + clientSecret: clientSecretJWK, } err := ret.options(opts...) @@ -591,6 +636,30 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne } } + if resourceManager, ok := rb.(ResourceManagerV2); ok { + if _, ok := ret.resourceManagersV2[rType.Id]; ok { + return nil, fmt.Errorf("error: duplicate resource type found for resource managerV2 %s", rType.Id) + } + ret.resourceManagersV2[rType.Id] = resourceManager + // Support DeleteResourceV2 if connector implements both Create and Delete + if _, ok := ret.resourceDeletersV2[rType.Id]; ok { + // This should never happen + return nil, fmt.Errorf("error: duplicate resource type found for resource deleterV2 %s", rType.Id) + } + ret.resourceDeletersV2[rType.Id] = resourceManager + } else { + if resourceDeleter, ok := rb.(ResourceDeleterV2); ok { + if _, ok := ret.resourceDeletersV2[rType.Id]; ok { + return nil, fmt.Errorf("error: duplicate resource type found for resource deleterV2 %s", rType.Id) + } + ret.resourceDeletersV2[rType.Id] = resourceDeleter + } + } + + if _, ok := rb.(OldAccountManager); ok { + return nil, fmt.Errorf("error: old account manager interface implemented for %s", rType.Id) + } + if accountManager, ok := rb.(AccountManager); ok { if ret.accountManager != nil { return nil, fmt.Errorf("error: duplicate resource type found for account manager %s", rType.Id) @@ -598,6 +667,10 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne ret.accountManager = accountManager } + if _, ok := rb.(OldCredentialManager); ok { + return nil, fmt.Errorf("error: old credential manager interface implemented for %s", rType.Id) + } + if credentialManagers, ok := rb.(CredentialManager); ok { if _, ok := ret.credentialManagers[rType.Id]; ok { return nil, fmt.Errorf("error: duplicate resource type found for credential manager %s", rType.Id) @@ -696,7 +769,6 @@ func (b *builderImpl) ListResources(ctx context.Context, request *v2.ResourcesSe b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: list resources with unknown resource type %s", request.ResourceTypeId) } - out, nextPageToken, annos, err := rb.List(ctx, request.ParentResourceId, &pagination.Token{ Size: int(request.PageSize), Token: request.PageToken, @@ -802,6 +874,8 @@ func (b *builderImpl) ListGrants(ctx context.Context, request *v2.GrantsServiceL Size: int(request.PageSize), Token: request.PageToken, }) + + // annos.Append(&v2.ActiveSync{ActiveSyncId: request.Annotations.GetActiveSyncId()}) resp := &v2.GrantsServiceListGrantsResponse{ List: out, NextPageToken: nextPageToken, @@ -947,6 +1021,15 @@ func getCapabilities(ctx context.Context, b *builderImpl) (*v2.ConnectorCapabili connectorCaps[v2.Capability_CAPABILITY_RESOURCE_DELETE] = struct{}{} } + if _, ok := rb.(ResourceManagerV2); ok { + resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_RESOURCE_CREATE, v2.Capability_CAPABILITY_RESOURCE_DELETE) + connectorCaps[v2.Capability_CAPABILITY_RESOURCE_CREATE] = struct{}{} + connectorCaps[v2.Capability_CAPABILITY_RESOURCE_DELETE] = struct{}{} + } else if _, ok := rb.(ResourceDeleterV2); ok { + resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_RESOURCE_DELETE) + connectorCaps[v2.Capability_CAPABILITY_RESOURCE_DELETE] = struct{}{} + } + resourceTypeCapabilities = append(resourceTypeCapabilities, resourceTypeCapability) } sort.Slice(resourceTypeCapabilities, func(i, j int) bool { @@ -1178,7 +1261,16 @@ func (b *builderImpl) CreateResource(ctx context.Context, request *v2.CreateReso tt := tasks.CreateResourceType l := ctxzap.Extract(ctx) rt := request.GetResource().GetId().GetResourceType() - manager, ok := b.resourceManagers[rt] + + var manager interface { + Create(ctx context.Context, resource *v2.Resource) (*v2.Resource, annotations.Annotations, error) + } + + manager, ok := b.resourceManagersV2[rt] + if !ok { + manager, ok = b.resourceManagers[rt] + } + if ok { resource, annos, err := manager.Create(ctx, request.Resource) if err != nil { @@ -1203,14 +1295,32 @@ func (b *builderImpl) DeleteResource(ctx context.Context, request *v2.DeleteReso l := ctxzap.Extract(ctx) rt := request.GetResourceId().GetResourceType() - var manager ResourceDeleter + var rsDeleter ResourceDeleter + var rsDeleterV2 ResourceDeleterV2 var ok bool - manager, ok = b.resourceManagers[rt] + + rsDeleterV2, ok = b.resourceManagersV2[rt] if !ok { - manager, ok = b.resourceDeleters[rt] + rsDeleterV2, ok = b.resourceDeletersV2[rt] } + if ok { - annos, err := manager.Delete(ctx, request.GetResourceId()) + annos, err := rsDeleterV2.Delete(ctx, request.ResourceId, request.ParentResourceId) + if err != nil { + l.Error("error: deleteV2 resource failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: delete resource failed: %w", err) + } + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) + return &v2.DeleteResourceResponse{Annotations: annos}, nil + } + + rsDeleter, ok = b.resourceManagers[rt] + if !ok { + rsDeleter, ok = b.resourceDeleters[rt] + } + if ok { + annos, err := rsDeleter.Delete(ctx, request.GetResourceId()) if err != nil { l.Error("error: delete resource failed", zap.Error(err)) b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) @@ -1233,14 +1343,32 @@ func (b *builderImpl) DeleteResourceV2(ctx context.Context, request *v2.DeleteRe l := ctxzap.Extract(ctx) rt := request.GetResourceId().GetResourceType() - var manager ResourceDeleter + var rsDeleter ResourceDeleter + var rsDeleterV2 ResourceDeleterV2 var ok bool - manager, ok = b.resourceManagers[rt] + + rsDeleterV2, ok = b.resourceManagersV2[rt] + if !ok { + rsDeleterV2, ok = b.resourceDeletersV2[rt] + } + + if ok { + annos, err := rsDeleterV2.Delete(ctx, request.ResourceId, request.ParentResourceId) + if err != nil { + l.Error("error: deleteV2 resource failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: delete resource failed: %w", err) + } + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) + return &v2.DeleteResourceV2Response{Annotations: annos}, nil + } + + rsDeleter, ok = b.resourceManagers[rt] if !ok { - manager, ok = b.resourceDeleters[rt] + rsDeleter, ok = b.resourceDeleters[rt] } if ok { - annos, err := manager.Delete(ctx, request.GetResourceId()) + annos, err := rsDeleter.Delete(ctx, request.GetResourceId()) if err != nil { l.Error("error: delete resource failed", zap.Error(err)) b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) @@ -1269,7 +1397,14 @@ func (b *builderImpl) RotateCredential(ctx context.Context, request *v2.RotateCr return nil, status.Error(codes.Unimplemented, "resource type does not have credential manager configured") } - plaintexts, annos, err := manager.Rotate(ctx, request.GetResourceId(), request.GetCredentialOptions()) + opts, err := crypto.ConvertCredentialOptions(ctx, b.clientSecret, request.GetCredentialOptions(), request.GetEncryptionConfigs()) + if err != nil { + l.Error("error: converting credential options failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: converting credential options failed: %w", err) + } + + plaintexts, annos, err := manager.Rotate(ctx, request.GetResourceId(), opts) if err != nil { l.Error("error: rotate credentials on resource failed", zap.Error(err)) b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) @@ -1303,8 +1438,25 @@ func (b *builderImpl) RotateCredential(ctx context.Context, request *v2.RotateCr func (b *builderImpl) Cleanup(ctx context.Context, request *v2.ConnectorServiceCleanupRequest) (*v2.ConnectorServiceCleanupResponse, error) { l := ctxzap.Extract(ctx) + + // Clear session cache if available in context + sessionCache, err := session.GetSession(ctx) + if err != nil { + l.Warn("error getting session cache", zap.Error(err)) + } else { + activeSync, err := annotations.GetActiveSyncIdFromAnnotations(annotations.Annotations(request.GetAnnotations())) + if err != nil { + l.Warn("error getting active sync id", zap.Error(err)) + } + if activeSync != "" { + err = sessionCache.Clear(ctx) + if err != nil { + l.Warn("error clearing session cache", zap.Error(err)) + } + } + } // Clear all http caches at the end of a sync. This must be run in the child process, which is why it's in this function and not in syncer.go - err := uhttp.ClearCaches(ctx) + err = uhttp.ClearCaches(ctx) if err != nil { l.Warn("error clearing http caches", zap.Error(err)) } @@ -1324,7 +1476,15 @@ func (b *builderImpl) CreateAccount(ctx context.Context, request *v2.CreateAccou b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, status.Error(codes.Unimplemented, "connector does not have credential manager configured") } - result, plaintexts, annos, err := b.accountManager.CreateAccount(ctx, request.GetAccountInfo(), request.GetCredentialOptions()) + + opts, err := crypto.ConvertCredentialOptions(ctx, b.clientSecret, request.GetCredentialOptions(), request.GetEncryptionConfigs()) + if err != nil { + l.Error("error: converting credential options failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: converting credential options failed: %w", err) + } + + result, plaintexts, annos, err := b.accountManager.CreateAccount(ctx, request.GetAccountInfo(), opts) if err != nil { l.Error("error: create account failed", zap.Error(err)) b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go index e5ddb37c..a0b76df3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go @@ -228,7 +228,7 @@ func (c *connectorRunner) run(ctx context.Context) error { } if stopForLoop { - return fmt.Errorf("Unable to communicate with gRPC server") + return fmt.Errorf("unable to communicate with gRPC server") } return nil @@ -343,6 +343,7 @@ type runnerConfig struct { targetedSyncResourceIDs []string externalResourceC1Z string externalResourceEntitlementIdFilter string + skipEntitlementsAndGrants bool } // WithRateLimiterConfig sets the RateLimiterConfig for a runner. @@ -641,6 +642,13 @@ func WithSyncCompactor(outputPath string, filePaths []string, syncIDs []string) } } +func WithSkipEntitlementsAndGrants(skip bool) Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.skipEntitlementsAndGrants = skip + return nil + } +} + // NewConnectorRunner creates a new connector runner. func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Option) (*connectorRunner, error) { runner := &connectorRunner{} @@ -745,6 +753,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op local.WithExternalResourceC1Z(cfg.externalResourceC1Z), local.WithExternalResourceEntitlementIdFilter(cfg.externalResourceEntitlementIdFilter), local.WithTargetedSyncResourceIDs(cfg.targetedSyncResourceIDs), + local.WithSkipEntitlementsAndGrants(cfg.skipEntitlementsAndGrants), ) if err != nil { return nil, err diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go index 71db3b92..64e352ec 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go @@ -8,6 +8,22 @@ import ( reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" ) +type SyncType string + +const ( + SyncTypeFull SyncType = "full" + SyncTypePartial SyncType = "partial" + SyncTypeResourcesOnly SyncType = "resources_only" + SyncTypeAny SyncType = "" +) + +var AllSyncTypes = []SyncType{ + SyncTypeAny, + SyncTypeFull, + SyncTypePartial, + SyncTypeResourcesOnly, +} + // ConnectorStoreReader implements the ConnectorV2 API, along with getters for individual objects. type Reader interface { v2.ResourceTypesServiceServer @@ -34,9 +50,9 @@ type Reader interface { // ConnectorStoreWriter defines an implementation for a connector v2 datasource writer. This is used to store sync data from an upstream provider. type Writer interface { Reader - StartSync(ctx context.Context) (string, bool, error) - StartNewSync(ctx context.Context) (string, error) - StartNewSyncV2(ctx context.Context, syncType string, parentSyncID string) (string, error) + ResumeSync(ctx context.Context, syncType SyncType, syncID string) (string, error) + StartOrResumeSync(ctx context.Context, syncType SyncType, syncID string) (string, bool, error) + StartNewSync(ctx context.Context, syncType SyncType, parentSyncID string) (string, error) SetCurrentSync(ctx context.Context, syncID string) error CurrentSyncStep(ctx context.Context) (string, error) CheckpointSync(ctx context.Context, syncToken string) error diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/client_secret.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/client_secret.go new file mode 100644 index 00000000..6126db43 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/client_secret.go @@ -0,0 +1,56 @@ +package crypto + +import ( + "bytes" + "crypto/ed25519" + "encoding/base64" + "errors" + + "github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk" + "github.com/go-jose/go-jose/v4" +) + +var ErrInvalidClientSecret = errors.New("invalid client secret") +var v1SecretTokenIdentifier = []byte("v1") + +func ParseClientSecret(input []byte, setKeyID bool) (*jose.JSONWebKey, error) { + items := bytes.SplitN(input, []byte(":"), 4) + if len(items) != 4 { + return nil, ErrInvalidClientSecret + } + + if !bytes.Equal(items[2], v1SecretTokenIdentifier) { + return nil, ErrInvalidClientSecret + } + + jwkData, err := base64.RawURLEncoding.DecodeString(string(items[3])) + if err != nil { + return nil, ErrInvalidClientSecret + } + + npk := &jose.JSONWebKey{} + err = npk.UnmarshalJSON(jwkData) + if err != nil { + return nil, ErrInvalidClientSecret + } + + if npk.IsPublic() || !npk.Valid() { + return nil, ErrInvalidClientSecret + } + + _, ok := npk.Key.(ed25519.PrivateKey) + if !ok { + return nil, ErrInvalidClientSecret + } + + if setKeyID && npk.KeyID == "" { + kid, err := jwk.Thumbprint(npk) + if err != nil { + return nil, err + } + + npk.KeyID = kid + } + + return npk, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go index 6d3d8e14..2f7a6522 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go @@ -2,9 +2,22 @@ package crypto import ( "context" + "fmt" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "github.com/conductorone/baton-sdk/pkg/crypto/providers" + "github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk" + "github.com/go-jose/go-jose/v4" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type key string + +const ( + ContextClientSecretKey = key("client-secret-key") ) type PlaintextCredential struct { @@ -48,3 +61,113 @@ func NewEncryptionManager(co *v2.CredentialOptions, ec []*v2.EncryptionConfig) ( } return em, nil } + +func decryptPassword(ctx context.Context, encryptedPassword *v2.EncryptedData, decryptionConfig *providers.DecryptionConfig) (string, error) { + if decryptionConfig == nil { + return "", ErrInvalidCredentialOptions + } + + provider, err := providers.GetDecryptionProviderForConfig(ctx, decryptionConfig) + if err != nil { + return "", status.Errorf(codes.Internal, "error getting decryption provider for config: %v", err) + } + key := decryptionConfig.PrivateKey + if key == nil { + return "", status.Errorf(codes.InvalidArgument, "decryption config key is empty") + } + + plaintext, err := provider.Decrypt(ctx, encryptedPassword, decryptionConfig.PrivateKey) + if err != nil { + return "", status.Errorf(codes.Internal, "error decrypting password: %v", err) + } + + return string(plaintext.Bytes), nil +} + +func ConvertCredentialOptions(ctx context.Context, clientSecret *jose.JSONWebKey, opts *v2.CredentialOptions, encryptionConfigs []*v2.EncryptionConfig) (*v2.LocalCredentialOptions, error) { + l := ctxzap.Extract(ctx) + if opts == nil { + return nil, nil + } + + localOpts := &v2.LocalCredentialOptions{ + ForceChangeAtNextLogin: opts.ForceChangeAtNextLogin, + } + + switch opts.Options.(type) { + case *v2.CredentialOptions_RandomPassword_: + localOpts.Options = &v2.LocalCredentialOptions_RandomPassword_{ + RandomPassword: &v2.LocalCredentialOptions_RandomPassword{ + Length: opts.GetRandomPassword().GetLength(), + Constraints: opts.GetRandomPassword().GetConstraints(), + }, + } + case *v2.CredentialOptions_NoPassword_: + localOpts.Options = &v2.LocalCredentialOptions_NoPassword_{ + NoPassword: &v2.LocalCredentialOptions_NoPassword{}, + } + case *v2.CredentialOptions_Sso: + localOpts.Options = &v2.LocalCredentialOptions_Sso{ + Sso: &v2.LocalCredentialOptions_SSO{ + SsoProvider: opts.GetSso().GetSsoProvider(), + }, + } + case *v2.CredentialOptions_EncryptedPassword_: + default: + return nil, status.Error(codes.InvalidArgument, "invalid credential options") + } + + encryptedPasswordOpt := opts.GetEncryptedPassword() + if encryptedPasswordOpt == nil { + return localOpts, nil + } + encryptedPasswords := encryptedPasswordOpt.GetEncryptedPasswords() + if len(encryptedPasswords) == 0 { + return localOpts, nil + } + + // Whatever's setting the password should already know it. Don't let us encrypt it and send it back. + if len(encryptionConfigs) > 0 { + l.Error("error: encryption configs should never be supplied for encrypted passwords") + return localOpts, status.Error(codes.InvalidArgument, "encryption configs should never be supplied for encrypted passwords") + } + + if clientSecret == nil { + return localOpts, status.Error(codes.InvalidArgument, "client-secret is required") + } + + for _, encryptedPassword := range encryptedPasswords { + keyIDs := encryptedPassword.GetKeyIds() + if len(keyIDs) == 0 { + continue + } + for _, keyId := range keyIDs { + if keyId != clientSecret.KeyID { + l.Warn("convert-credential-options: key id does not match client secret key id", zap.String("keyId", keyId), zap.String("clientSecretKeyID", clientSecret.KeyID)) + continue + } + password, err := decryptPassword(ctx, encryptedPassword, &providers.DecryptionConfig{ + Provider: jwk.EncryptionProviderJwkPrivate, + PrivateKey: clientSecret, + }) + if err != nil { + return nil, fmt.Errorf("convert-credential-options: error decrypting password: %w", err) + } + localOpts.Options = &v2.LocalCredentialOptions_PlaintextPassword_{ + PlaintextPassword: &v2.LocalCredentialOptions_PlaintextPassword{ + PlaintextPassword: password, + }, + } + break + } + if localOpts.Options != nil { + break + } + } + + if localOpts.Options == nil { + return nil, status.Errorf(codes.InvalidArgument, "no encrypted password matched client secret key id %q", clientSecret.KeyID) + } + + return localOpts, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/password.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/password.go index dd75d302..512f91ef 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/password.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/password.go @@ -1,6 +1,7 @@ package crypto import ( + "context" "crypto/rand" "errors" "fmt" @@ -21,12 +22,17 @@ const ( var ErrInvalidCredentialOptions = errors.New("unknown credential options") var ErrInvalidPasswordLength = errors.New("invalid password length") -func GeneratePassword(credentialOptions *v2.CredentialOptions) (string, error) { +func GeneratePassword(ctx context.Context, credentialOptions *v2.LocalCredentialOptions) (string, error) { randomPassword := credentialOptions.GetRandomPassword() if randomPassword != nil { return GenerateRandomPassword(randomPassword) } + plaintextPassword := credentialOptions.GetPlaintextPassword() + if plaintextPassword != nil { + return plaintextPassword.GetPlaintextPassword(), nil + } + return "", ErrInvalidCredentialOptions } @@ -54,7 +60,7 @@ func addCharacterToPassword(password *strings.Builder, set string) error { return nil } -func GenerateRandomPassword(randomPassword *v2.CredentialOptions_RandomPassword) (string, error) { +func GenerateRandomPassword(randomPassword *v2.LocalCredentialOptions_RandomPassword) (string, error) { passwordLength := randomPassword.GetLength() if passwordLength < 8 { return "", ErrInvalidPasswordLength diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go index 240bf6f3..ffc82a93 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go @@ -21,6 +21,7 @@ import ( // TODO(morgabra): Fix the circular dependency/entire registry pattern here. const EncryptionProviderJwk = "baton/jwk/v1" +const EncryptionProviderJwkPrivate = "baton/jwk/v1/private" var ErrJWKInvalidKeyType = errors.New("jwk: invalid key type") var ErrJWKUnsupportedKeyType = errors.New("jwk: unsupported key type") @@ -36,7 +37,7 @@ func unmarshalJWK(jwkBytes []byte) (*jose.JSONWebKey, error) { type JWKEncryptionProvider struct{} -func (j *JWKEncryptionProvider) GenerateKey(ctx context.Context) (*v2.EncryptionConfig, []byte, error) { +func (j *JWKEncryptionProvider) GenerateKey(ctx context.Context) (*v2.EncryptionConfig, *jose.JSONWebKey, error) { _, privKey, err := ed25519.GenerateKey(nil) if err != nil { return nil, nil, fmt.Errorf("jwk: failed to generate key: %w", err) @@ -48,19 +49,14 @@ func (j *JWKEncryptionProvider) GenerateKey(ctx context.Context) (*v2.Encryption return j.marshalKey(ctx, privKeyJWK) } -func (j *JWKEncryptionProvider) marshalKey(ctx context.Context, privKeyJWK *jose.JSONWebKey) (*v2.EncryptionConfig, []byte, error) { - privKeyJWKBytes, err := privKeyJWK.MarshalJSON() - if err != nil { - return nil, nil, fmt.Errorf("jwk: failed to marshal private key: %w", err) - } - +func (j *JWKEncryptionProvider) marshalKey(ctx context.Context, privKeyJWK *jose.JSONWebKey) (*v2.EncryptionConfig, *jose.JSONWebKey, error) { pubKeyJWK := privKeyJWK.Public() pubKeyJWKBytes, err := pubKeyJWK.MarshalJSON() if err != nil { return nil, nil, fmt.Errorf("jwk: failed to marshal public key: %w", err) } - kid, err := thumbprint(&pubKeyJWK) + kid, err := Thumbprint(&pubKeyJWK) if err != nil { return nil, nil, err } @@ -74,7 +70,7 @@ func (j *JWKEncryptionProvider) marshalKey(ctx context.Context, privKeyJWK *jose PubKey: pubKeyJWKBytes, }, }, - }, privKeyJWKBytes, nil + }, privKeyJWK, nil } func (j *JWKEncryptionProvider) Encrypt(ctx context.Context, conf *v2.EncryptionConfig, plainText *v2.PlaintextData) (*v2.EncryptedData, error) { @@ -104,7 +100,7 @@ func (j *JWKEncryptionProvider) Encrypt(ctx context.Context, conf *v2.Encryption return nil, ErrJWKUnsupportedKeyType } - tp, err := thumbprint(jwk) + tp, err := Thumbprint(jwk) if err != nil { return nil, err } @@ -122,16 +118,7 @@ func (j *JWKEncryptionProvider) Encrypt(ctx context.Context, conf *v2.Encryption }, nil } -func (j *JWKEncryptionProvider) Decrypt(ctx context.Context, cipherText *v2.EncryptedData, privateKey []byte) (*v2.PlaintextData, error) { - jwk, err := unmarshalJWK(privateKey) - if err != nil { - return nil, err - } - - if jwk.IsPublic() { - return nil, fmt.Errorf("%w: key is public", ErrJWKInvalidKeyType) - } - +func (j *JWKEncryptionProvider) Decrypt(ctx context.Context, cipherText *v2.EncryptedData, jwk *jose.JSONWebKey) (*v2.PlaintextData, error) { decCipherText, err := base64.StdEncoding.DecodeString(string(cipherText.EncryptedBytes)) if err != nil { return nil, fmt.Errorf("jwk: failed to decode encrypted bytes: %w", err) @@ -166,7 +153,7 @@ func (j *JWKEncryptionProvider) Decrypt(ctx context.Context, cipherText *v2.Encr }, nil } -func thumbprint(jwk *jose.JSONWebKey) (string, error) { +func Thumbprint(jwk *jose.JSONWebKey) (string, error) { tp, err := jwk.Thumbprint(crypto.SHA256) if err != nil { return "", fmt.Errorf("jwk: failed to compute key id: %w", err) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go index 399be670..731d33f3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go @@ -5,21 +5,30 @@ import ( "fmt" "strings" + "github.com/go-jose/go-jose/v4" + v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk" ) -var EncryptionProviderNotRegisteredError = fmt.Errorf("crypto/providers: encryption provider not registered") +var ErrEncryptionProviderNotRegistered = fmt.Errorf("crypto/providers: encryption provider not registered") +var ErrNoProviderSpecified = fmt.Errorf("crypto/providers: no provider specified") type EncryptionProvider interface { Encrypt(ctx context.Context, conf *v2.EncryptionConfig, plainText *v2.PlaintextData) (*v2.EncryptedData, error) - Decrypt(ctx context.Context, cipherText *v2.EncryptedData, privateKey []byte) (*v2.PlaintextData, error) + Decrypt(ctx context.Context, cipherText *v2.EncryptedData, privateKey *jose.JSONWebKey) (*v2.PlaintextData, error) + + GenerateKey(ctx context.Context) (*v2.EncryptionConfig, *jose.JSONWebKey, error) +} - GenerateKey(ctx context.Context) (*v2.EncryptionConfig, []byte, error) +type DecryptionConfig struct { + Provider string + PrivateKey *jose.JSONWebKey } var providerRegistry = map[string]EncryptionProvider{ - normalizeProviderName(jwk.EncryptionProviderJwk): &jwk.JWKEncryptionProvider{}, + normalizeProviderName(jwk.EncryptionProviderJwk): &jwk.JWKEncryptionProvider{}, + normalizeProviderName(jwk.EncryptionProviderJwkPrivate): &jwk.JWKEncryptionProvider{}, } func normalizeProviderName(name string) string { @@ -29,7 +38,7 @@ func normalizeProviderName(name string) string { func GetEncryptionProvider(name string) (EncryptionProvider, error) { provider, ok := providerRegistry[normalizeProviderName(name)] if !ok { - return nil, fmt.Errorf("%w (%s)", EncryptionProviderNotRegisteredError, name) + return nil, fmt.Errorf("%w (%s)", ErrEncryptionProviderNotRegistered, name) } return provider, nil } @@ -37,7 +46,7 @@ func GetEncryptionProvider(name string) (EncryptionProvider, error) { // GetEncryptionProviderForConfig returns the encryption provider for the given config. // If the config specifies a provider, we will fetch it directly by name and return an error if it's not found. // If the config contains a non-nil well-known configuration (like JWKPublicKeyConfig), we will return the provider for that by name. -// If we can't find a provider, we return an EncryptionProviderNotRegisteredError. +// If we can't find a provider, we return an ErrEncryptionProviderNotRegistered. func GetEncryptionProviderForConfig(ctx context.Context, conf *v2.EncryptionConfig) (EncryptionProvider, error) { providerName := normalizeProviderName(conf.GetProvider()) @@ -51,7 +60,17 @@ func GetEncryptionProviderForConfig(ctx context.Context, conf *v2.EncryptionConf // If we don't have a provider by now, bail. if providerName == "" { - return nil, EncryptionProviderNotRegisteredError + return nil, ErrEncryptionProviderNotRegistered + } + + return GetEncryptionProvider(providerName) +} + +func GetDecryptionProviderForConfig(ctx context.Context, conf *DecryptionConfig) (EncryptionProvider, error) { + providerName := normalizeProviderName(conf.Provider) + + if providerName == "" { + return nil, ErrNoProviderSpecified } return GetEncryptionProvider(providerName) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go index 11bf0fc6..dc269cbb 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go @@ -3,6 +3,7 @@ package dotc1z import ( "context" "database/sql" + "errors" "fmt" "os" "path/filepath" @@ -10,6 +11,9 @@ import ( "time" "github.com/doug-martin/goqu/v9" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + // NOTE: required to register the dialect for goqu. // // If you remove this import, goqu.Dialect("sqlite3") will @@ -20,6 +24,7 @@ import ( _ "github.com/glebarez/go-sqlite" 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/connectorstore" ) @@ -102,8 +107,9 @@ func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1Fi } type c1zOptions struct { - tmpDir string - pragmas []pragma + tmpDir string + pragmas []pragma + decoderOptions []DecoderOption } type C1ZOption func(*c1zOptions) @@ -119,6 +125,12 @@ func WithPragma(name string, value string) C1ZOption { } } +func WithDecoderOptions(opts ...DecoderOption) C1ZOption { + return func(o *c1zOptions) { + o.decoderOptions = opts + } +} + // 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") @@ -129,7 +141,7 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( opt(options) } - dbFilePath, err := loadC1z(outputFilePath, options.tmpDir) + dbFilePath, err := loadC1z(outputFilePath, options.tmpDir, options.decoderOptions...) if err != nil { return nil, err } @@ -149,6 +161,14 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( return c1File, nil } +func cleanupDbDir(dbFilePath string, err error) error { + cleanupErr := os.RemoveAll(filepath.Dir(dbFilePath)) + if cleanupErr != nil { + err = errors.Join(err, cleanupErr) + } + return err +} + // Close ensures that the sqlite database is flushed to disk, and if any changes were made we update the original database // with our changes. func (c *C1File) Close() error { @@ -157,7 +177,7 @@ func (c *C1File) Close() error { if c.rawDb != nil { err = c.rawDb.Close() if err != nil { - return err + return cleanupDbDir(c.dbFilePath, err) } } c.rawDb = nil @@ -167,17 +187,11 @@ func (c *C1File) Close() error { if c.dbUpdated { err = saveC1z(c.dbFilePath, c.outputFilePath) if err != nil { - return err + return cleanupDbDir(c.dbFilePath, err) } } - // Cleanup the database filepath. This should always be a file within a temp directory, so we remove the entire dir. - err = os.RemoveAll(filepath.Dir(c.dbFilePath)) - if err != nil { - return err - } - - return nil + return cleanupDbDir(c.dbFilePath, err) } // init ensures that the database has all of the required schema. @@ -213,16 +227,32 @@ func (c *C1File) init(ctx context.Context) error { } // Stats introspects the database and returns the count of objects for the given sync run. -func (c *C1File) Stats(ctx context.Context) (map[string]int64, error) { +// If syncId is empty, it will use the latest sync run of the given type. +func (c *C1File) Stats(ctx context.Context, syncType connectorstore.SyncType, syncId string) (map[string]int64, error) { ctx, span := tracer.Start(ctx, "C1File.Stats") defer span.End() counts := make(map[string]int64) - syncID, err := c.LatestSyncID(ctx) + var err error + if syncId == "" { + syncId, err = c.LatestSyncID(ctx, syncType) + if err != nil { + return nil, err + } + } + resp, err := c.GetSync(ctx, &reader_v2.SyncsReaderServiceGetSyncRequest{SyncId: syncId}) if err != nil { return nil, err } + if resp == nil || resp.Sync == nil { + return nil, status.Errorf(codes.NotFound, "sync '%s' not found", syncId) + } + sync := resp.Sync + if syncType != connectorstore.SyncTypeAny && syncType != connectorstore.SyncType(sync.SyncType) { + return nil, status.Errorf(codes.InvalidArgument, "sync '%s' is not of type '%s'", syncId, syncType) + } + syncType = connectorstore.SyncType(sync.SyncType) counts["resource_types"] = 0 @@ -246,7 +276,7 @@ func (c *C1File) Stats(ctx context.Context) (map[string]int64, error) { for _, rt := range rtStats { resourceCount, err := c.db.From(resources.Name()). Where(goqu.C("resource_type_id").Eq(rt.Id)). - Where(goqu.C("sync_id").Eq(syncID)). + Where(goqu.C("sync_id").Eq(syncId)). CountContext(ctx) if err != nil { return nil, err @@ -254,23 +284,24 @@ func (c *C1File) Stats(ctx context.Context) (map[string]int64, error) { counts[rt.Id] = resourceCount } - entitlementsCount, err := c.db.From(entitlements.Name()). - Where(goqu.C("sync_id").Eq(syncID)). - CountContext(ctx) - if err != nil { - return nil, err - } - counts["entitlements"] = entitlementsCount + if syncType != connectorstore.SyncTypeResourcesOnly { + entitlementsCount, err := c.db.From(entitlements.Name()). + Where(goqu.C("sync_id").Eq(syncId)). + CountContext(ctx) + if err != nil { + return nil, err + } + counts["entitlements"] = entitlementsCount - grantsCount, err := c.db.From(grants.Name()). - Where(goqu.C("sync_id").Eq(syncID)). - CountContext(ctx) - if err != nil { - return nil, err + grantsCount, err := c.db.From(grants.Name()). + Where(goqu.C("sync_id").Eq(syncId)). + CountContext(ctx) + if err != nil { + return nil, err + } + counts["grants"] = grantsCount } - counts["grants"] = grantsCount - return counts, nil } @@ -298,3 +329,86 @@ func (c *C1File) OutputFilepath() (string, error) { } return c.outputFilePath, nil } + +func (c *C1File) AttachFile(other *C1File, dbName string) (*C1FileAttached, error) { + _, err := c.db.Exec(`ATTACH DATABASE ? AS ?`, other.dbFilePath, dbName) + if err != nil { + return nil, err + } + + return &C1FileAttached{ + safe: true, + file: c, + }, nil +} + +func (c *C1FileAttached) DetachFile(dbName string) (*C1FileAttached, error) { + _, err := c.file.db.Exec(`DETACH DATABASE ?`, dbName) + if err != nil { + return nil, err + } + + return &C1FileAttached{ + safe: false, + file: c.file, + }, nil +} + +// GrantStats introspects the database and returns the count of grants for the given sync run. +// If syncId is empty, it will use the latest sync run of the given type. +func (c *C1File) GrantStats(ctx context.Context, syncType connectorstore.SyncType, syncId string) (map[string]int64, error) { + ctx, span := tracer.Start(ctx, "C1File.GrantStats") + defer span.End() + + var err error + if syncId == "" { + syncId, err = c.LatestSyncID(ctx, syncType) + if err != nil { + return nil, err + } + } else { + lastSync, err := c.GetSync(ctx, &reader_v2.SyncsReaderServiceGetSyncRequest{SyncId: syncId}) + if err != nil { + return nil, err + } + if lastSync == nil { + return nil, status.Errorf(codes.NotFound, "sync '%s' not found", syncId) + } + if syncType != connectorstore.SyncTypeAny && syncType != connectorstore.SyncType(lastSync.Sync.SyncType) { + return nil, status.Errorf(codes.InvalidArgument, "sync '%s' is not of type '%s'", syncId, syncType) + } + } + + var allResourceTypes []*v2.ResourceType + pageToken := "" + for { + resp, err := c.ListResourceTypes(ctx, &v2.ResourceTypesServiceListResourceTypesRequest{PageToken: pageToken}) + if err != nil { + return nil, err + } + + allResourceTypes = append(allResourceTypes, resp.List...) + + if resp.NextPageToken == "" { + break + } + + pageToken = resp.NextPageToken + } + + stats := make(map[string]int64) + + for _, resourceType := range allResourceTypes { + grantsCount, err := c.db.From(grants.Name()). + Where(goqu.C("sync_id").Eq(syncId)). + Where(goqu.C("resource_type_id").Eq(resourceType.Id)). + CountContext(ctx) + if err != nil { + return nil, err + } + + stats[resourceType.Id] = grantsCount + } + + return stats, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go new file mode 100644 index 00000000..34bf5ea4 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go @@ -0,0 +1,142 @@ +package dotc1z + +import ( + "context" + "errors" + "fmt" +) + +type C1FileAttached struct { + safe bool + file *C1File +} + +func (c *C1FileAttached) CompactTable(ctx context.Context, destSyncID string, baseSyncID string, appliedSyncID string, tableName string) error { + if !c.safe { + return errors.New("database has been detached") + } + ctx, span := tracer.Start(ctx, "C1FileAttached.CompactTable") + defer span.End() + + // Get the column structure for this table by querying the schema + columns, err := c.getTableColumns(ctx, tableName) + if err != nil { + return fmt.Errorf("failed to get table columns: %w", err) + } + + // Build column lists for INSERT statements + columnList := "" + selectList := "" + for i, col := range columns { + if i > 0 { + columnList += ", " + selectList += ", " + } + columnList += col + if col == "sync_id" { + selectList += "? as sync_id" + } else { + selectList += col + } + } + + // Step 1: Insert ALL records from base sync + insertBaseQuery := fmt.Sprintf(` + INSERT INTO main.%s (%s) + SELECT %s + FROM base.%s + WHERE sync_id = ? + `, tableName, columnList, selectList, tableName) + + _, err = c.file.db.ExecContext(ctx, insertBaseQuery, destSyncID, baseSyncID) + if err != nil { + return fmt.Errorf("failed to copy base records: %w", err) + } + + // Step 2: Insert/replace records from applied sync where applied.discovered_at > main.discovered_at + insertOrReplaceAppliedQuery := fmt.Sprintf(` + INSERT OR REPLACE INTO main.%s (%s) + SELECT %s + FROM attached.%s AS a + WHERE a.sync_id = ? + AND ( + NOT EXISTS ( + SELECT 1 FROM main.%s AS m + WHERE m.external_id = a.external_id AND m.sync_id = ? + ) + OR EXISTS ( + SELECT 1 FROM main.%s AS m + WHERE m.external_id = a.external_id + AND m.sync_id = ? + AND a.discovered_at > m.discovered_at + ) + ) + `, tableName, columnList, selectList, tableName, tableName, tableName) + + _, err = c.file.db.ExecContext(ctx, insertOrReplaceAppliedQuery, destSyncID, appliedSyncID, destSyncID, destSyncID) + return err +} + +func (c *C1FileAttached) getTableColumns(ctx context.Context, tableName string) ([]string, error) { + if !c.safe { + return nil, errors.New("database has been detached") + } + // PRAGMA doesn't support parameter binding, so we format the table name directly + query := fmt.Sprintf("PRAGMA table_info(%s)", tableName) + rows, err := c.file.db.QueryContext(ctx, query) + if err != nil { + return nil, err + } + defer rows.Close() + + var columns []string + for rows.Next() { + var cid int + var name, dataType string + var notNull, pk int + var defaultValue interface{} + + err := rows.Scan(&cid, &name, &dataType, ¬Null, &defaultValue, &pk) + if err != nil { + return nil, err + } + + // Skip the 'id' column as it's auto-increment + if name != "id" { + columns = append(columns, name) + } + } + if rows.Err() != nil { + return nil, rows.Err() + } + + return columns, nil +} + +func (c *C1FileAttached) CompactResourceTypes(ctx context.Context, destSyncID string, baseSyncID string, appliedSyncID string) error { + if !c.safe { + return errors.New("database has been detached") + } + return c.CompactTable(ctx, destSyncID, baseSyncID, appliedSyncID, "v1_resource_types") +} + +func (c *C1FileAttached) CompactResources(ctx context.Context, destSyncID string, baseSyncID string, appliedSyncID string) error { + if !c.safe { + return errors.New("database has been detached") + } + return c.CompactTable(ctx, destSyncID, baseSyncID, appliedSyncID, "v1_resources") +} + +func (c *C1FileAttached) CompactEntitlements(ctx context.Context, destSyncID string, baseSyncID string, appliedSyncID string) error { + if !c.safe { + return errors.New("database has been detached") + } + return c.CompactTable(ctx, destSyncID, baseSyncID, appliedSyncID, "v1_entitlements") +} + +func (c *C1FileAttached) CompactGrants(ctx context.Context, destSyncID string, baseSyncID string, appliedSyncID string) error { + if !c.safe { + return errors.New("database has been detached") + } + return c.CompactTable(ctx, destSyncID, baseSyncID, appliedSyncID, "v1_grants") +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/clone_sync.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/clone_sync.go index 8d8767b3..0a6050d0 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/clone_sync.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/clone_sync.go @@ -8,6 +8,8 @@ import ( "os" "path/filepath" "strings" + + "github.com/conductorone/baton-sdk/pkg/connectorstore" ) func cloneTableQuery(tableName string) (string, error) { @@ -84,7 +86,7 @@ func (c *C1File) CloneSync(ctx context.Context, outPath string, syncID string) ( } if syncID == "" { - syncID, err = c.LatestSyncID(ctx) + syncID, err = c.LatestSyncID(ctx, connectorstore.SyncTypeFull) if err != nil { return err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go index e2360c68..68480acc 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go @@ -58,9 +58,10 @@ type DecoderOption func(*decoderOptions) error // options retains accumulated state of multiple options. type decoderOptions struct { - ctx context.Context - maxDecodedSize uint64 - maxMemorySize uint64 + ctx context.Context + maxDecodedSize uint64 + maxMemorySize uint64 + decoderConcurrency int } // WithContext sets a context, when cancelled, will cause subequent calls to Read() to return ctx.Error(). @@ -73,7 +74,7 @@ func WithContext(ctx context.Context) DecoderOption { // WithDecoderMaxMemory sets the maximum window size for streaming operations. // This can be used to control memory usage of potentially hostile content. -// Maximum is 1 << 63 bytes. Default is 32MiB. +// Maximum is 1 << 63 bytes. Default is 128MiB. func WithDecoderMaxMemory(n uint64) DecoderOption { return func(o *decoderOptions) error { if n == 0 { @@ -103,6 +104,16 @@ func WithDecoderMaxDecodedSize(n uint64) DecoderOption { } } +// WithDecoderConcurrency sets the number of created decoders. +// Default is 1, which disables async decoding/concurrency. +// 0 uses GOMAXPROCS. +func WithDecoderConcurrency(n int) DecoderOption { + return func(o *decoderOptions) error { + o.decoderConcurrency = n + return nil + } +} + type decoder struct { o *decoderOptions f io.Reader @@ -128,11 +139,18 @@ func (d *decoder) Read(p []byte) (int, error) { if maxMemSize == 0 { maxMemSize = defaultDecoderMaxMemory } - zd, err := zstd.NewReader( - d.f, - zstd.WithDecoderConcurrency(1), // disables async decoding/concurrency + + zstdOpts := []zstd.DOption{ zstd.WithDecoderLowmem(true), // uses lower memory, trading potentially more allocations zstd.WithDecoderMaxMemory(maxMemSize), // sets limit on maximum memory used when decoding stream + } + if d.o.decoderConcurrency >= 0 { + zstdOpts = append(zstdOpts, zstd.WithDecoderConcurrency(d.o.decoderConcurrency)) + } + + zd, err := zstd.NewReader( + d.f, + zstdOpts..., ) if err != nil { d.decoderInitErr = err @@ -206,7 +224,9 @@ func NewDecoder(f io.Reader, opts ...DecoderOption) (*decoder, error) { } } - o := &decoderOptions{} + o := &decoderOptions{ + decoderConcurrency: 1, + } for _, opt := range opts { err := opt(o) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/diff.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/diff.go index 476b4ccc..6db52b61 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/diff.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/diff.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" + "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/doug-martin/goqu/v9" "github.com/segmentio/ksuid" ) @@ -30,7 +31,7 @@ func (c *C1File) GenerateSyncDiff(ctx context.Context, baseSyncID string, applie // Generate a new unique ID for the diff sync diffSyncID := ksuid.New().String() - if err := c.insertSyncRun(ctx, diffSyncID, SyncTypePartial, baseSyncID); err != nil { + if err := c.insertSyncRun(ctx, diffSyncID, connectorstore.SyncTypePartial, baseSyncID); err != nil { return "", err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/dotc1z.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/dotc1z.go index cc46a12f..835a2958 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/dotc1z.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/dotc1z.go @@ -14,12 +14,12 @@ import ( var tracer = otel.Tracer("baton-sdk/pkg.dotc1z") // NewC1FileReader returns a connectorstore.Reader implementation for the given sqlite db file path. -func NewC1FileReader(ctx context.Context, dbFilePath string) (connectorstore.Reader, error) { - return NewC1File(ctx, dbFilePath) +func NewC1FileReader(ctx context.Context, dbFilePath string, opts ...C1FOption) (connectorstore.Reader, error) { + return NewC1File(ctx, dbFilePath, opts...) } // NewC1ZFileDecoder wraps a given .c1z io.Reader that validates the .c1z and decompresses/decodes the underlying file. -// Defaults: 32MiB max memory and 2GiB max decoded size +// Defaults: 128MiB max memory and 3GiB max decoded size // You must close the resulting io.ReadCloser when you are done, do not forget to close the given io.Reader if necessary. func NewC1ZFileDecoder(f io.Reader, opts ...DecoderOption) (io.ReadCloser, error) { return NewDecoder(f, opts...) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/file.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/file.go index 44bfc4a9..8e0b296e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/file.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/file.go @@ -11,7 +11,7 @@ import ( "go.uber.org/zap" ) -func loadC1z(filePath string, tmpDir string) (string, error) { +func loadC1z(filePath string, tmpDir string, opts ...DecoderOption) (string, error) { var err error workingDir, err := os.MkdirTemp(tmpDir, "c1z") if err != nil { @@ -38,7 +38,7 @@ func loadC1z(filePath string, tmpDir string) (string, error) { } defer c1zFile.Close() - r, err := NewDecoder(c1zFile) + r, err := NewDecoder(c1zFile, opts...) if err != nil { return "", err } @@ -69,12 +69,6 @@ func saveC1z(dbFilePath string, outputFilePath string) error { if err != nil { zap.L().Error("failed to close db file", zap.Error(err)) } - - // Cleanup the database filepath. This should always be a file within a temp directory, so we remove the entire dir. - err = os.RemoveAll(filepath.Dir(dbFilePath)) - if err != nil { - zap.L().Error("failed to remove db dir", zap.Error(err)) - } }() outFile, err := os.OpenFile(outputFilePath, os.O_RDWR|os.O_CREATE|syscall.O_TRUNC, 0644) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/local/local.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/local/local.go index 79e8195a..f07f6b6e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/local/local.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/local/local.go @@ -16,9 +16,10 @@ import ( var tracer = otel.Tracer("baton-sdk/pkg.dotc1z.manager.local") type localManager struct { - filePath string - tmpPath string - tmpDir string + filePath string + tmpPath string + tmpDir string + decoderOptions []dotc1z.DecoderOption } type Option func(*localManager) @@ -29,6 +30,12 @@ func WithTmpDir(tmpDir string) Option { } } +func WithDecoderOptions(opts ...dotc1z.DecoderOption) Option { + return func(o *localManager) { + o.decoderOptions = opts + } +} + func (l *localManager) copyFileToTmp(ctx context.Context) error { _, span := tracer.Start(ctx, "localManager.copyFileToTmp") defer span.End() @@ -97,7 +104,14 @@ func (l *localManager) LoadC1Z(ctx context.Context) (*dotc1z.C1File, error) { zap.String("temp_path", l.tmpPath), ) - return dotc1z.NewC1ZFile(ctx, l.tmpPath, dotc1z.WithTmpDir(l.tmpDir), dotc1z.WithPragma("journal_mode", "WAL")) + opts := []dotc1z.C1ZOption{ + dotc1z.WithTmpDir(l.tmpDir), + dotc1z.WithPragma("journal_mode", "WAL"), + } + if len(l.decoderOptions) > 0 { + opts = append(opts, dotc1z.WithDecoderOptions(l.decoderOptions...)) + } + return dotc1z.NewC1ZFile(ctx, l.tmpPath, opts...) } // SaveC1Z saves the C1Z file to the local file system. diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/manager.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/manager.go index a3b0bfb1..e9466525 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/manager.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/manager.go @@ -18,7 +18,8 @@ type Manager interface { } type managerOptions struct { - tmpDir string + tmpDir string + decoderOptions []dotc1z.DecoderOption } type ManagerOption func(*managerOptions) @@ -29,6 +30,12 @@ func WithTmpDir(tmpDir string) ManagerOption { } } +func WithDecoderOptions(opts ...dotc1z.DecoderOption) ManagerOption { + return func(o *managerOptions) { + o.decoderOptions = opts + } +} + // 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 @@ -46,12 +53,18 @@ func New(ctx context.Context, filePath string, opts ...ManagerOption) (Manager, if options.tmpDir != "" { s3Opts = append(s3Opts, s3.WithTmpDir(options.tmpDir)) } + if len(options.decoderOptions) > 0 { + s3Opts = append(s3Opts, s3.WithDecoderOptions(options.decoderOptions...)) + } return s3.NewS3Manager(ctx, filePath, s3Opts...) default: var localOpts []local.Option if options.tmpDir != "" { localOpts = append(localOpts, local.WithTmpDir(options.tmpDir)) } + if len(options.decoderOptions) > 0 { + localOpts = append(localOpts, local.WithDecoderOptions(options.decoderOptions...)) + } return local.New(ctx, filePath, localOpts...) } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/s3/s3.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/s3/s3.go index eed8b599..385b1bc4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/s3/s3.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/manager/s3/s3.go @@ -19,10 +19,11 @@ import ( var tracer = otel.Tracer("baton-sdk/pkg.dotc1z.manager.s3") type s3Manager struct { - client *us3.S3Client - fileName string - tmpFile string - tmpDir string + client *us3.S3Client + fileName string + tmpFile string + tmpDir string + decoderOptions []dotc1z.DecoderOption } type Option func(*s3Manager) @@ -33,6 +34,12 @@ func WithTmpDir(tmpDir string) Option { } } +func WithDecoderOptions(opts ...dotc1z.DecoderOption) Option { + return func(o *s3Manager) { + o.decoderOptions = opts + } +} + func (s *s3Manager) copyToTempFile(ctx context.Context, r io.Reader) error { _, span := tracer.Start(ctx, "s3Manager.copyToTempFile") defer span.End() @@ -116,7 +123,14 @@ func (s *s3Manager) LoadC1Z(ctx context.Context) (*dotc1z.C1File, error) { return nil, err } - return dotc1z.NewC1ZFile(ctx, s.tmpFile, dotc1z.WithTmpDir(s.tmpDir)) + opts := []dotc1z.C1ZOption{ + dotc1z.WithTmpDir(s.tmpDir), + dotc1z.WithPragma("journal_mode", "WAL"), + } + if len(s.decoderOptions) > 0 { + opts = append(opts, dotc1z.WithDecoderOptions(s.decoderOptions...)) + } + return dotc1z.NewC1ZFile(ctx, s.tmpFile, opts...) } // SaveC1Z saves a file to the AWS S3 bucket. diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go index 01e1e4bb..60ede846 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go @@ -2,6 +2,7 @@ package dotc1z import ( "context" + "errors" "fmt" "strconv" "time" @@ -13,6 +14,7 @@ import ( "google.golang.org/protobuf/types/known/anypb" "github.com/conductorone/baton-sdk/pkg/annotations" + "github.com/conductorone/baton-sdk/pkg/connectorstore" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" ) @@ -179,13 +181,13 @@ func (c *C1File) listConnectorObjects(ctx context.Context, tableName string, req default: var latestSyncRun *syncRun var err error - latestSyncRun, err = c.getFinishedSync(ctx, 0, SyncTypeFull) + latestSyncRun, err = c.getFinishedSync(ctx, 0, connectorstore.SyncTypeFull) if err != nil { return nil, "", err } if latestSyncRun == nil { - latestSyncRun, err = c.getLatestUnfinishedSync(ctx) + latestSyncRun, err = c.getLatestUnfinishedSync(ctx, connectorstore.SyncTypeAny) if err != nil { return nil, "", err } @@ -253,6 +255,9 @@ func (c *C1File) listConnectorObjects(ctx context.Context, tableName string, req lastRow = rowId ret = append(ret, data) } + if rows.Err() != nil { + return nil, "", rows.Err() + } nextPageToken := "" if count > pageSize { @@ -314,6 +319,13 @@ 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 @@ -323,28 +335,39 @@ func executeChunkedInsert( chunkedRows := rows[start:end] // Create the base insert dataset - insertDs := c.db.Insert(tableName) + insertDs := tx.Insert(tableName) // Apply the custom query building function - insertDs, err := buildQueryFn(insertDs, chunkedRows) + insertDs, err = buildQueryFn(insertDs, chunkedRows) if err != nil { - return err + txError = err + break } // Generate the SQL query, args, err := insertDs.ToSQL() if err != nil { - return err + txError = err + break } // Execute the query - _, err = c.db.Exec(query, args...) + _, err = tx.ExecContext(ctx, query, args...) if err != nil { - return err + txError = err + break } } - return nil + if txError != nil { + if rollbackErr := tx.Rollback(); rollbackErr != nil { + return errors.Join(rollbackErr, txError) + } + + return fmt.Errorf("error executing chunked insert: %w", txError) + } + + return tx.Commit() } func bulkPutConnectorObject[T proto.Message]( @@ -447,13 +470,13 @@ func (c *C1File) getResourceObject(ctx context.Context, resourceID *v2.ResourceI default: var latestSyncRun *syncRun var err error - latestSyncRun, err = c.getFinishedSync(ctx, 0, SyncTypeFull) + latestSyncRun, err = c.getFinishedSync(ctx, 0, connectorstore.SyncTypeFull) if err != nil { return err } if latestSyncRun == nil { - latestSyncRun, err = c.getLatestUnfinishedSync(ctx) + latestSyncRun, err = c.getLatestUnfinishedSync(ctx, connectorstore.SyncTypeAny) if err != nil { return err } @@ -507,13 +530,13 @@ func (c *C1File) getConnectorObject(ctx context.Context, tableName string, id st default: var latestSyncRun *syncRun var err error - latestSyncRun, err = c.getFinishedSync(ctx, 0, SyncTypeAny) + latestSyncRun, err = c.getFinishedSync(ctx, 0, connectorstore.SyncTypeAny) if err != nil { return fmt.Errorf("error getting finished sync: %w", err) } if latestSyncRun == nil { - latestSyncRun, err = c.getLatestUnfinishedSync(ctx) + latestSyncRun, err = c.getLatestUnfinishedSync(ctx, connectorstore.SyncTypeAny) if err != nil { return fmt.Errorf("error getting latest unfinished sync: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go index 96fbfc9a..08157f2f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "os" + "slices" "strconv" "time" @@ -13,9 +14,12 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "github.com/segmentio/ksuid" "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" + "github.com/conductorone/baton-sdk/pkg/connectorstore" ) const syncRunsTableVersion = "1" @@ -82,24 +86,16 @@ func (r *syncRunsTable) Migrations(ctx context.Context, db *goqu.Database) error return nil } -type SyncType string - -const ( - SyncTypeFull SyncType = "full" - SyncTypePartial SyncType = "partial" - SyncTypeAny SyncType = "" -) - type syncRun struct { ID string StartedAt *time.Time EndedAt *time.Time SyncToken string - Type SyncType + Type connectorstore.SyncType ParentSyncID string } -func (c *C1File) getLatestUnfinishedSync(ctx context.Context) (*syncRun, error) { +func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connectorstore.SyncType) (*syncRun, error) { ctx, span := tracer.Start(ctx, "C1File.getLatestUnfinishedSync") defer span.End() @@ -116,6 +112,9 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context) (*syncRun, error) q = q.Where(goqu.C("ended_at").IsNull()) q = q.Where(goqu.C("started_at").Gte(oneWeekAgo)) q = q.Order(goqu.C("started_at").Desc()) + if syncType != connectorstore.SyncTypeAny { + q = q.Where(goqu.C("sync_type").Eq(syncType)) + } q = q.Limit(1) query, args, err := q.ToSQL() @@ -136,7 +135,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context) (*syncRun, error) return ret, nil } -func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType SyncType) (*syncRun, error) { +func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType connectorstore.SyncType) (*syncRun, error) { ctx, span := tracer.Start(ctx, "C1File.getFinishedSync") defer span.End() @@ -146,15 +145,15 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType Sync } // Validate syncType - if syncType != SyncTypeFull && syncType != SyncTypePartial && syncType != SyncTypeAny { - return nil, fmt.Errorf("invalid sync type: %s", syncType) + if !slices.Contains(connectorstore.AllSyncTypes, syncType) { + return nil, status.Errorf(codes.InvalidArgument, "invalid sync type: %s", syncType) } ret := &syncRun{} q := c.db.From(syncRuns.Name()) q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") q = q.Where(goqu.C("ended_at").IsNotNull()) - if syncType != SyncTypeAny { + if syncType != connectorstore.SyncTypeAny { q = q.Where(goqu.C("sync_type").Eq(syncType)) } q = q.Order(goqu.C("ended_at").Desc()) @@ -234,6 +233,9 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui lastRow = rowId ret = append(ret, data) } + if rows.Err() != nil { + return nil, "", rows.Err() + } nextPageToken := "" if count > pageSize { @@ -243,11 +245,11 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui return ret, nextPageToken, nil } -func (c *C1File) LatestSyncID(ctx context.Context) (string, error) { +func (c *C1File) LatestSyncID(ctx context.Context, syncType connectorstore.SyncType) (string, error) { ctx, span := tracer.Start(ctx, "C1File.LatestSyncID") defer span.End() - s, err := c.getFinishedSync(ctx, 0, SyncTypeFull) + s, err := c.getFinishedSync(ctx, 0, syncType) if err != nil { return "", err } @@ -269,11 +271,11 @@ func (c *C1File) ViewSync(ctx context.Context, syncID string) error { return nil } -func (c *C1File) PreviousSyncID(ctx context.Context) (string, error) { +func (c *C1File) PreviousSyncID(ctx context.Context, syncType connectorstore.SyncType) (string, error) { ctx, span := tracer.Start(ctx, "C1File.PreviousSyncID") defer span.End() - s, err := c.getFinishedSync(ctx, 1, SyncTypeFull) + s, err := c.getFinishedSync(ctx, 1, syncType) if err != nil { return "", err } @@ -285,11 +287,11 @@ func (c *C1File) PreviousSyncID(ctx context.Context) (string, error) { return s.ID, nil } -func (c *C1File) LatestFinishedSync(ctx context.Context) (string, error) { +func (c *C1File) LatestFinishedSyncID(ctx context.Context, syncType connectorstore.SyncType) (string, error) { ctx, span := tracer.Start(ctx, "C1File.LatestFinishedSync") defer span.End() - s, err := c.getFinishedSync(ctx, 0, SyncTypeFull) + s, err := c.getFinishedSync(ctx, 0, syncType) if err != nil { return "", err } @@ -334,7 +336,7 @@ func (c *C1File) getCurrentSync(ctx context.Context) (*syncRun, error) { defer span.End() if c.currentSyncID == "" { - return nil, fmt.Errorf("c1file: sync must be running to checkpoint") + return nil, fmt.Errorf("c1file: sync must be running to get current sync") } return c.getSync(ctx, c.currentSyncID) @@ -381,67 +383,122 @@ func (c *C1File) CheckpointSync(ctx context.Context, syncToken string) error { return nil } -// StartSync generates a sync ID to be associated with all objects discovered during this run. -func (c *C1File) StartSync(ctx context.Context) (string, bool, error) { - ctx, span := tracer.Start(ctx, "C1File.StartSync") +func (c *C1File) ResumeSync(ctx context.Context, syncType connectorstore.SyncType, syncID string) (string, error) { + ctx, span := tracer.Start(ctx, "C1File.ResumeSync") defer span.End() if c.currentSyncID != "" { - return c.currentSyncID, false, nil + if syncID == c.currentSyncID { + return c.currentSyncID, nil + } + if syncID != "" { + return "", status.Errorf(codes.FailedPrecondition, "current sync is %s, cannot resume %s", c.currentSyncID, syncID) + } } - newSync := false - - sync, err := c.getLatestUnfinishedSync(ctx) - if err != nil { - return "", false, err + if syncID != "" { + syncRun, err := c.getSync(ctx, syncID) + if err != nil { + return "", err + } + if syncType != connectorstore.SyncTypeAny && syncRun.Type != syncType { + return "", status.Errorf(codes.FailedPrecondition, "cannot resume sync (%s) when a different sync type (%s) is running", syncRun.Type, syncType) + } + if syncRun.EndedAt != nil { + return "", status.Errorf(codes.FailedPrecondition, "cannot resume sync that has already ended") + } + c.currentSyncID = syncID + return c.currentSyncID, nil } - var syncID string - if sync != nil && sync.EndedAt == nil { - syncID = sync.ID - } else { - syncID, err = c.StartNewSync(ctx) + if c.currentSyncID != "" { + syncRun, err := c.getSync(ctx, c.currentSyncID) if err != nil { - return "", false, err + return "", err } - newSync = true + if syncType != connectorstore.SyncTypeAny && syncRun.Type != syncType { + return "", status.Errorf(codes.FailedPrecondition, "cannot resume sync. current sync %s is type %s, cannot resume as type %s", syncRun.ID, syncRun.Type, syncType) + } + if syncRun.EndedAt != nil { + return "", status.Errorf(codes.Internal, "current sync %s has already ended. this should never happen", syncRun.ID) + } + + return c.currentSyncID, nil } - c.currentSyncID = syncID + syncRun, err := c.getLatestUnfinishedSync(ctx, syncType) + if err != nil { + return "", err + } + if syncRun == nil { + return "", status.Errorf(codes.NotFound, "no unfinished sync found for type %s", syncType) + } - return c.currentSyncID, newSync, nil + c.currentSyncID = syncRun.ID + return c.currentSyncID, nil } -func (c *C1File) StartNewSync(ctx context.Context) (string, error) { - ctx, span := tracer.Start(ctx, "C1File.StartNewSync") +// StartOrResumeSync checks if a sync is already running and resumes it if it is. +// If no sync is running, it starts a new sync. +// It returns the sync ID and a boolean indicating if a new sync was started. +func (c *C1File) StartOrResumeSync(ctx context.Context, syncType connectorstore.SyncType, syncID string) (string, bool, error) { + ctx, span := tracer.Start(ctx, "C1File.StartOrResumeSync") defer span.End() - return c.startNewSyncInternal(ctx, SyncTypeFull, "") -} + resumedSyncID, err := c.ResumeSync(ctx, syncType, syncID) + if err != nil { + if status.Code(err) != codes.NotFound && !errors.Is(err, sql.ErrNoRows) { + return "", false, err + } + } else { + return resumedSyncID, false, nil + } -func (c *C1File) StartNewSyncV2(ctx context.Context, syncType string, parentSyncID string) (string, error) { - ctx, span := tracer.Start(ctx, "C1File.StartNewSyncV2") - defer span.End() + if syncID != "" { + return "", false, status.Errorf(codes.NotFound, "no sync with id %s found to resume", syncID) + } - var syncTypeEnum SyncType - switch syncType { - case "full": - syncTypeEnum = SyncTypeFull - case "partial": - syncTypeEnum = SyncTypePartial - default: - return "", fmt.Errorf("invalid sync type: %s", syncType) + syncID, err = c.StartNewSync(ctx, syncType, "") + if err != nil { + return "", false, err } - return c.startNewSyncInternal(ctx, syncTypeEnum, parentSyncID) + + c.currentSyncID = syncID + + return c.currentSyncID, true, nil } -func (c *C1File) startNewSyncInternal(ctx context.Context, syncType SyncType, parentSyncID string) (string, error) { - // Not sure if we want to do this here +func (c *C1File) StartNewSync(ctx context.Context, syncType connectorstore.SyncType, parentSyncID string) (string, error) { + ctx, span := tracer.Start(ctx, "C1File.StartNewSync") + defer span.End() + if c.currentSyncID != "" { + cur, err := c.getSync(ctx, c.currentSyncID) + if err != nil { + return "", err + } + if cur != nil && cur.EndedAt == nil && cur.Type != syncType { + return "", status.Errorf(codes.FailedPrecondition, "current sync (id %s) is type %s. cannot start %s", cur.ID, cur.Type, syncType) + } return c.currentSyncID, nil } + switch syncType { + case connectorstore.SyncTypeFull: + if parentSyncID != "" { + return "", status.Errorf(codes.InvalidArgument, "parent sync id must be empty for full sync") + } + case connectorstore.SyncTypeResourcesOnly: + if parentSyncID != "" { + return "", status.Errorf(codes.InvalidArgument, "parent sync id must be empty for resources only sync") + } + case connectorstore.SyncTypePartial: + case connectorstore.SyncTypeAny: + return "", status.Errorf(codes.InvalidArgument, "sync cannot be started with SyncTypeAny") + default: + return "", status.Errorf(codes.InvalidArgument, "invalid sync type: %s", syncType) + } + syncID := ksuid.New().String() if err := c.insertSyncRun(ctx, syncID, syncType, parentSyncID); err != nil { @@ -453,7 +510,7 @@ func (c *C1File) startNewSyncInternal(ctx context.Context, syncType SyncType, pa return c.currentSyncID, nil } -func (c *C1File) insertSyncRun(ctx context.Context, syncID string, syncType SyncType, parentSyncID string) error { +func (c *C1File) insertSyncRun(ctx context.Context, syncID string, syncType connectorstore.SyncType, parentSyncID string) error { q := c.db.Insert(syncRuns.Name()) q = q.Rows(goqu.Record{ "sync_id": syncID, @@ -564,7 +621,7 @@ func (c *C1File) Cleanup(ctx context.Context) error { if sr.EndedAt == nil { continue } - if sr.Type == SyncTypePartial { + if sr.Type == connectorstore.SyncTypePartial || sr.Type == connectorstore.SyncTypeResourcesOnly { partials = append(partials, sr) } else { ret = append(ret, sr) @@ -596,7 +653,7 @@ func (c *C1File) Cleanup(ctx context.Context) error { l.Info("Removed old sync data.", zap.String("sync_date", ret[i].EndedAt.Format(time.RFC3339)), zap.String("sync_id", ret[i].ID)) } - // Delete partial syncs that ended before the earliest-kept sync started + // Delete non-full syncs that ended before the earliest-kept full sync started if len(ret) > syncLimit { earliestKeptSync := ret[len(ret)-syncLimit] l.Debug("Earliest kept sync", zap.String("sync_id", earliestKeptSync.ID), zap.Time("started_at", *earliestKeptSync.StartedAt)) @@ -738,12 +795,7 @@ func (c *C1File) GetLatestFinishedSync(ctx context.Context, request *reader_v2.S ctx, span := tracer.Start(ctx, "C1File.GetLatestFinishedSync") defer span.End() - syncType := request.SyncType - if syncType == "" { - syncType = string(SyncTypeFull) - } - - sync, err := c.getFinishedSync(ctx, 0, SyncType(syncType)) + sync, err := c.getFinishedSync(ctx, 0, connectorstore.SyncType(request.SyncType)) if err != nil { return nil, fmt.Errorf("error fetching latest finished sync: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go index 373065ef..8e92b832 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go @@ -83,9 +83,14 @@ var ( WithDescription("The timestamp indicating when debug-level logging should expire"), WithPersistent(true), WithExportTarget(ExportTargetOps)) - skipFullSync = BoolField("skip-full-sync", WithDescription("This must be set to skip a full sync"), WithPersistent(true), WithExportTarget(ExportTargetNone)) - targetedSyncResourceIDs = StringSliceField("sync-resources", WithDescription("The resource IDs to sync"), WithPersistent(true), WithExportTarget(ExportTargetNone)) - diffSyncsField = BoolField( + skipFullSync = BoolField("skip-full-sync", WithDescription("This must be set to skip a full 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"), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) + diffSyncsField = BoolField( "diff-syncs", WithDescription("Create a new partial SyncID from a base and applied sync."), WithHidden(true), @@ -136,10 +141,10 @@ var ( WithPersistent(true), WithExportTarget(ExportTargetNone), ) - invokeActionArgsField = StringMapField("invoke-action-args", + invokeActionArgsField = StringField("invoke-action-args", WithHidden(true), WithDescription("JSON-formatted object of map keys and values like '{ 'key': 'value' }'"), - WithDefaultValue(map[string]any{}), + WithDefaultValue("{}"), WithPersistent(true), WithExportTarget(ExportTargetNone), ) @@ -252,6 +257,7 @@ var DefaultFields = []SchemaField{ logLevelDebugExpiresAtField, skipFullSync, targetedSyncResourceIDs, + skipEntitlementsAndGrants, externalResourceC1ZField, externalResourceEntitlementIdFilter, diffSyncsField, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go index 87474f52..aeebb3e6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go @@ -115,7 +115,7 @@ func isValidDomain(hostname string) bool { // Labels can only contain letters, digits, or hyphens for i := range label { - if !(isAlphaNumeric(label[i]) || label[i] == '-') { + if !isAlphaNumeric(label[i]) && label[i] != '-' { return false } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/config/config.go b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/config/config.go index ce7db970..26981c4c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/config/config.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/config/config.go @@ -1,12 +1,10 @@ package config import ( - "bytes" "context" "crypto/ed25519" "crypto/tls" "crypto/x509" - "encoding/base64" "errors" "fmt" "net/url" @@ -18,25 +16,24 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - pb_connector_manager "github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1" - "github.com/conductorone/dpop/pkg/dpop" + "github.com/conductorone/baton-sdk/pkg/crypto" "github.com/conductorone/baton-sdk/pkg/sdk" dpop_grpc "github.com/conductorone/dpop/integrations/dpop_grpc" dpop_oauth "github.com/conductorone/dpop/integrations/dpop_oauth2" + "golang.org/x/oauth2" ) var ( - ErrInvalidClientSecret = errors.New("invalid client secret") - ErrInvalidClientID = errors.New("invalid client id") - v1SecretTokenIdentifier = []byte("v1") + ErrInvalidClientID = errors.New("invalid client id") ) -func GetConnectorConfigServiceClient(ctx context.Context, clientID string, clientSecret string) (pb_connector_manager.ConnectorConfigServiceClient, *jose.JSONWebKey, error) { +// NewDPoPClient creates a gRPC client with DPoP authentication. +func NewDPoPClient(ctx context.Context, clientID string, clientSecret string) (grpc.ClientConnInterface, *jose.JSONWebKey, oauth2.TokenSource, error) { _, tokenHost, err := parseClientID(clientID) if err != nil { - return nil, nil, err + return nil, nil, nil, err } if envHost, ok := os.LookupEnv("BATON_LAMBDA_TOKEN_HOST"); ok { @@ -51,7 +48,7 @@ func GetConnectorConfigServiceClient(ctx context.Context, clientID string, clien _, priv, err := ed25519.GenerateKey(nil) if err != nil { - return nil, nil, fmt.Errorf("get-connector-service-client: failed to generate ed25519: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to generate ed25519: %w", err) } jwk := &jose.JSONWebKey{ @@ -61,24 +58,24 @@ func GetConnectorConfigServiceClient(ctx context.Context, clientID string, clien Use: "sig", } - clientSecretJWK, err := parseSecret([]byte(clientSecret)) + clientSecretJWK, err := crypto.ParseClientSecret([]byte(clientSecret), false) if err != nil { - return nil, nil, fmt.Errorf("get-connector-service-client: failed to unmarshal client secret: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to unmarshal client secret: %w", err) } proofer, err := dpop.NewProofer(jwk) if err != nil { - return nil, nil, fmt.Errorf("get-connector-service-client: failed to create proofer: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to create proofer: %w", err) } idAttMarshaller, err := NewIdAttMarshaller(ctx) if err != nil { - return nil, nil, fmt.Errorf("get-connector-service-client: failed to create claims adjuster: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to create claims adjuster: %w", err) } opts := dpop_oauth.WithRequestOption(dpop_oauth.WithCustomMarshaler(idAttMarshaller.Marshal)) tokenSource, err := dpop_oauth.NewTokenSource(proofer, tokenURL, clientID, clientSecretJWK, opts) if err != nil { - return nil, nil, fmt.Errorf("get-connector-service-client: failed to create token source: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to create token source: %w", err) } creds, err := dpop_grpc.NewDPoPCredentials(proofer, tokenSource, tokenHost, []dpop.ProofOption{ @@ -86,12 +83,12 @@ func GetConnectorConfigServiceClient(ctx context.Context, clientID string, clien dpop.WithProofNowFunc(time.Now), }) if err != nil { - return nil, nil, fmt.Errorf("get-connector-service-client: failed to create dpop credentials: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to create dpop credentials: %w", err) } systemCertPool, err := x509.SystemCertPool() if err != nil || systemCertPool == nil { - return nil, nil, fmt.Errorf("get-connector-service-client: failed to load system cert pool: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to load system cert pool: %w", err) } transportCreds := credentials.NewTLS(&tls.Config{ RootCAs: systemCertPool, @@ -106,10 +103,10 @@ func GetConnectorConfigServiceClient(ctx context.Context, clientID string, clien client, err := grpc.NewClient(tokenHost, dialOpts...) if err != nil { - return nil, nil, fmt.Errorf("connector-manager-client: failed to create client: %w", err) + return nil, nil, nil, fmt.Errorf("new-dpop-client: failed to create client: %w", err) } - return pb_connector_manager.NewConnectorConfigServiceClient(client), jwk, nil + return client, jwk, tokenSource, nil } func parseClientID(input string) (string, string, error) { @@ -128,36 +125,3 @@ func parseClientID(input string) (string, string, error) { return clientName, items[0], nil } - -func parseSecret(input []byte) (*jose.JSONWebKey, error) { - items := bytes.SplitN(input, []byte(":"), 4) - if len(items) != 4 { - return nil, ErrInvalidClientSecret - } - - if !bytes.Equal(items[2], v1SecretTokenIdentifier) { - return nil, ErrInvalidClientSecret - } - - jwkData, err := base64.RawURLEncoding.DecodeString(string(items[3])) - if err != nil { - return nil, ErrInvalidClientSecret - } - - npk := &jose.JSONWebKey{} - err = npk.UnmarshalJSON(jwkData) - if err != nil { - return nil, ErrInvalidClientSecret - } - - if npk.IsPublic() || !npk.Valid() { - return nil, ErrInvalidClientSecret - } - - _, ok := npk.Key.(ed25519.PrivateKey) - if !ok { - return nil, ErrInvalidClientSecret - } - - return npk, nil -} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/transport.go b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/transport.go index 29576c5c..caabb8ec 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/transport.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/transport.go @@ -1,6 +1,9 @@ package grpc import ( + "encoding/json" + "errors" + spb "google.golang.org/genproto/googleapis/rpc/status" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -10,15 +13,91 @@ import ( "google.golang.org/protobuf/types/known/anypb" pbtransport "github.com/conductorone/baton-sdk/pb/c1/transport/v1" + "google.golang.org/protobuf/reflect/protoregistry" ) type Request struct { msg *pbtransport.Request } +/* +UnmarshalJSON unmarshals the JSON into a Request of course, + +filtering out any annotations that are not known to the global registry +which happens frequently for new features and would otherwise require +rolling every lambda function. + +Our requests are small in size, dwarfed by the work of the connector, +so the performance impact is negligible. +*/ func (f *Request) UnmarshalJSON(b []byte) error { f.msg = &pbtransport.Request{} - return protojson.Unmarshal(b, f.msg) + err := protojson.Unmarshal(b, f.msg) + if err == nil { + return nil + } + // There doesn't seem to be a stable interface for "unknown field" errors. + originalErr := err + + // Parse top-level as raw and surgically filter req.annotations + var top map[string]json.RawMessage + if err := json.Unmarshal(b, &top); err != nil { + return err + } + // Track if we actually modified the payload. + changed := false + + if reqRaw, ok := top["req"]; ok && len(reqRaw) > 0 { + var reqObj map[string]json.RawMessage + if err := json.Unmarshal(reqRaw, &reqObj); err == nil { + if annsRaw, ok := reqObj["annotations"]; ok && len(annsRaw) > 0 { + var anns []json.RawMessage + if err := json.Unmarshal(annsRaw, &anns); err == nil { + wellKnownAnnotations := make([]json.RawMessage, 0, len(anns)) + for _, ann := range anns { + var annObj map[string]json.RawMessage + if err := json.Unmarshal(ann, &annObj); err != nil { + continue + } + var typeURL string + if t, ok := annObj["@type"]; ok { + if err := json.Unmarshal(t, &typeURL); err == nil { + // It would be nice to log here, but we have no context. + if _, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL); err == nil { + wellKnownAnnotations = append(wellKnownAnnotations, ann) // keep only known types + } + } + } + } + if len(wellKnownAnnotations) != len(anns) { + if newAnns, err := json.Marshal(wellKnownAnnotations); err == nil { + reqObj["annotations"] = newAnns + if newReqRaw, err := json.Marshal(reqObj); err == nil { + top["req"] = newReqRaw + changed = true + } + } + } + } + } + } + } + + if !changed { + return originalErr + } + + filteredJSON, err := json.Marshal(top) + if err != nil { + return errors.Join(originalErr, err) + } + + err = protojson.Unmarshal(filteredJSON, f.msg) + if err != nil { + return errors.Join(originalErr, err) + } + + return nil } func (f *Request) MarshalJSON() ([]byte, error) { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go index d324aa3b..6ff7e811 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go @@ -47,16 +47,16 @@ type Provisioner struct { // makeCrypto is used by rotateCredentials and createAccount. // FIXME(morgabra/ggreer): Huge hack for testing. -func makeCrypto(ctx context.Context) ([]byte, *v2.CredentialOptions, []*v2.EncryptionConfig, error) { +func makeCrypto(ctx context.Context) (*v2.CredentialOptions, []*v2.EncryptionConfig, error) { // Default to generating a random key and random password that is 12 characters long provider, err := providers.GetEncryptionProvider(jwk.EncryptionProviderJwk) if err != nil { - return nil, nil, nil, err + return nil, nil, err } - config, privateKey, err := provider.GenerateKey(ctx) + config, _, err := provider.GenerateKey(ctx) if err != nil { - return nil, nil, nil, err + return nil, nil, err } opts := &v2.CredentialOptions{ @@ -66,7 +66,7 @@ func makeCrypto(ctx context.Context) ([]byte, *v2.CredentialOptions, []*v2.Encry }, }, } - return privateKey, opts, []*v2.EncryptionConfig{config}, nil + return opts, []*v2.EncryptionConfig{config}, nil } func (p *Provisioner) Run(ctx context.Context) error { @@ -281,7 +281,7 @@ func (p *Provisioner) createAccount(ctx context.Context) error { }) } - _, opts, config, err := makeCrypto(ctx) + opts, config, err := makeCrypto(ctx) if err != nil { return err } @@ -326,7 +326,7 @@ func (p *Provisioner) rotateCredentials(ctx context.Context) error { l := ctxzap.Extract(ctx) - _, opts, config, err := makeCrypto(ctx) + opts, config, err := makeCrypto(ctx) if err != nil { return err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/mem_ratelimiter.go b/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/mem_ratelimiter.go index 9aa60cb5..ec27d7f2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/mem_ratelimiter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/mem_ratelimiter.go @@ -6,7 +6,6 @@ import ( "time" ratelimitV1 "github.com/conductorone/baton-sdk/pb/c1/ratelimit/v1" - v1 "github.com/conductorone/baton-sdk/pb/c1/ratelimit/v1" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" rl "go.uber.org/ratelimit" "go.uber.org/zap" @@ -22,20 +21,20 @@ type MemRateLimiter struct { // TODO func (m *MemRateLimiter) Do(ctx context.Context, req *ratelimitV1.DoRequest) (*ratelimitV1.DoResponse, error) { if m.limiter == nil { - return &v1.DoResponse{ + return &ratelimitV1.DoResponse{ RequestToken: req.RequestToken, - Description: &v1.RateLimitDescription{ - Status: v1.RateLimitDescription_STATUS_EMPTY, + Description: &ratelimitV1.RateLimitDescription{ + Status: ratelimitV1.RateLimitDescription_STATUS_EMPTY, }, }, nil } m.limiter.Take() - return &v1.DoResponse{ + return &ratelimitV1.DoResponse{ RequestToken: req.RequestToken, - Description: &v1.RateLimitDescription{ - Status: v1.RateLimitDescription_STATUS_EMPTY, + Description: &ratelimitV1.RateLimitDescription{ + Status: ratelimitV1.RateLimitDescription_STATUS_EMPTY, }, }, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go index c0791eda..c8f67d9b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go @@ -1,3 +1,3 @@ package sdk -const Version = "v0.3.29" +const Version = "v0.4.1" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/session/README.md b/vendor/github.com/conductorone/baton-sdk/pkg/session/README.md new file mode 100644 index 00000000..e6ffee5d --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/session/README.md @@ -0,0 +1,14 @@ +# Session Cache Implementation + +This package provides session cache implementations for the Baton SDK. It includes both in-memory and gRPC-based implementations. + +## Overview + +The session cache is used to store temporary data during sync operations. It provides a key-value store interface with support for: + +- Basic CRUD operations (Get, Set, Delete, Clear) +- Batch operations (GetMany, SetMany) +- Namespace isolation using sync IDs +- Prefix support for key organization +- Context-based configuration +- An implemention will be chosen at runtime (the grpc interface will be used if the build tag is specified). \ No newline at end of file diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/session/grpc_session.go b/vendor/github.com/conductorone/baton-sdk/pkg/session/grpc_session.go new file mode 100644 index 00000000..70b8a868 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/session/grpc_session.go @@ -0,0 +1,373 @@ +//go:build baton_lambda_support + +package session + +import ( + "context" + "crypto/tls" + "crypto/x509" + "fmt" + "io" + "net" + "os" + "strings" + "time" + + v1 "github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1" + "github.com/conductorone/baton-sdk/pkg/sdk" + "github.com/conductorone/baton-sdk/pkg/types" + dpop_grpc "github.com/conductorone/dpop/integrations/dpop_grpc" + "github.com/conductorone/dpop/pkg/dpop" + "github.com/go-jose/go-jose/v4" + "golang.org/x/oauth2" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +// No longer needed since we're reusing existing credentials + +// GRPCSessionCache implements SessionCache interface using gRPC calls to BatonSessionService. +type GRPCSessionCache struct { + client v1.BatonSessionServiceClient +} + +// NewGRPCSessionClient creates a new gRPC session service client using existing DPoP credentials. +// It reuses an existing access token and DPoP key instead of performing a new authentication round. +// It reads the session service address from the BATON_SESSION_SERVICE_ADDR environment variable, +// defaulting to "localhost:50051" if not set. +func NewGRPCSessionClient(ctx context.Context, accessToken string, dpopKey *jose.JSONWebKey, opt ...types.SessionCacheConstructorOption) (v1.BatonSessionServiceClient, error) { + // Apply constructor options + for _, option := range opt { + var err error + ctx, err = option(ctx) + if err != nil { + return nil, err + } + } + + // Get the session service address from environment variable + addr := os.Getenv("BATON_SESSION_SERVICE_ADDR") + if addr == "" { + addr = "localhost:50051" + } + + // Validate the address format + host, port, err := net.SplitHostPort(addr) + if err != nil { + return nil, fmt.Errorf("invalid session service address %q: %w", addr, err) + } + if host == "" { + host = "localhost" + } + if port == "" { + port = "50051" + } + addr = net.JoinHostPort(host, port) + + // Create DPoP proofer using the provided key + proofer, err := dpop.NewProofer(dpopKey) + if err != nil { + return nil, fmt.Errorf("failed to create dpop proofer: %w", err) + } + + // Create a simple token source that returns the existing access token + tokenSource := &staticTokenSource{accessToken: accessToken} + + // Create DPoP credentials using the existing token and key + creds, err := dpop_grpc.NewDPoPCredentials(proofer, tokenSource, host, []dpop.ProofOption{ + dpop.WithValidityDuration(time.Minute * 5), + dpop.WithProofNowFunc(time.Now), + }) + if err != nil { + return nil, fmt.Errorf("failed to create dpop credentials: %w", err) + } + + // Create TLS transport credentials + systemCertPool, err := x509.SystemCertPool() + if err != nil || systemCertPool == nil { + return nil, fmt.Errorf("failed to load system cert pool: %w", err) + } + transportCreds := credentials.NewTLS(&tls.Config{ + RootCAs: systemCertPool, + MinVersion: tls.VersionTLS12, + }) + + // Create dial options + dialOpts := []grpc.DialOption{ + grpc.WithTransportCredentials(transportCreds), + grpc.WithUserAgent(fmt.Sprintf("baton-session/%s", sdk.Version)), + grpc.WithPerRPCCredentials(creds), + } + + // Create the gRPC connection + conn, err := grpc.DialContext(ctx, addr, dialOpts...) //nolint:staticcheck // grpc.DialContext is deprecated but we are using it still. + if err != nil { + return nil, fmt.Errorf("failed to connect to session service at %s: %w", addr, err) + } + + return v1.NewBatonSessionServiceClient(conn), nil +} + +// staticTokenSource implements oauth2.TokenSource to return a static access token +type staticTokenSource struct { + accessToken string +} + +func (s *staticTokenSource) Token() (*oauth2.Token, error) { + return &oauth2.Token{ + AccessToken: s.accessToken, + TokenType: "DPoP", + }, nil +} + +// These functions are no longer needed since we're reusing existing credentials + +// NewGRPCSessionCache creates a new gRPC session cache instance. +func NewGRPCSessionCache(ctx context.Context, client v1.BatonSessionServiceClient, opt ...types.SessionCacheConstructorOption) (types.SessionCache, error) { + // Apply constructor options + for _, option := range opt { + var err error + ctx, err = option(ctx) + if err != nil { + return nil, err + } + } + + return &GRPCSessionCache{ + client: client, + }, nil +} + +// Get retrieves a value from the cache by key. +func (g *GRPCSessionCache) Get(ctx context.Context, key string, opt ...types.SessionCacheOption) ([]byte, bool, error) { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return nil, false, err + } + + if bag.Prefix != "" { + key = bag.Prefix + KeyPrefixDelimiter + key + } + + req := &v1.GetRequest{ + SyncId: bag.SyncID, + Key: key, + } + + resp, err := g.client.Get(ctx, req) + if err != nil { + return nil, false, fmt.Errorf("failed to get value from gRPC session cache: %w", err) + } + + if resp == nil { + return nil, false, nil + } + + return resp.Value, true, nil +} + +// GetMany retrieves multiple values from the cache by keys. +func (g *GRPCSessionCache) GetMany(ctx context.Context, keys []string, opt ...types.SessionCacheOption) (map[string][]byte, error) { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return nil, err + } + + // Apply prefix to keys if specified + prefixedKeys := make([]string, len(keys)) + for i, key := range keys { + if bag.Prefix != "" { + prefixedKeys[i] = bag.Prefix + KeyPrefixDelimiter + key + } else { + prefixedKeys[i] = key + } + } + + req := &v1.GetManyRequest{ + SyncId: bag.SyncID, + Keys: prefixedKeys, + } + + stream, err := g.client.GetMany(ctx, req) + if err != nil { + return nil, fmt.Errorf("failed to get many values from gRPC session cache: %w", err) + } + + result := make(map[string][]byte) + for { + resp, err := stream.Recv() + if err == io.EOF { + break + } + if err != nil { + return nil, fmt.Errorf("failed to get many values from gRPC session cache: %w", err) + } + if bag.Prefix != "" { + resp.Key = strings.TrimPrefix(resp.Key, bag.Prefix+KeyPrefixDelimiter) + } + result[resp.Key] = resp.Value + } + + return result, nil +} + +// Set stores a value in the cache with the given key. +func (g *GRPCSessionCache) Set(ctx context.Context, key string, value []byte, opt ...types.SessionCacheOption) error { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + + if bag.Prefix != "" { + key = bag.Prefix + KeyPrefixDelimiter + key + } + + req := &v1.SetRequest{ + SyncId: bag.SyncID, + Key: key, + Value: value, + } + + _, err = g.client.Set(ctx, req) + if err != nil { + return fmt.Errorf("failed to set value in gRPC session cache: %w", err) + } + + return nil +} + +// SetMany stores multiple values in the cache. +func (g *GRPCSessionCache) SetMany(ctx context.Context, values map[string][]byte, opt ...types.SessionCacheOption) error { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + + // Apply prefix to keys if specified + prefixedValues := make(map[string][]byte) + for key, value := range values { + if bag.Prefix != "" { + prefixedValues[bag.Prefix+KeyPrefixDelimiter+key] = value + } else { + prefixedValues[key] = value + } + } + + req := &v1.SetManyRequest{ + SyncId: bag.SyncID, + Values: prefixedValues, + } + + _, err = g.client.SetMany(ctx, req) + if err != nil { + return fmt.Errorf("failed to set many values in gRPC session cache: %w", err) + } + + return nil +} + +// Delete removes a value from the cache by key. +func (g *GRPCSessionCache) Delete(ctx context.Context, key string, opt ...types.SessionCacheOption) error { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + + if bag.Prefix != "" { + key = bag.Prefix + KeyPrefixDelimiter + key + } + + req := &v1.DeleteRequest{ + SyncId: bag.SyncID, + Key: key, + } + + _, err = g.client.Delete(ctx, req) + if err != nil { + return fmt.Errorf("failed to delete value from gRPC session cache: %w", err) + } + + return nil +} + +// Clear removes all values from the cache. +func (g *GRPCSessionCache) Clear(ctx context.Context, opt ...types.SessionCacheOption) error { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + + req := &v1.ClearRequest{ + SyncId: bag.SyncID, + } + + _, err = g.client.Clear(ctx, req) + if err != nil { + return fmt.Errorf("failed to clear gRPC session cache: %w", err) + } + + return nil +} + +// GetAll returns all key-value pairs. +// Note: The gRPC service doesn't have a GetAll method, so we'll need to implement this +// by getting all keys first and then using GetMany. This is a limitation of the current +// gRPC service definition. +func (g *GRPCSessionCache) GetAll(ctx context.Context, opt ...types.SessionCacheOption) (map[string][]byte, error) { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return nil, err + } + + if bag.Prefix != "" { + return nil, fmt.Errorf("prefix is not supported for GetAll in gRPC session cache") + } + + result := make(map[string][]byte) + + pageToken := "" + for { + req := &v1.GetAllRequest{ + SyncId: bag.SyncID, + PageToken: pageToken, + } + + stream, err := g.client.GetAll(ctx, req) + if err != nil { + return nil, fmt.Errorf("failed to get all values from gRPC session cache: %w", err) + } + + nextToken := "" + for { + resp, err := stream.Recv() + if err == io.EOF { + break + } + if err != nil { + return nil, fmt.Errorf("failed to get all values from gRPC session cache: %w", err) + } + + if resp.NextPageToken != "" { + nextToken = resp.NextPageToken + } + + key := resp.Key + if key != "" { + result[key] = resp.Value + } + } + + if nextToken == "" { + break + } + pageToken = nextToken + } + + return result, nil +} + +// Close performs any necessary cleanup when the cache is no longer needed. +func (g *GRPCSessionCache) Close(ctx context.Context) error { + // No cleanup needed for gRPC client + return nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/session/json.go b/vendor/github.com/conductorone/baton-sdk/pkg/session/json.go new file mode 100644 index 00000000..285bbac3 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/session/json.go @@ -0,0 +1,136 @@ +package session + +import ( + "context" + "encoding/json" + + "github.com/conductorone/baton-sdk/pkg/types" +) + +func GetManyJSON[T any](ctx context.Context, keys []string, opt ...types.SessionCacheOption) (map[string]T, error) { + cache, err := GetSession(ctx) + if err != nil { + return nil, err + } + + // Get the raw bytes from cache + rawMap, err := cache.GetMany(ctx, keys, opt...) + if err != nil { + return nil, err + } + result := make(map[string]T) + // Unmarshal each item to the generic type + for key, bytes := range rawMap { + var item T + err = json.Unmarshal(bytes, &item) + if err != nil { + return nil, err + } + result[key] = item + } + + return result, nil +} + +func SetManyJSON[T any](ctx context.Context, items map[string]T, opt ...types.SessionCacheOption) error { + cache, err := GetSession(ctx) + if err != nil { + return err + } + + // Marshal each item to JSON bytes + bytesMap := make(map[string][]byte) + for key, item := range items { + bytes, err := json.Marshal(item) + if err != nil { + return err + } + bytesMap[key] = bytes + } + + // Store in cache + return cache.SetMany(ctx, bytesMap, opt...) +} + +func GetJSON[T any](ctx context.Context, key string, opt ...types.SessionCacheOption) (T, bool, error) { + var zero T + cache, err := GetSession(ctx) + if err != nil { + return zero, false, err + } + + // Get the raw bytes from cache + bytes, found, err := cache.Get(ctx, key, opt...) + if err != nil || !found { + return zero, found, err + } + + // Unmarshal to the generic type + var item T + err = json.Unmarshal(bytes, &item) + if err != nil { + return zero, false, err + } + + return item, true, nil +} + +func SetJSON[T any](ctx context.Context, key string, item T, opt ...types.SessionCacheOption) error { + cache, err := GetSession(ctx) + if err != nil { + return err + } + + // Marshal the item to JSON bytes + bytes, err := json.Marshal(item) + if err != nil { + return err + } + + // Store in cache + return cache.Set(ctx, key, bytes, opt...) +} + +func DeleteJSON(ctx context.Context, key string, opt ...types.SessionCacheOption) error { + cache, err := GetSession(ctx) + if err != nil { + return err + } + + return cache.Delete(ctx, key, opt...) +} + +func ClearJSON(ctx context.Context, opt ...types.SessionCacheOption) error { + cache, err := GetSession(ctx) + if err != nil { + return err + } + + return cache.Clear(ctx, opt...) +} + +func GetAllJSON[T any](ctx context.Context, opt ...types.SessionCacheOption) (map[string]T, error) { + cache, err := GetSession(ctx) + if err != nil { + return nil, err + } + + // Get all raw bytes from cache + rawMap, err := cache.GetAll(ctx, opt...) + if err != nil { + return nil, err + } + + result := make(map[string]T) + // Unmarshal each item to the generic type + for key, bytes := range rawMap { + var item T + err = json.Unmarshal(bytes, &item) + if err != nil { + return nil, err + } + result[key] = item + } + + return result, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/session/memory.go b/vendor/github.com/conductorone/baton-sdk/pkg/session/memory.go new file mode 100644 index 00000000..6aa5a4b5 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/session/memory.go @@ -0,0 +1,220 @@ +package session + +import ( + "context" + "fmt" + "strings" + "sync" + "time" + + "github.com/conductorone/baton-sdk/pkg/types" +) + +// MemorySessionCache implements SessionCache interface using an in-memory store with TTL. +type MemorySessionCache struct { + cache map[string]map[string][]byte // syncID -> key -> value + mu sync.RWMutex + defaultTTL time.Duration +} + +// NewMemorySessionCache creates a new in-memory session cache with default TTL of 1 hour. +func NewMemorySessionCache(ctx context.Context, opt ...types.SessionCacheConstructorOption) (types.SessionCache, error) { + return NewMemorySessionCacheWithTTL(ctx, time.Hour, opt...) +} + +// NewMemorySessionCacheWithTTL creates a new in-memory session cache with custom TTL. +func NewMemorySessionCacheWithTTL(ctx context.Context, ttl time.Duration, opt ...types.SessionCacheConstructorOption) (types.SessionCache, error) { + // Apply constructor options + for _, option := range opt { + var err error + ctx, err = option(ctx) + if err != nil { + return nil, err + } + } + + return &MemorySessionCache{ + cache: make(map[string]map[string][]byte), + defaultTTL: ttl, + }, nil +} + +// Get retrieves a value from the cache by key. +func (m *MemorySessionCache) Get(ctx context.Context, key string, opt ...types.SessionCacheOption) ([]byte, bool, error) { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return nil, false, err + } + + if bag.Prefix != "" { + key = bag.Prefix + KeyPrefixDelimiter + key + } + + m.mu.RLock() + defer m.mu.RUnlock() + + syncCache, ok := m.cache[bag.SyncID] + if !ok { + return nil, false, nil + } + + value, found := syncCache[key] + if !found { + return nil, false, nil + } + dst := make([]byte, len(value)) // allocate destination + _ = copy(dst, value) + return dst, true, nil +} + +// Set stores a value in the cache with the given key. +func (m *MemorySessionCache) Set(ctx context.Context, key string, value []byte, opt ...types.SessionCacheOption) error { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + + if bag.Prefix != "" { + key = bag.Prefix + KeyPrefixDelimiter + key + } + + m.mu.Lock() + defer m.mu.Unlock() + + // Get or create the sync cache + syncCache, ok := m.cache[bag.SyncID] + if !ok { + syncCache = make(map[string][]byte) + m.cache[bag.SyncID] = syncCache + } + + syncCache[key] = value + return nil +} + +// Delete removes a value from the cache by key. +func (m *MemorySessionCache) Delete(ctx context.Context, key string, opt ...types.SessionCacheOption) error { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + m.mu.Lock() + defer m.mu.Unlock() + + if bag.Prefix != "" { + key = bag.Prefix + KeyPrefixDelimiter + key + } + + syncCache, ok := m.cache[bag.SyncID] + if ok { + delete(syncCache, key) + } + return nil +} + +// Clear removes all values from the cache. +func (m *MemorySessionCache) Clear(ctx context.Context, opt ...types.SessionCacheOption) error { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + + m.mu.Lock() + defer m.mu.Unlock() + + delete(m.cache, bag.SyncID) + return nil +} + +// GetAll returns all key-value pairs. +func (m *MemorySessionCache) GetAll(ctx context.Context, opt ...types.SessionCacheOption) (map[string][]byte, error) { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return nil, err + } + + if bag.Prefix != "" { + return nil, fmt.Errorf("prefix is not supported for GetAll in memory session cache") + } + + m.mu.RLock() + defer m.mu.RUnlock() + + syncCache, ok := m.cache[bag.SyncID] + if !ok { + return map[string][]byte{}, nil + } + + result := make(map[string][]byte) + for key, value := range syncCache { + dst := make([]byte, len(value)) // allocate destination + _ = copy(dst, value) + result[key] = dst + } + return result, nil +} + +// GetMany retrieves multiple values from the cache by keys. +func (m *MemorySessionCache) GetMany(ctx context.Context, keys []string, opt ...types.SessionCacheOption) (map[string][]byte, error) { + bag, err := applyOptions(ctx, opt...) + if err != nil { + return nil, err + } + + m.mu.RLock() + defer m.mu.RUnlock() + + syncCache, ok := m.cache[bag.SyncID] + if !ok { + return map[string][]byte{}, nil + } + + result := make(map[string][]byte) + for _, key := range keys { + if value, found := syncCache[key]; found { + k := strings.TrimPrefix(key, bag.Prefix+KeyPrefixDelimiter) + dst := make([]byte, len(value)) // allocate destination + _ = copy(dst, value) + result[k] = dst + } + } + + return result, nil +} + +// SetMany stores multiple values in the cache. +func (m *MemorySessionCache) SetMany(ctx context.Context, values map[string][]byte, opt ...types.SessionCacheOption) error { + // Apply options to get syncID + bag, err := applyOptions(ctx, opt...) + if err != nil { + return err + } + + m.mu.Lock() + defer m.mu.Unlock() + + // Get or create the sync cache + syncCache, ok := m.cache[bag.SyncID] + if !ok { + syncCache = make(map[string][]byte) + m.cache[bag.SyncID] = syncCache + } + + for key, value := range values { + if bag.Prefix != "" { + key = bag.Prefix + KeyPrefixDelimiter + key + } + syncCache[key] = value + } + + return nil +} + +// Close performs any necessary cleanup when the cache is no longer needed. +func (m *MemorySessionCache) Close(ctx context.Context) error { + m.mu.Lock() + defer m.mu.Unlock() + // Clear all data + m.cache = make(map[string]map[string][]byte) + return nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/session/session.go b/vendor/github.com/conductorone/baton-sdk/pkg/session/session.go new file mode 100644 index 00000000..92ee1bfc --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/session/session.go @@ -0,0 +1,63 @@ +package session + +import ( + "context" + "fmt" + + "github.com/conductorone/baton-sdk/pkg/types" +) + +// KeyPrefixDelimiter is the delimiter used to separate prefixes from keys in the session cache. +const KeyPrefixDelimiter = "::" + +// GetSession retrieves the session cache instance from the context. +// Returns an error if no session cache is found in the context. +func GetSession(ctx context.Context) (types.SessionCache, error) { + if sessionCache, ok := ctx.Value(types.SessionCacheKey{}).(types.SessionCache); ok { + return sessionCache, nil + } + return nil, fmt.Errorf("no session cache found in context") +} + +func WithSyncID(syncID string) types.SessionCacheOption { + return func(ctx context.Context, bag *types.SessionCacheBag) error { + bag.SyncID = syncID + return nil + } +} + +func WithPrefix(prefix string) types.SessionCacheOption { + return func(ctx context.Context, bag *types.SessionCacheBag) error { + bag.Prefix = prefix + return nil + } +} + +// GetSyncIDFromContext retrieves the sync ID from the context, returning empty string if not found. +func GetSyncIDFromContext(ctx context.Context) string { + if syncID, ok := ctx.Value(types.SyncIDKey{}).(string); ok { + return syncID + } + return "" +} + +// applyOptions applies session cache options and returns a configured bag. +func applyOptions(ctx context.Context, opt ...types.SessionCacheOption) (*types.SessionCacheBag, error) { + bag := &types.SessionCacheBag{} + + for _, option := range opt { + err := option(ctx, bag) + if err != nil { + return nil, err + } + } + + if bag.SyncID == "" { + bag.SyncID = GetSyncIDFromContext(ctx) + } + if bag.SyncID == "" { + return nil, fmt.Errorf("no syncID set on context or in options") + } + + return bag, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/client_wrapper.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/client_wrapper.go new file mode 100644 index 00000000..bdfdfd46 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/client_wrapper.go @@ -0,0 +1,223 @@ +package sync + +import ( + "context" + "reflect" + + connectorV2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "github.com/conductorone/baton-sdk/pkg/annotations" + "github.com/conductorone/baton-sdk/pkg/types" + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/anypb" +) + +// syncIDClientWrapper wraps a ConnectorClient to add syncID to annotations in requests, +// to be used by the Session Manager. +type syncIDClientWrapper struct { + types.ConnectorClient // Embed the original client + syncID string +} + +// ensure syncIDClientWrapper implements types.ConnectorClient. +var _ types.ConnectorClient = (*syncIDClientWrapper)(nil) + +// requestWithAnnotations is an interface that all request types implement. +type requestWithAnnotations interface { + GetAnnotations() []*anypb.Any +} + +// addSyncIDToRequest adds syncID to the annotations of a request. +func (w *syncIDClientWrapper) addSyncIDToRequest(req requestWithAnnotations) { + if req == nil || w.syncID == "" { + return + } + + // Get current annotations + currentAnnotations := req.GetAnnotations() + if currentAnnotations == nil { + currentAnnotations = []*anypb.Any{} + } + + // Create ActiveSync annotation + activeSync := &connectorV2.ActiveSync{ + Id: w.syncID, + } + + // Add the ActiveSync annotation + annos := annotations.Annotations(currentAnnotations) + annos.Update(activeSync) + + // Use reflection to set the Annotations field since the interface only provides a getter + reqValue := reflect.ValueOf(req) + if reqValue.Kind() == reflect.Ptr { + reqValue = reqValue.Elem() + } + + annotationsField := reqValue.FieldByName("Annotations") + if annotationsField.IsValid() { + annotationsField.Set(reflect.ValueOf([]*anypb.Any(annos))) + } +} + +// Only override methods that have requests with annotations. +func (w *syncIDClientWrapper) ListResourceTypes( + ctx context.Context, + in *connectorV2.ResourceTypesServiceListResourceTypesRequest, + opts ...grpc.CallOption, +) (*connectorV2.ResourceTypesServiceListResourceTypesResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListResourceTypes(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) ListResources( + ctx context.Context, + in *connectorV2.ResourcesServiceListResourcesRequest, + opts ...grpc.CallOption, +) (*connectorV2.ResourcesServiceListResourcesResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListResources(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) GetResource( + ctx context.Context, + in *connectorV2.ResourceGetterServiceGetResourceRequest, + opts ...grpc.CallOption, +) (*connectorV2.ResourceGetterServiceGetResourceResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.GetResource(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) ListEntitlements( + ctx context.Context, + in *connectorV2.EntitlementsServiceListEntitlementsRequest, + opts ...grpc.CallOption, +) (*connectorV2.EntitlementsServiceListEntitlementsResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListEntitlements(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) ListGrants( + ctx context.Context, + in *connectorV2.GrantsServiceListGrantsRequest, + opts ...grpc.CallOption, +) (*connectorV2.GrantsServiceListGrantsResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListGrants(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) Grant( + ctx context.Context, + in *connectorV2.GrantManagerServiceGrantRequest, + opts ...grpc.CallOption, +) (*connectorV2.GrantManagerServiceGrantResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.Grant(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) Revoke( + ctx context.Context, + in *connectorV2.GrantManagerServiceRevokeRequest, + opts ...grpc.CallOption, +) (*connectorV2.GrantManagerServiceRevokeResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.Revoke(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) ListEventFeeds( + ctx context.Context, + in *connectorV2.ListEventFeedsRequest, + opts ...grpc.CallOption, +) (*connectorV2.ListEventFeedsResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListEventFeeds(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) ListEvents( + ctx context.Context, + in *connectorV2.ListEventsRequest, + opts ...grpc.CallOption, +) (*connectorV2.ListEventsResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListEvents(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) ListActionSchemas( + ctx context.Context, + in *connectorV2.ListActionSchemasRequest, + opts ...grpc.CallOption, +) (*connectorV2.ListActionSchemasResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListActionSchemas(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) GetActionSchema( + ctx context.Context, + in *connectorV2.GetActionSchemaRequest, + opts ...grpc.CallOption, +) (*connectorV2.GetActionSchemaResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.GetActionSchema(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) InvokeAction( + ctx context.Context, + in *connectorV2.InvokeActionRequest, + opts ...grpc.CallOption, +) (*connectorV2.InvokeActionResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.InvokeAction(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) GetActionStatus( + ctx context.Context, + in *connectorV2.GetActionStatusRequest, + opts ...grpc.CallOption, +) (*connectorV2.GetActionStatusResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.GetActionStatus(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) CreateTicket( + ctx context.Context, + in *connectorV2.TicketsServiceCreateTicketRequest, + opts ...grpc.CallOption, +) (*connectorV2.TicketsServiceCreateTicketResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.CreateTicket(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) GetTicket( + ctx context.Context, + in *connectorV2.TicketsServiceGetTicketRequest, + opts ...grpc.CallOption, +) (*connectorV2.TicketsServiceGetTicketResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.GetTicket(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) GetTicketSchema( + ctx context.Context, + in *connectorV2.TicketsServiceGetTicketSchemaRequest, + opts ...grpc.CallOption, +) (*connectorV2.TicketsServiceGetTicketSchemaResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.GetTicketSchema(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) ListTicketSchemas( + ctx context.Context, + in *connectorV2.TicketsServiceListTicketSchemasRequest, + opts ...grpc.CallOption, +) (*connectorV2.TicketsServiceListTicketSchemasResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.ListTicketSchemas(ctx, in, opts...) +} + +func (w *syncIDClientWrapper) Cleanup( + ctx context.Context, + in *connectorV2.ConnectorServiceCleanupRequest, + opts ...grpc.CallOption, +) (*connectorV2.ConnectorServiceCleanupResponse, error) { + w.addSyncIDToRequest(in) + return w.ConnectorClient.Cleanup(ctx, in, opts...) +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/cycle.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/cycle.go index 867cd6fb..52e2ba4c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/cycle.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/cycle.go @@ -1,58 +1,116 @@ package expand import ( + "context" + + "github.com/conductorone/baton-sdk/pkg/sync/expand/scc" mapset "github.com/deckarep/golang-set/v2" ) // GetFirstCycle given an entitlements graph, return a cycle by node ID if it // exists. Returns nil if no cycle exists. If there is a single // node pointing to itself, that will count as a cycle. -func (g *EntitlementGraph) GetFirstCycle() []int { +func (g *EntitlementGraph) GetFirstCycle(ctx context.Context) []int { if g.HasNoCycles { return nil } - visited := mapset.NewSet[int]() - for nodeID := range g.Nodes { - cycle, hasCycle := g.cycleDetectionHelper(nodeID, visited, []int{}) - if hasCycle { - return cycle - } + comps, _ := g.ComputeCyclicComponents(ctx) + if len(comps) == 0 { + return nil } + return comps[0] +} - return nil +// HasCycles returns true if the graph contains any cycle. +func (g *EntitlementGraph) HasCycles(ctx context.Context) bool { + if g.HasNoCycles { + return false + } + comps, _ := g.ComputeCyclicComponents(ctx) + return len(comps) > 0 } func (g *EntitlementGraph) cycleDetectionHelper( + ctx context.Context, nodeID int, - visited mapset.Set[int], - currentCycle []int, ) ([]int, bool) { - visited.Add(nodeID) - if destinations, ok := g.SourcesToDestinations[nodeID]; ok { - for destinationID := range destinations { - nextCycle := make([]int, len(currentCycle)) - copy(nextCycle, currentCycle) - nextCycle = append(nextCycle, nodeID) - - if !visited.Contains(destinationID) { - if cycle, hasCycle := g.cycleDetectionHelper(destinationID, visited, nextCycle); hasCycle { - return cycle, true - } - } else { - // Make sure to not include part of the start before the cycle. - outputCycle := make([]int, 0) - for i := len(nextCycle) - 1; i >= 0; i-- { - outputCycle = append(outputCycle, nextCycle[i]) - if nextCycle[i] == destinationID { - return outputCycle, true - } - } - } + reach := g.reachableFrom(nodeID) + if len(reach) == 0 { + return nil, false + } + fg := filteredGraph{g: g, include: func(id int) bool { _, ok := reach[id]; return ok }} + groups, _ := scc.CondenseFWBW(ctx, fg, scc.DefaultOptions()) + for _, comp := range groups { + if len(comp) > 1 || (len(comp) == 1 && g.hasSelfLoop(comp[0])) { + return comp, true } } return nil, false } +func (g *EntitlementGraph) FixCycles(ctx context.Context) error { + comps, _ := g.ComputeCyclicComponents(ctx) + return g.FixCyclesFromComponents(ctx, comps) +} + +// ComputeCyclicComponents runs SCC once and returns only cyclic components. +// A component is cyclic if len>1 or a singleton with a self-loop. +func (g *EntitlementGraph) ComputeCyclicComponents(ctx context.Context) ([][]int, *scc.Metrics) { + if g.HasNoCycles { + return nil, nil + } + groups, metrics := scc.CondenseFWBW(ctx, g, scc.DefaultOptions()) + cyclic := make([][]int, 0) + for _, comp := range groups { + if len(comp) > 1 || (len(comp) == 1 && g.hasSelfLoop(comp[0])) { + cyclic = append(cyclic, comp) + } + } + return cyclic, metrics +} + +// hasSelfLoop reports whether a node has a self-edge. +func (g *EntitlementGraph) hasSelfLoop(id int) bool { + if row, ok := g.SourcesToDestinations[id]; ok { + _, ok := row[id] + return ok + } + return false +} + +// filteredGraph restricts EntitlementGraph iteration to nodes for which include(id) is true. +type filteredGraph struct { + g *EntitlementGraph + include func(int) bool +} + +func (fg filteredGraph) ForEachNode(fn func(id int) bool) { + for id := range fg.g.Nodes { + if fg.include != nil && !fg.include(id) { + continue + } + if !fn(id) { + return + } + } +} + +func (fg filteredGraph) ForEachEdgeFrom(src int, fn func(dst int) bool) { + if fg.include != nil && !fg.include(src) { + return + } + if dsts, ok := fg.g.SourcesToDestinations[src]; ok { + for dst := range dsts { + if fg.include != nil && !fg.include(dst) { + continue + } + if !fn(dst) { + return + } + } + } +} + // removeNode obliterates a node and all incoming/outgoing edges. func (g *EntitlementGraph) removeNode(nodeID int) { // Delete from reverse mapping. @@ -87,30 +145,33 @@ func (g *EntitlementGraph) removeNode(nodeID int) { delete(g.SourcesToDestinations, nodeID) } -// FixCycles if any cycles of nodes exist, merge all nodes in that cycle into a -// single node and then repeat. Iteration ends when there are no more cycles. -func (g *EntitlementGraph) FixCycles() error { +// FixCyclesFromComponents merges all provided cyclic components in one pass. +func (g *EntitlementGraph) FixCyclesFromComponents(ctx context.Context, cyclic [][]int) error { if g.HasNoCycles { return nil } - cycle := g.GetFirstCycle() - if cycle == nil { + if len(cyclic) == 0 { g.HasNoCycles = true return nil } - - if err := g.fixCycle(cycle); err != nil { - return err + for _, comp := range cyclic { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + if err := g.fixCycle(comp); err != nil { + return err + } } - - // Recurse! - return g.FixCycles() + g.HasNoCycles = true + return nil } // fixCycle takes a list of Node IDs that form a cycle and merges them into a // single, new node. func (g *EntitlementGraph) fixCycle(nodeIDs []int) error { - entitlementIDs := mapset.NewSet[string]() + entitlementIDs := mapset.NewThreadUnsafeSet[string]() outgoingEdgesToResourceTypeIDs := map[int]mapset.Set[string]{} incomingEdgesToResourceTypeIDs := map[int]mapset.Set[string]{} for _, nodeID := range nodeIDs { @@ -126,7 +187,7 @@ func (g *EntitlementGraph) fixCycle(nodeIDs []int) error { if edge, ok := g.Edges[edgeID]; ok { resourceTypeIDs, ok := incomingEdgesToResourceTypeIDs[sourceNodeID] if !ok { - resourceTypeIDs = mapset.NewSet[string]() + resourceTypeIDs = mapset.NewThreadUnsafeSet[string]() } for _, resourceTypeID := range edge.ResourceTypeIDs { resourceTypeIDs.Add(resourceTypeID) @@ -142,7 +203,7 @@ func (g *EntitlementGraph) fixCycle(nodeIDs []int) error { if edge, ok := g.Edges[edgeID]; ok { resourceTypeIDs, ok := outgoingEdgesToResourceTypeIDs[destinationNodeID] if !ok { - resourceTypeIDs = mapset.NewSet[string]() + resourceTypeIDs = mapset.NewThreadUnsafeSet[string]() } for _, resourceTypeID := range edge.ResourceTypeIDs { resourceTypeIDs.Add(resourceTypeID) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/graph.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/graph.go index 8696b6d4..ef7d9850 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/graph.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/graph.go @@ -4,6 +4,7 @@ import ( "context" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "github.com/conductorone/baton-sdk/pkg/sync/expand/scc" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.uber.org/zap" ) @@ -309,3 +310,58 @@ func (g *EntitlementGraph) DeleteEdge(ctx context.Context, srcEntitlementID stri } return nil } + +// toAdjacency builds an adjacency map for SCC. If nodesSubset is non-nil, only +// include those nodes (and edges between them). Always include all nodes in the +// subset as keys, even if they have zero outgoing edges. +// toAdjacency removed: use SCC via scc.Source on EntitlementGraph + +var _ scc.Source = (*EntitlementGraph)(nil) + +// ForEachNode implements scc.Source iteration over nodes (including isolated nodes). +// It does not import scc; matching the method names/signatures is sufficient. +func (g *EntitlementGraph) ForEachNode(fn func(id int) bool) { + for id := range g.Nodes { + if !fn(id) { + return + } + } +} + +// ForEachEdgeFrom implements scc.Source iteration of outgoing edges for src. +// It enumerates unique destination node IDs. +func (g *EntitlementGraph) ForEachEdgeFrom(src int, fn func(dst int) bool) { + if dsts, ok := g.SourcesToDestinations[src]; ok { + for dst := range dsts { + if !fn(dst) { + return + } + } + } +} + +// reachableFrom computes the set of node IDs reachable from start over +// SourcesToDestinations using an iterative BFS. +func (g *EntitlementGraph) reachableFrom(start int) map[int]struct{} { + if _, ok := g.Nodes[start]; !ok { + return nil + } + visited := make(map[int]struct{}, 16) + queue := make([]int, 0, 16) + queue = append(queue, start) + visited[start] = struct{}{} + for len(queue) > 0 { + u := queue[0] + queue = queue[1:] + if nbrs, ok := g.SourcesToDestinations[u]; ok { + for v := range nbrs { + if _, seen := visited[v]; seen { + continue + } + visited[v] = struct{}{} + queue = append(queue, v) + } + } + } + return visited +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/bitset.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/bitset.go new file mode 100644 index 00000000..33c910f8 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/bitset.go @@ -0,0 +1,131 @@ +package scc + +import ( + "math/bits" + "sync/atomic" +) + +// bitset is a packed, atomically updatable bitset. +// +// Concurrency notes: +// - Only testAndSetAtomic and clearAtomic are safe concurrently. +// - All other methods must not race with writers. +// - Slice storage aligns on 64-bit boundaries for atomic ops. +type bitset struct{ w []uint64 } + +func newBitset(n int) *bitset { + if n <= 0 { + return &bitset{} + } + return &bitset{w: make([]uint64, (n+63)>>6)} +} + +func (b *bitset) test(i int) bool { + if i < 0 { + return false + } + w := i >> 6 + if w >= len(b.w) { + return false + } + return (b.w[w] & (1 << (uint(i) & 63))) != 0 +} + +// set sets the bit at index i. +func (b *bitset) set(i int) { + if i < 0 { + return + } + w := i >> 6 + if w >= len(b.w) { + return + } + b.w[w] |= 1 << (uint(i) & 63) +} + +// testAndSetAtomic sets the bit at index i and returns true if the bit was already set, false otherwise. +func (b *bitset) testAndSetAtomic(i int) bool { + if i < 0 { + return false + } + w := i >> 6 + if w >= len(b.w) { + return false + } + mask := uint64(1) << (uint(i) & 63) + addr := &b.w[w] + for { + old := atomic.LoadUint64(addr) + if old&mask != 0 { + return true + } + if atomic.CompareAndSwapUint64(addr, old, old|mask) { + return false + } + } +} + +func (b *bitset) clearAtomic(i int) { + if i < 0 { + return + } + w := i >> 6 + if w >= len(b.w) { + return + } + mask := ^(uint64(1) << (uint(i) & 63)) + addr := &b.w[w] + for { + old := atomic.LoadUint64(addr) + if atomic.CompareAndSwapUint64(addr, old, old&mask) { + return + } + } +} + +func (b *bitset) clone() *bitset { + cp := &bitset{w: make([]uint64, len(b.w))} + copy(cp.w, b.w) + return cp +} + +func (b *bitset) and(x *bitset) *bitset { + for i := range b.w { + b.w[i] &= x.w[i] + } + return b +} + +func (b *bitset) or(x *bitset) *bitset { + for i := range b.w { + b.w[i] |= x.w[i] + } + return b +} + +func (b *bitset) andNot(x *bitset) *bitset { + for i := range b.w { + b.w[i] &^= x.w[i] + } + return b +} + +func (b *bitset) isEmpty() bool { + for _, w := range b.w { + if w != 0 { + return false + } + } + return true +} + +func (b *bitset) forEachSet(fn func(i int)) { + for wi, w := range b.w { + for w != 0 { + tz := bits.TrailingZeros64(w) + i := (wi << 6) + tz + fn(i) + w &^= 1 << uint(tz) //nolint:gosec // trailing zeros is non-negative + } + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/scc.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/scc.go new file mode 100644 index 00000000..5059aa72 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/scc.go @@ -0,0 +1,649 @@ +// Package scc provides an iterative FW–BW SCC condensation for directed graphs, +// adapted for Baton’s entitlement graph. It builds an immutable CSR + transpose, +// runs reachability-based SCC with a stack-based driver (no recursion, BFS may +// run in parallel), and returns components as groups of your original node IDs. +package scc + +// Iterative FW–BW SCC condensation for directed graphs. +// +// High-level algorithm: Build CSR + transpose; maintain a LIFO stack of +// subproblems (bitset masks). For each mask: +// 1) Trim sources/sinks repeatedly; each peeled vertex is a singleton SCC. +// 2) Pick a pivot (lowest-index active vertex), run forward/backward BFS +// restricted to the mask to get F and B. +// 3) The SCC is C = F ∩ B. Assign its component id and clear those bits +// from the mask. +// 4) Partition the remaining mask into F\C, B\C, and U = mask \ (F ∪ B), +// and push the non-empty masks onto the stack in a deterministic order. +// +// Parallelism is contained inside BFS (bounded by Options.MaxWorkers) and no +// recursive goroutines are spawned by the driver. Determinism is achieved via +// deterministic CSR construction (sorted ids and neighbors) and by using the +// lowest-index active pivot with a fixed child-push order. + +import ( + "context" + "runtime" + "sort" + "sync" + "time" +) + +// Options controls SCC execution. +// +// MaxWorkers bounds BFS concurrency per level. Deterministic toggles stable +// CSR index assignment and neighbor ordering. +type Options struct { + MaxWorkers int + Deterministic bool +} + +// DefaultOptions returns a sensible baseline. +func DefaultOptions() Options { + return Options{ + MaxWorkers: runtime.GOMAXPROCS(0), + Deterministic: false, + } +} + +// CSR is a compact adjacency for G and its transpose Gᵗ. +// Indices are 0..N-1; IdxToNodeID maps back to the original node IDs. +// +// Invariants (validated by validateCSR): +// - len(Row) == N+1; Row[0] == 0; Row is non-decreasing; Row[N] == len(Col) +// - len(TRow) == N+1; TRow[0] == 0; TRow is non-decreasing; TRow[N] == len(TCol) +// - 0 <= Col[p] < N for all p; 0 <= TCol[p] < N for all p +// - len(IdxToNodeID) == N; NodeIDToIdx[IdxToNodeID[i]] == i for all i +// - For each v, (TRow[v+1]-TRow[v]) equals the number of occurrences of v in Col +// (transpose degree matches inbound counts) +type CSR struct { + N int + Row []int // len N+1 + Col []int // len = m, m = Row[N] + TRow []int // len N+1 + TCol []int // len = m, m = TRow[N] + IdxToNodeID []int // len N +} + +// Source is a minimal read-only graph provider used to build CSR without +// materializing an intermediate adjacency map. It must enumerate all nodes +// (including isolated nodes) and for each node provide its unique outgoing +// destinations. +type Source interface { + ForEachNode(fn func(id int) bool) + ForEachEdgeFrom(src int, fn func(dst int) bool) +} + +// Metrics captures a few summary counters for a condense run. +type Metrics struct { + Nodes int + Edges int + Components int + Peeled int + MasksProcessed int + MasksPushed int + BFScalls int + Duration time.Duration + MaxWorkers int + Deterministic bool +} + +// CondenseFWBW runs SCC directly from a streaming Source. Preferred entry point. +func CondenseFWBW(ctx context.Context, src Source, opts Options) ([][]int, *Metrics) { + if opts.MaxWorkers <= 0 { + opts.MaxWorkers = runtime.GOMAXPROCS(0) + } + start := time.Now() + csr := buildCSRFromSource(src, opts) + metrics := Metrics{ + Nodes: csr.N, + Edges: len(csr.Col), + MaxWorkers: opts.MaxWorkers, + Deterministic: opts.Deterministic, + } + comp := make([]int, csr.N) + for i := range comp { + comp[i] = -1 + } + nextID := sccFWBWIterative(ctx, csr, comp, opts, &metrics) + + groups := make([][]int, nextID) + for idx := range csr.N { + cid := comp[idx] + if cid < 0 { + cid = nextID + nextID++ + comp[idx] = cid + if cid >= len(groups) { + tmp := make([][]int, cid+1) + copy(tmp, groups) + groups = tmp + } + } + groups[cid] = append(groups[cid], csr.IdxToNodeID[idx]) + } + metrics.Components = nextID + metrics.Duration = time.Since(start) + return groups, &metrics +} + +// buildCSRFromSource constructs CSR/transpose from a Source without +// materializing an intermediate adjacency map. If opts.Deterministic, node IDs +// are sorted and per-row neighbors are written in ascending order. +func buildCSRFromSource(src Source, opts Options) *CSR { + // 1) Collect nodes + nodes := make([]int, 0, 1024) + src.ForEachNode(func(id int) bool { + nodes = append(nodes, id) + return true + }) + if opts.Deterministic { + sort.Ints(nodes) + } + id2idx := make(map[int]int, len(nodes)) + for i, id := range nodes { + id2idx[id] = i + } + n := len(nodes) + + // 2) Count out-degrees and total edges + outDeg := make([]int, n) + m := 0 + for i := range n { + srcID := nodes[i] + src.ForEachEdgeFrom(srcID, func(dst int) bool { + j, ok := id2idx[dst] + if !ok { + return true + } + _ = j // only used to validate membership + outDeg[i]++ + m++ + return true + }) + } + + // 3) Allocate Row/Col + row := make([]int, n+1) + for i := range n { + row[i+1] = row[i] + outDeg[i] + } + col := make([]int, m) + cur := make([]int, n) + copy(cur, row) + + // 4) Fill rows + if opts.Deterministic { + for i := range n { + srcID := nodes[i] + neighbors := make([]int, 0, outDeg[i]) + src.ForEachEdgeFrom(srcID, func(dst int) bool { + if j, ok := id2idx[dst]; ok { + neighbors = append(neighbors, j) + } + return true + }) + sort.Ints(neighbors) + off := cur[i] + copy(col[off:off+len(neighbors)], neighbors) + cur[i] += len(neighbors) + } + } else { + for i := range n { + srcID := nodes[i] + src.ForEachEdgeFrom(srcID, func(dst int) bool { + if j, ok := id2idx[dst]; ok { + pos := cur[i] + col[pos] = j + cur[i] = pos + 1 + } + return true + }) + } + } + + // 5) Transpose + inDeg := make([]int, n) + for _, v := range col { + inDeg[v]++ + } + trow := make([]int, n+1) + for i := range n { + trow[i+1] = trow[i] + inDeg[i] + } + tcol := make([]int, m) + tcur := make([]int, n) + copy(tcur, trow) + for u := range n { + start, end := row[u], row[u+1] + for p := start; p < end; p++ { + v := col[p] + pos := tcur[v] + tcol[pos] = u + tcur[v] = pos + 1 + } + } + + csr := &CSR{ + N: n, + Row: row, + Col: col, + TRow: trow, + TCol: tcol, + IdxToNodeID: nodes, + } + validateCSR(csr) + return csr +} + +// validateCSR performs internal consistency checks on CSR and panics +// with a descriptive message when a violation is found. This is intended to +// catch programmer errors at build time and in tests; it runs unconditionally. +func validateCSR(csr *CSR) { + if csr == nil { + panic("scc: CSR is nil") + } + n := csr.N + if n < 0 { + panic("scc: CSR.N is negative") + } + if len(csr.Row) != n+1 { + panic("scc: len(Row) != N+1") + } + if len(csr.TRow) != n+1 { + panic("scc: len(TRow) != N+1") + } + if len(csr.IdxToNodeID) != n { + panic("scc: len(IdxToNodeID) != N") + } + // Row invariants and degree sums + if csr.Row[0] != 0 { + panic("scc: Row[0] != 0") + } + for i := range len(csr.Row) - 1 { + if csr.Row[i] > csr.Row[i+1] { + panic("scc: Row is not non-decreasing") + } + } + m := csr.Row[n] + if m != len(csr.Col) { + panic("scc: Row[N] != len(Col)") + } + // TRow invariants + if csr.TRow[0] != 0 { + panic("scc: TRow[0] != 0") + } + for i := range len(csr.TRow) - 1 { + if csr.TRow[i] > csr.TRow[i+1] { + panic("scc: TRow is not non-decreasing") + } + } + mt := csr.TRow[n] + if mt != len(csr.TCol) { + panic("scc: TRow[N] != len(TCol)") + } + // Col bounds + for p := range len(csr.Col) { + v := csr.Col[p] + if v < 0 || v >= n { + panic("scc: Col index out of range") + } + } + for p := range len(csr.TCol) { + v := csr.TCol[p] + if v < 0 || v >= n { + panic("scc: TCol index out of range") + } + } + // NodeID mapping bijection check removed: CSR does not store NodeIDToIdx. + // Transpose degree equals inbound counts + inDeg := make([]int, n) + for _, v := range csr.Col { + inDeg[v]++ + } + for v := range n { + expected := inDeg[v] + span := csr.TRow[v+1] - csr.TRow[v] + if span != expected { + panic("scc: transpose degree mismatch") + } + } +} + +// bitset moved to bitset.go + +// sccFWBWIterative implements the driver loop described at the top. +func sccFWBWIterative(ctx context.Context, csr *CSR, comp []int, opts Options, metrics *Metrics) int { + nextID := 0 + + // Initialize root mask with all vertices. + root := newBitset(csr.N) + for i := range csr.N { + root.set(i) + } + + type item struct{ mask *bitset } + stack := make([]item, 0, 64) + stack = append(stack, item{mask: root}) + + for len(stack) > 0 { + select { + case <-ctx.Done(): + return nextID + default: + } + + it := stack[len(stack)-1] + stack = stack[:len(stack)-1] + active := it.mask + if metrics != nil { + metrics.MasksProcessed++ + } + + // Trim loop: peel sources/sinks; each peeled vertex becomes its own SCC. + for { + if n := trimSingletons(csr, active, comp, &nextID); n == 0 { + break + } else if metrics != nil { + metrics.Peeled += n + } + if active.isEmpty() { + break + } + } + if active.isEmpty() { + continue + } + + // Pivot and BFS (restricted to active mask). + pivot := firstActive(active) + f := bfsMultiSource(ctx, csr, []int{pivot}, active, false, opts.MaxWorkers) + b := bfsMultiSource(ctx, csr, []int{pivot}, active, true, opts.MaxWorkers) + if metrics != nil { + metrics.BFScalls += 2 + } + + // Component and partition masks. + c := f.clone().and(b) + assignComponent(c, comp, &nextID, active) + + fNotC := f.clone().andNot(c) + bNotC := b.clone().andNot(c) + fOrB := f.clone().or(b) + u := active.clone().andNot(fOrB) + + // assignComponent cleared C from 'active'; child masks are disjoint subsets + // of the original mask. Push children in a fixed order for determinism. + pushes := 0 + if !u.isEmpty() { + stack = append(stack, item{mask: u}) + pushes++ + } + if !bNotC.isEmpty() { + stack = append(stack, item{mask: bNotC}) + pushes++ + } + if !fNotC.isEmpty() { + stack = append(stack, item{mask: fNotC}) + pushes++ + } + if metrics != nil { + metrics.MasksPushed += pushes + } + } + + return nextID +} + +// bfsMultiSource runs a parallel BFS from sources over csr. +// If useTranspose is true, traverses csr.T* arrays. Traversal respects +// 'active' mask; returns visited including sources. +// Cancellation: checks ctx between levels. +func bfsMultiSource(ctx context.Context, csr *CSR, sources []int, active *bitset, useTranspose bool, maxWorkers int) *bitset { + if maxWorkers <= 0 { + maxWorkers = runtime.GOMAXPROCS(0) + } + visited := newBitset(csr.N) + frontier := frontierSeed(sources, active, visited) + if len(frontier) == 0 { + return visited + } + + getRow := func(u int) (int, int) { + if useTranspose { + return csr.TRow[u], csr.TRow[u+1] + } + return csr.Row[u], csr.Row[u+1] + } + getCol := func(p int) int { + if useTranspose { + return csr.TCol[p] + } + return csr.Col[p] + } + + for len(frontier) > 0 { + select { + case <-ctx.Done(): + return visited + default: + } + + workers := min(maxWorkers, len(frontier)) + var wg sync.WaitGroup + wg.Add(workers) + + chunkSize := (len(frontier) + workers - 1) / workers + nextBuckets := make([][]int, workers) + + for w := 0; w < workers; w++ { + start := w * chunkSize + end := start + chunkSize + if start >= len(frontier) { + wg.Done() + continue + } + end = min(end, len(frontier)) + + w := w // capture + go func(start, end int) { + defer wg.Done() + local := make([]int, 0, 256) + for i := start; i < end; i++ { + u := frontier[i] + rs, re := getRow(u) + for p := rs; p < re; p++ { + v := getCol(p) + if !active.test(v) { + continue + } + if !visited.testAndSetAtomic(v) { + local = append(local, v) + } + } + } + nextBuckets[w] = local + }(start, end) + } + wg.Wait() + + total := 0 + for _, b := range nextBuckets { + total += len(b) + } + next := make([]int, total) + off := 0 + for _, b := range nextBuckets { + copy(next[off:], b) + off += len(b) + } + frontier = next + } + + return visited +} + +func frontierSeed(sources []int, active, visited *bitset) []int { + out := make([]int, 0, len(sources)) + for _, s := range sources { + if s < 0 { + continue + } + if !active.test(s) { + continue + } + if visited.testAndSetAtomic(s) { + continue + } + out = append(out, s) + } + return out +} + +func firstActive(active *bitset) int { + pivot := -1 + active.forEachSet(func(i int) { + if pivot == -1 { + pivot = i + } + }) + return pivot +} + +// assignComponent writes comp ids for cMask, and clears those vertices from 'active'. +func assignComponent(cMask *bitset, comp []int, nextID *int, active *bitset) { + if cMask.isEmpty() { + return + } + cid := *nextID + *nextID++ + cMask.forEachSet(func(i int) { + comp[i] = cid + active.clearAtomic(i) + }) +} + +// Degree-array pool for trim to reduce allocations for small graphs. +var ( + intSlicePool sync.Pool // *([]int) +) + +func getIntSlice(n int) []int { + p, _ := intSlicePool.Get().(*[]int) + if p == nil || cap(*p) < n { + return make([]int, n) + } + s := (*p)[:n] + for i := range s { + s[i] = 0 + } + return s +} + +func putIntSlice(s []int) { + // avoid keeping very large slices + if cap(s) > 1<<14 { + return + } + intSlicePool.Put(&s) +} + +// trimSingletons peels vertices with restricted in/out degree within 'active'. +// Each peeled vertex becomes its own SCC id. Returns count peeled. +func trimSingletons(csr *CSR, active *bitset, comp []int, nextID *int) int { + n := csr.N + inDeg := getIntSlice(n) + outDeg := getIntSlice(n) + defer func() { putIntSlice(inDeg); putIntSlice(outDeg) }() + + // Out-degree within active. + for u := range n { + if !active.test(u) { + continue + } + rs, re := csr.Row[u], csr.Row[u+1] + d := 0 + for p := rs; p < re; p++ { + v := csr.Col[p] + if active.test(v) { + d++ + } + } + outDeg[u] = d + } + // In-degree within active (via transpose). + for v := range n { + if !active.test(v) { + continue + } + rs, re := csr.TRow[v], csr.TRow[v+1] + d := 0 + for p := rs; p < re; p++ { + u := csr.TCol[p] + if active.test(u) { + d++ + } + } + inDeg[v] = d + } + + // Initialize queue of zeros. + queue := getIntSlice(0) + defer putIntSlice(queue) + for i := range n { + if !active.test(i) { + continue + } + if inDeg[i] == 0 || outDeg[i] == 0 { + queue = append(queue, i) + } + } + + peeled := 0 + for len(queue) > 0 { + u := queue[len(queue)-1] + queue = queue[:len(queue)-1] + if !active.test(u) { + continue + } + if inDeg[u] > 0 && outDeg[u] > 0 { + continue + } + + // assign and remove u + comp[u] = *nextID + *nextID++ + active.clearAtomic(u) + peeled++ + + // Decrement out-neighbors' inDeg + rs, re := csr.Row[u], csr.Row[u+1] + for p := rs; p < re; p++ { + v := csr.Col[p] + if !active.test(v) { + continue + } + if inDeg[v] > 0 { + inDeg[v]-- + if inDeg[v] == 0 { + queue = append(queue, v) + } + } + } + // Decrement in-neighbors' outDeg + rs, re = csr.TRow[u], csr.TRow[u+1] + for p := rs; p < re; p++ { + w := csr.TCol[p] + if !active.test(w) { + continue + } + if outDeg[w] > 0 { + outDeg[w]-- + if outDeg[w] == 0 { + queue = append(queue, w) + } + } + } + } + return peeled +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/test_source.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/test_source.go new file mode 100644 index 00000000..16b5b244 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/scc/test_source.go @@ -0,0 +1,24 @@ +package scc + +// adjSource adapts a map[int]map[int]int adjacency to the Source interface for tests. +type adjSource struct { + adj map[int]map[int]int +} + +func (a adjSource) ForEachNode(fn func(id int) bool) { + for id := range a.adj { + if !fn(id) { + return + } + } +} + +func (a adjSource) ForEachEdgeFrom(src int, fn func(dst int) bool) { + if row, ok := a.adj[src]; ok { + for dst := range row { + if !fn(dst) { + return + } + } + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go index e8dc6fe6..2cc70186 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go @@ -31,6 +31,8 @@ type State interface { SetHasExternalResourcesGrants() ShouldFetchRelatedResources() bool SetShouldFetchRelatedResources() + ShouldSkipEntitlementsAndGrants() bool + SetShouldSkipEntitlementsAndGrants() } // ActionOp represents a sync operation. @@ -131,24 +133,26 @@ type Action struct { // state is an object used for tracking the current status of a connector sync. It operates like a stack. type state struct { - mtx sync.RWMutex - actions []Action - currentAction *Action - entitlementGraph *expand.EntitlementGraph - needsExpansion bool - hasExternalResourceGrants bool - shouldFetchRelatedResources bool + mtx sync.RWMutex + actions []Action + currentAction *Action + entitlementGraph *expand.EntitlementGraph + needsExpansion bool + hasExternalResourceGrants bool + shouldFetchRelatedResources bool + shouldSkipEntitlementsAndGrants bool } // serializedToken is used to serialize the token to JSON. This separate object is used to avoid having exported fields // on the object used externally. We should interface this, probably. type serializedToken struct { - Actions []Action `json:"actions"` - CurrentAction *Action `json:"current_action"` - NeedsExpansion bool `json:"needs_expansion"` - EntitlementGraph *expand.EntitlementGraph `json:"entitlement_graph"` - HasExternalResourceGrants bool `json:"has_external_resource_grants"` - ShouldFetchRelatedResources bool `json:"should_fetch_related_resources"` + Actions []Action `json:"actions,omitempty"` + CurrentAction *Action `json:"current_action,omitempty"` + NeedsExpansion bool `json:"needs_expansion,omitempty"` + EntitlementGraph *expand.EntitlementGraph `json:"entitlement_graph,omitempty"` + HasExternalResourceGrants bool `json:"has_external_resource_grants,omitempty"` + ShouldFetchRelatedResources bool `json:"should_fetch_related_resources,omitempty"` + ShouldSkipEntitlementsAndGrants bool `json:"should_skip_entitlements_and_grants,omitempty"` } // push adds a new action to the stack. If there is no current state, the action is directly set to current, else @@ -203,8 +207,8 @@ func (st *state) Current() *Action { // Unmarshal takes an input string and unmarshals it onto the state object. If the input is empty, we set the state to // have an init action. func (st *state) Unmarshal(input string) error { - st.mtx.RLock() - defer st.mtx.RUnlock() + st.mtx.Lock() + defer st.mtx.Unlock() token := serializedToken{} @@ -218,6 +222,8 @@ func (st *state) Unmarshal(input string) error { st.currentAction = token.CurrentAction st.needsExpansion = token.NeedsExpansion st.hasExternalResourceGrants = token.HasExternalResourceGrants + st.shouldSkipEntitlementsAndGrants = token.ShouldSkipEntitlementsAndGrants + st.shouldFetchRelatedResources = token.ShouldFetchRelatedResources } else { st.actions = nil st.entitlementGraph = nil @@ -233,11 +239,13 @@ func (st *state) Marshal() (string, error) { defer st.mtx.RUnlock() data, err := json.Marshal(serializedToken{ - Actions: st.actions, - CurrentAction: st.currentAction, - NeedsExpansion: st.needsExpansion, - EntitlementGraph: st.entitlementGraph, - HasExternalResourceGrants: st.hasExternalResourceGrants, + Actions: st.actions, + CurrentAction: st.currentAction, + NeedsExpansion: st.needsExpansion, + EntitlementGraph: st.entitlementGraph, + HasExternalResourceGrants: st.hasExternalResourceGrants, + ShouldFetchRelatedResources: st.shouldFetchRelatedResources, + ShouldSkipEntitlementsAndGrants: st.shouldSkipEntitlementsAndGrants, }) if err != nil { return "", err @@ -298,6 +306,14 @@ func (st *state) SetShouldFetchRelatedResources() { st.shouldFetchRelatedResources = true } +func (st *state) ShouldSkipEntitlementsAndGrants() bool { + return st.shouldSkipEntitlementsAndGrants +} + +func (st *state) SetShouldSkipEntitlementsAndGrants() { + st.shouldSkipEntitlementsAndGrants = true +} + // PageToken returns the page token for the current action. func (st *state) PageToken(ctx context.Context) string { c := st.Current() diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go index 5db1f0cf..d258f0dd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -209,8 +209,13 @@ type syncer struct { counts *ProgressCounts targetedSyncResourceIDs []string onlyExpandGrants bool + dontExpandGrants bool syncID string skipEGForResourceType map[string]bool + skipEntitlementsAndGrants bool + resourceTypeTraits map[string][]v2.ResourceType_Trait + syncType connectorstore.SyncType + injectSyncIDAnnotation bool } const minCheckpointInterval = 10 * time.Second @@ -264,8 +269,10 @@ func isWarning(ctx context.Context, err error) bool { func (s *syncer) startOrResumeSync(ctx context.Context) (string, bool, error) { // Sync resuming logic: - // If no targetedSyncResourceIDs, find the most recent sync and resume it (regardless of partial or full). - // If targetedSyncResourceIDs, start a new partial sync. Use the most recent completed sync as the parent sync ID (if it exists). + // 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). + // If there are no unfinished syncs of our desired sync type, start a new sync. + // If targetedSyncResourceIDs is set, start a new partial sync. Use the most recent completed sync as the parent sync ID (if it exists). if s.syncID != "" { err := s.store.SetCurrentSync(ctx, s.syncID) @@ -279,7 +286,7 @@ func (s *syncer) startOrResumeSync(ctx context.Context) (string, bool, error) { var newSync bool var err error if len(s.targetedSyncResourceIDs) == 0 { - syncID, newSync, err = s.store.StartSync(ctx) + syncID, newSync, err = s.store.StartOrResumeSync(ctx, s.syncType, "") if err != nil { return "", false, err } @@ -288,7 +295,7 @@ func (s *syncer) startOrResumeSync(ctx context.Context) (string, bool, error) { // Get most recent completed full sync if it exists latestFullSyncResponse, err := s.store.GetLatestFinishedSync(ctx, &reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest{ - SyncType: string(dotc1z.SyncTypeFull), + SyncType: string(connectorstore.SyncTypeFull), }) if err != nil { return "", false, err @@ -298,7 +305,7 @@ func (s *syncer) startOrResumeSync(ctx context.Context) (string, bool, error) { if latestFullSync != nil { latestFullSyncId = latestFullSync.Id } - syncID, err = s.store.StartNewSyncV2(ctx, "partial", latestFullSyncId) + syncID, err = s.store.StartNewSync(ctx, connectorstore.SyncTypePartial, latestFullSyncId) if err != nil { return "", false, err } @@ -334,7 +341,6 @@ func (s *syncer) Sync(ctx context.Context) error { if err != nil { return err } - _, err = s.connector.Validate(ctx, &v2.ConnectorServiceValidateRequest{}) if err != nil { return err @@ -354,6 +360,27 @@ func (s *syncer) Sync(ctx context.Context) error { if err != nil { return err } + s.syncID = syncID + + // Set the syncID on the wrapper after we have it + if syncID == "" { + err = errors.New("no syncID found after starting or resuming sync") + l.Error("no syncID found after starting or resuming sync", zap.Error(err)) + return err + } + if s.injectSyncIDAnnotation { + if wrapper, ok := s.connector.(*syncIDClientWrapper); ok { + wrapper.syncID = syncID + } else { + l.Error("connector is not a syncIDClientWrapper") + return errors.New("connector is not a syncIDClientWrapper") + } + } + + // Add ActiveSync to context once after we have the syncID + if syncID != "" { + ctx = types.SetSyncIDInContext(ctx, syncID) + } span.SetAttributes(attribute.String("sync_id", syncID)) @@ -412,6 +439,9 @@ func (s *syncer) Sync(ctx context.Context) error { case InitOp: s.state.FinishAction(ctx) + if s.skipEntitlementsAndGrants { + s.state.SetShouldSkipEntitlementsAndGrants() + } if len(targetedResources) > 0 { for _, r := range targetedResources { s.state.PushAction(ctx, Action{ @@ -434,7 +464,9 @@ func (s *syncer) Sync(ctx context.Context) error { // FIXME(jirwin): Disabling syncing assets for now // s.state.PushAction(ctx, Action{Op: SyncAssetsOp}) - s.state.PushAction(ctx, Action{Op: SyncGrantExpansionOp}) + if !s.state.ShouldSkipEntitlementsAndGrants() { + s.state.PushAction(ctx, Action{Op: SyncGrantExpansionOp}) + } if s.externalResourceReader != nil { s.state.PushAction(ctx, Action{Op: SyncExternalResourcesOp}) } @@ -446,8 +478,10 @@ func (s *syncer) Sync(ctx context.Context) error { } continue } - s.state.PushAction(ctx, Action{Op: SyncGrantsOp}) - s.state.PushAction(ctx, Action{Op: SyncEntitlementsOp}) + if !s.state.ShouldSkipEntitlementsAndGrants() { + s.state.PushAction(ctx, Action{Op: SyncGrantsOp}) + s.state.PushAction(ctx, Action{Op: SyncEntitlementsOp}) + } s.state.PushAction(ctx, Action{Op: SyncResourcesOp}) s.state.PushAction(ctx, Action{Op: SyncResourceTypesOp}) @@ -524,7 +558,7 @@ func (s *syncer) Sync(ctx context.Context) error { continue case SyncGrantExpansionOp: - if !s.state.NeedsExpansion() { + if s.dontExpandGrants || !s.state.NeedsExpansion() { l.Debug("skipping grant expansion, no grants to expand") s.state.FinishAction(ctx) continue @@ -558,7 +592,9 @@ func (s *syncer) Sync(ctx context.Context) error { return err } - _, err = s.connector.Cleanup(ctx, &v2.ConnectorServiceCleanupRequest{}) + _, err = s.connector.Cleanup(ctx, &v2.ConnectorServiceCleanupRequest{ + Annotations: annotations.New(&v2.ActiveSync{Id: s.syncID}), + }) if err != nil { l.Error("error clearing connector caches", zap.Error(err)) } @@ -594,7 +630,8 @@ func (s *syncer) SkipSync(ctx context.Context) error { return err } - _, err = s.store.StartNewSync(ctx) + // TODO: Create a new sync type for empty syncs. + _, err = s.store.StartNewSync(ctx, connectorstore.SyncTypeFull, "") if err != nil { return err } @@ -629,7 +666,10 @@ func (s *syncer) SyncResourceTypes(ctx context.Context) error { return err } - resp, err := s.connector.ListResourceTypes(ctx, &v2.ResourceTypesServiceListResourceTypesRequest{PageToken: pageToken}) + resp, err := s.connector.ListResourceTypes(ctx, &v2.ResourceTypesServiceListResourceTypesRequest{ + PageToken: pageToken, + Annotations: annotations.New(&v2.ActiveSync{Id: s.syncID}), + }) if err != nil { return err } @@ -690,6 +730,7 @@ func (s *syncer) getResourceFromConnector(ctx context.Context, resourceID *v2.Re &v2.ResourceGetterServiceGetResourceRequest{ ResourceId: resourceID, ParentResourceId: parentResourceID, + Annotations: annotations.New(&v2.ActiveSync{Id: s.syncID}), }, ) if err == nil { @@ -750,17 +791,30 @@ func (s *syncer) SyncTargetedResource(ctx context.Context) error { // Actions happen in reverse order. We want to sync child resources, then entitlements, then grants - s.state.PushAction(ctx, Action{ - Op: SyncGrantsOp, - ResourceTypeID: resourceTypeID, - ResourceID: resourceID, - }) + shouldSkipGrants, err := s.shouldSkipGrants(ctx, resource) + if err != nil { + return err + } + if !shouldSkipGrants { + s.state.PushAction(ctx, Action{ + Op: SyncGrantsOp, + ResourceTypeID: resourceTypeID, + ResourceID: resourceID, + }) + } - s.state.PushAction(ctx, Action{ - Op: SyncEntitlementsOp, - ResourceTypeID: resourceTypeID, - ResourceID: resourceID, - }) + shouldSkipEnts, err := s.shouldSkipEntitlementsAndGrants(ctx, resource) + if err != nil { + return err + } + + if !shouldSkipEnts { + s.state.PushAction(ctx, Action{ + Op: SyncEntitlementsOp, + ResourceTypeID: resourceTypeID, + ResourceID: resourceID, + }) + } err = s.getSubResources(ctx, resource) if err != nil { @@ -801,7 +855,7 @@ func (s *syncer) SyncResources(ctx context.Context) error { for _, rt := range resp.List { action := Action{Op: SyncResourcesOp, ResourceTypeID: rt.Id} // If this request specified a parent resource, only queue up syncing resources for children of the parent resource - if s.state.Current().ParentResourceTypeID != "" && s.state.Current().ParentResourceID != "" { + if s.state.Current() != nil && s.state.Current().ParentResourceTypeID != "" && s.state.Current().ParentResourceID != "" { action.ParentResourceID = s.state.Current().ParentResourceID action.ParentResourceTypeID = s.state.Current().ParentResourceTypeID } @@ -823,6 +877,7 @@ func (s *syncer) syncResources(ctx context.Context) error { req := &v2.ResourcesServiceListResourcesRequest{ ResourceTypeId: s.state.ResourceTypeID(ctx), PageToken: s.state.PageToken(ctx), + Annotations: annotations.New(&v2.ActiveSync{Id: s.syncID}), } if s.state.ParentResourceTypeID(ctx) != "" && s.state.ParentResourceID(ctx) != "" { req.ParentResourceId = &v2.ResourceId{ @@ -895,14 +950,19 @@ func (s *syncer) validateResourceTraits(ctx context.Context, r *v2.Resource) err ctx, span := tracer.Start(ctx, "syncer.validateResourceTraits") defer span.End() - resourceTypeResponse, err := s.store.GetResourceType(ctx, &reader_v2.ResourceTypesReaderServiceGetResourceTypeRequest{ - ResourceTypeId: r.Id.ResourceType, - }) - if err != nil { - return err + resourceTypeTraits, ok := s.resourceTypeTraits[r.Id.ResourceType] + if !ok { + resourceTypeResponse, err := s.store.GetResourceType(ctx, &reader_v2.ResourceTypesReaderServiceGetResourceTypeRequest{ + ResourceTypeId: r.Id.ResourceType, + }) + if err != nil { + return err + } + resourceTypeTraits = resourceTypeResponse.ResourceType.Traits + s.resourceTypeTraits[r.Id.ResourceType] = resourceTypeTraits } - for _, t := range resourceTypeResponse.ResourceType.Traits { + for _, t := range resourceTypeTraits { var trait proto.Message switch t { case v2.ResourceType_TRAIT_APP: @@ -941,6 +1001,15 @@ func (s *syncer) shouldSkipEntitlementsAndGrants(ctx context.Context, r *v2.Reso ctx, span := tracer.Start(ctx, "syncer.shouldSkipEntitlementsAndGrants") defer span.End() + if s.state.ShouldSkipEntitlementsAndGrants() { + return true, nil + } + + rAnnos := annotations.Annotations(r.GetAnnotations()) + if rAnnos.Contains(&v2.SkipEntitlementsAndGrants{}) { + return true, nil + } + // We've checked this resource type, so we can return what we have cached directly. if skip, ok := s.skipEGForResourceType[r.Id.ResourceType]; ok { return skip, nil @@ -961,6 +1030,15 @@ 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) { + annos := annotations.Annotations(r.GetAnnotations()) + if annos.Contains(&v2.SkipGrants{}) { + return true, nil + } + + return s.shouldSkipEntitlementsAndGrants(ctx, r) +} + // 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 { @@ -1029,9 +1107,12 @@ func (s *syncer) syncEntitlementsForResource(ctx context.Context, resourceID *v2 pageToken := s.state.PageToken(ctx) + resource := resourceResponse.Resource + resp, err := s.connector.ListEntitlements(ctx, &v2.EntitlementsServiceListEntitlementsRequest{ - Resource: resourceResponse.Resource, - PageToken: pageToken, + Resource: resource, + PageToken: pageToken, + Annotations: annotations.New(&v2.ActiveSync{Id: s.syncID}), }) if err != nil { return err @@ -1227,7 +1308,6 @@ func (s *syncer) SyncGrantExpansion(ctx context.Context) error { l.Info("Expanding grants...") s.handleInitialActionForStep(ctx, *s.state.Current()) } - resp, err := s.store.ListGrants(ctx, &v2.GrantsServiceListGrantsRequest{PageToken: pageToken}) if err != nil { return err @@ -1240,7 +1320,7 @@ func (s *syncer) SyncGrantExpansion(ctx context.Context) error { return err } } else { - l.Info("Finished loading entitlement graph", zap.Int("edges", len(entitlementGraph.Edges))) + l.Debug("Finished loading grants to expand") entitlementGraph.Loaded = true } @@ -1309,22 +1389,26 @@ func (s *syncer) SyncGrantExpansion(ctx context.Context) error { } } } + if entitlementGraph.Loaded { + l.Info("Finished loading entitlement graph", zap.Int("edges", len(entitlementGraph.Edges))) + } return nil } if entitlementGraph.Loaded { - cycle := entitlementGraph.GetFirstCycle() - if cycle != nil { + comps, sccMetrics := entitlementGraph.ComputeCyclicComponents(ctx) + if len(comps) > 0 { + // Log a sample cycle l.Warn( "cycle detected in entitlement graph", - zap.Any("cycle", cycle), + zap.Any("cycle", comps[0]), + zap.Any("scc_metrics", sccMetrics), ) l.Debug("initial graph", zap.Any("initial graph", entitlementGraph)) if dontFixCycles { return fmt.Errorf("cycles detected in entitlement graph") } - - err := entitlementGraph.FixCycles() + err := entitlementGraph.FixCyclesFromComponents(ctx, comps) if err != nil { return err } @@ -1369,7 +1453,7 @@ func (s *syncer) SyncGrants(ctx context.Context) error { } for _, r := range resp.List { - shouldSkip, err := s.shouldSkipEntitlementsAndGrants(ctx, r) + shouldSkip, err := s.shouldSkipGrants(ctx, r) if err != nil { return err } @@ -1394,7 +1478,7 @@ func (s *syncer) SyncGrants(ctx context.Context) error { } type latestSyncFetcher interface { - LatestFinishedSync(ctx context.Context) (string, error) + LatestFinishedSync(ctx context.Context, syncType connectorstore.SyncType) (string, error) } func (s *syncer) fetchResourceForPreviousSync(ctx context.Context, resourceID *v2.ResourceId) (string, *v2.ETag, error) { @@ -1407,7 +1491,7 @@ func (s *syncer) fetchResourceForPreviousSync(ctx context.Context, resourceID *v var err error if psf, ok := s.store.(latestSyncFetcher); ok { - previousSyncID, err = psf.LatestFinishedSync(ctx) + previousSyncID, err = psf.LatestFinishedSync(ctx, connectorstore.SyncTypeFull) if err != nil { return "", nil, err } @@ -1491,7 +1575,6 @@ func (s *syncer) fetchEtaggedGrantsForResource( storeAnnos.Update(&c1zpb.SyncDetails{ Id: prevSyncID, }) - for { prevGrantsResp, err := s.store.ListGrants(ctx, &v2.GrantsServiceListGrantsRequest{ Resource: resource, @@ -1547,7 +1630,11 @@ func (s *syncer) syncGrantsForResource(ctx context.Context, resourceID *v2.Resou resourceAnnos.Update(prevEtag) resource.Annotations = resourceAnnos - resp, err := s.connector.ListGrants(ctx, &v2.GrantsServiceListGrantsRequest{Resource: resource, PageToken: pageToken}) + resp, err := s.connector.ListGrants(ctx, &v2.GrantsServiceListGrantsRequest{ + Resource: resource, + PageToken: pageToken, + Annotations: annotations.New(&v2.ActiveSync{Id: s.syncID}), + }) if err != nil { return err } @@ -1566,7 +1653,7 @@ func (s *syncer) syncGrantsForResource(ctx context.Context, resourceID *v2.Resou l := ctxzap.Extract(ctx) for _, grant := range grants { grantAnnos := annotations.Annotations(grant.GetAnnotations()) - if grantAnnos.Contains(&v2.GrantExpandable{}) { + if !s.dontExpandGrants && grantAnnos.Contains(&v2.GrantExpandable{}) { s.state.SetNeedsExpansion() } if grantAnnos.ContainsAny(&v2.ExternalResourceMatchAll{}, &v2.ExternalResourceMatch{}, &v2.ExternalResourceMatchID{}) { @@ -1600,29 +1687,6 @@ func (s *syncer) syncGrantsForResource(ctx context.Context, resourceID *v2.Resou return err } } - - principalResource := grant.GetPrincipal() - _, err = s.store.GetResource(ctx, &reader_v2.ResourcesReaderServiceGetResourceRequest{ - ResourceId: principalResource.GetId(), - }) - if err != nil { - if !errors.Is(err, sql.ErrNoRows) { - return err - } - - // Principal resource is not in the DB, so try to fetch it from the connector. - resource, err := s.getResourceFromConnector(ctx, principalResource.GetId(), principalResource.GetParentResourceId()) - if err != nil { - l.Error("error fetching principal resource", zap.Error(err)) - return err - } - if resource == nil { - continue - } - if err := s.store.PutResources(ctx, resource); err != nil { - return err - } - } } err = s.store.PutGrants(ctx, grants...) if err != nil { @@ -1761,10 +1825,12 @@ func (s *syncer) SyncExternalResourcesWithGrantToEntitlement(ctx context.Context } for _, principal := range principals { - skipEnts := skipEGForResourceType[principal.Id.ResourceType] + rAnnos := annotations.Annotations(principal.GetAnnotations()) + skipEnts := skipEGForResourceType[principal.Id.ResourceType] || rAnnos.Contains(&v2.SkipEntitlementsAndGrants{}) if skipEnts { continue } + resourceEnts, err := s.listExternalEntitlementsForResource(ctx, principal) if err != nil { return err @@ -1773,6 +1839,10 @@ func (s *syncer) SyncExternalResourcesWithGrantToEntitlement(ctx context.Context } for _, ent := range ents { + rAnnos := annotations.Annotations(ent.GetResource().GetAnnotations()) + if rAnnos.Contains(&v2.SkipGrants{}) { + continue + } grantsForEnt, err := s.listExternalGrantsForEntitlement(ctx, ent) if err != nil { return err @@ -1868,6 +1938,11 @@ func (s *syncer) SyncExternalResourcesUsersAndGroups(ctx context.Context) error if skipEnts { continue } + rAnnos := annotations.Annotations(principal.GetAnnotations()) + if rAnnos.Contains(&v2.SkipEntitlementsAndGrants{}) { + continue + } + resourceEnts, err := s.listExternalEntitlementsForResource(ctx, principal) if err != nil { return err @@ -1876,6 +1951,10 @@ func (s *syncer) SyncExternalResourcesUsersAndGroups(ctx context.Context) error } for _, ent := range ents { + rAnnos := annotations.Annotations(ent.GetResource().GetAnnotations()) + if rAnnos.Contains(&v2.SkipGrants{}) { + continue + } grantsForEnt, err := s.listExternalGrantsForEntitlement(ctx, ent) if err != nil { return err @@ -1943,6 +2022,7 @@ func (s *syncer) listExternalResourcesForResourceType(ctx context.Context, resou func (s *syncer) listExternalEntitlementsForResource(ctx context.Context, resource *v2.Resource) ([]*v2.Entitlement, error) { ents := make([]*v2.Entitlement, 0) entitlementToken := "" + for { entitlementsList, err := s.externalResourceReader.ListEntitlements(ctx, &v2.EntitlementsServiceListEntitlementsRequest{ PageToken: entitlementToken, @@ -2371,7 +2451,7 @@ func (s *syncer) runGrantExpandActions(ctx context.Context) (bool, error) { return false, fmt.Errorf("runGrantExpandActions: error fetching source grants: %w", err) } - var newGrants []*v2.Grant = make([]*v2.Grant, 0) + var newGrants = make([]*v2.Grant, 0) for _, sourceGrant := range sourceGrants.List { // Skip this grant if it is not for a resource type we care about if len(action.ResourceTypeIDs) > 0 { @@ -2715,6 +2795,12 @@ func WithExternalResourceEntitlementIdFilter(entitlementId string) SyncOpt { func WithTargetedSyncResourceIDs(resourceIDs []string) SyncOpt { return func(s *syncer) { s.targetedSyncResourceIDs = resourceIDs + if len(resourceIDs) > 0 { + s.syncType = connectorstore.SyncTypePartial + return + } + // No targeted resource IDs, so we need to update the sync type to either full or resources only. + WithSkipEntitlementsAndGrants(s.skipEntitlementsAndGrants)(s) } } @@ -2724,18 +2810,46 @@ func WithOnlyExpandGrants() SyncOpt { } } +func WithDontExpandGrants() SyncOpt { + return func(s *syncer) { + s.dontExpandGrants = true + } +} func WithSyncID(syncID string) SyncOpt { return func(s *syncer) { s.syncID = syncID } } +func WithInjectSyncIDAnnotation(inject bool) SyncOpt { + return func(s *syncer) { + s.injectSyncIDAnnotation = inject + } +} + +func WithSkipEntitlementsAndGrants(skip bool) SyncOpt { + return func(s *syncer) { + 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 { + return + } + if skip { + s.syncType = connectorstore.SyncTypeResourcesOnly + } else { + s.syncType = connectorstore.SyncTypeFull + } + } +} + // NewSyncer returns a new syncer object. func NewSyncer(ctx context.Context, c types.ConnectorClient, opts ...SyncOpt) (Syncer, error) { s := &syncer{ - connector: c, + connector: &syncIDClientWrapper{ConnectorClient: c, syncID: ""}, // we only get the syncid later skipEGForResourceType: make(map[string]bool), + resourceTypeTraits: make(map[string][]v2.ResourceType_Trait), counts: NewProgressCounts(), + syncType: connectorstore.SyncTypeFull, } for _, o := range opts { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go new file mode 100644 index 00000000..e3e9fa4b --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go @@ -0,0 +1,95 @@ +package attached + +import ( + "context" + "fmt" + + "github.com/conductorone/baton-sdk/pkg/connectorstore" + "github.com/conductorone/baton-sdk/pkg/dotc1z" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" +) + +type Compactor struct { + base *dotc1z.C1File + applied *dotc1z.C1File + dest *dotc1z.C1File +} + +func NewAttachedCompactor(base *dotc1z.C1File, applied *dotc1z.C1File, dest *dotc1z.C1File) *Compactor { + return &Compactor{ + base: base, + applied: applied, + dest: dest, + } +} + +func (c *Compactor) CompactWithSyncID(ctx context.Context, destSyncID string) error { + baseSyncID, err := c.base.LatestFinishedSyncID(ctx, connectorstore.SyncTypeAny) + if err != nil { + return fmt.Errorf("failed to get base sync ID: %w", err) + } + if baseSyncID == "" { + return fmt.Errorf("no finished sync found in base") + } + + appliedSyncID, err := c.applied.LatestFinishedSyncID(ctx, connectorstore.SyncTypeAny) + if err != nil { + return fmt.Errorf("failed to get applied sync ID: %w", err) + } + if appliedSyncID == "" { + return fmt.Errorf("no finished sync found in applied") + } + + // Attach both the base and applied databases to the destination + base, err := c.dest.AttachFile(c.base, "base") + if err != nil { + return fmt.Errorf("failed to attach databases to destination: %w", err) + } + l := ctxzap.Extract(ctx) + defer func() { + _, err := base.DetachFile("base") + if err != nil { + l.Error("failed to detach file", zap.Error(err)) + } + }() + + // Attach both the base and applied databases to the destination + attached, err := c.dest.AttachFile(c.applied, "attached") + if err != nil { + return fmt.Errorf("failed to attach databases to destination: %w", err) + } + defer func() { + _, err := attached.DetachFile("attached") + if err != nil { + l.Error("failed to detach file", zap.Error(err)) + } + }() + + if err := c.processRecords(ctx, attached, destSyncID, baseSyncID, appliedSyncID); err != nil { + return fmt.Errorf("failed to process records: %w", err) + } + + return nil +} + +func (c *Compactor) processRecords(ctx context.Context, attached *dotc1z.C1FileAttached, destSyncID string, baseSyncID string, appliedSyncID string) error { + // Compact all tables: copy base records and merge newer applied records using raw SQL + if err := attached.CompactResourceTypes(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + return fmt.Errorf("failed to compact resource types: %w", err) + } + + if err := attached.CompactResources(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + return fmt.Errorf("failed to compact resources: %w", err) + } + + if err := attached.CompactEntitlements(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + return fmt.Errorf("failed to compact entitlements: %w", err) + } + + if err := attached.CompactGrants(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + return fmt.Errorf("failed to compact grants: %w", err) + } + + return nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go index 535c8ffe..1d638341 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go @@ -10,17 +10,30 @@ import ( "path/filepath" reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" + "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/conductorone/baton-sdk/pkg/dotc1z" c1zmanager "github.com/conductorone/baton-sdk/pkg/dotc1z/manager" "github.com/conductorone/baton-sdk/pkg/sdk" "github.com/conductorone/baton-sdk/pkg/sync" - sync_compactor "github.com/conductorone/baton-sdk/pkg/synccompactor/naive" + "github.com/conductorone/baton-sdk/pkg/synccompactor/attached" + "github.com/conductorone/baton-sdk/pkg/synccompactor/naive" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.opentelemetry.io/otel" "go.uber.org/zap" ) +var tracer = otel.Tracer("baton-sdk/pkg.synccompactor") + +type CompactorType string + +const ( + CompactorTypeNaive CompactorType = "naive" + CompactorTypeAttached CompactorType = "attached" +) + type Compactor struct { - entries []*CompactableSync + compactorType CompactorType + entries []*CompactableSync tmpDir string destDir string @@ -43,12 +56,22 @@ func WithTmpDir(tempDir string) Option { } } +func WithCompactorType(compactorType CompactorType) Option { + return func(c *Compactor) { + c.compactorType = compactorType + } +} + func NewCompactor(ctx context.Context, outputDir string, compactableSyncs []*CompactableSync, opts ...Option) (*Compactor, func() error, error) { if len(compactableSyncs) < 2 { return nil, nil, ErrNotEnoughFilesToCompact } - c := &Compactor{entries: compactableSyncs, destDir: outputDir} + c := &Compactor{ + entries: compactableSyncs, + destDir: outputDir, + compactorType: CompactorTypeAttached, + } for _, opt := range opts { opt(c) } @@ -74,20 +97,20 @@ func NewCompactor(ctx context.Context, outputDir string, compactableSyncs []*Com } func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { + ctx, span := tracer.Start(ctx, "Compactor.Compact") + defer span.End() if len(c.entries) < 2 { return nil, nil } - base := c.entries[0] - for i := 1; i < len(c.entries); i++ { - applied := c.entries[i] - - compactable, err := c.doOneCompaction(ctx, base, applied) + var err error + // Base sync is c.entries[0], so compact all incrementals first, then apply that onto the base. + applied := c.entries[len(c.entries)-1] + for i := len(c.entries) - 2; i >= 0; i-- { + applied, err = c.doOneCompaction(ctx, c.entries[i], applied) if err != nil { return nil, err } - - base = compactable } l := ctxzap.Extract(ctx) @@ -104,8 +127,8 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { syncer, err := sync.NewSyncer( ctx, emptyConnector, - sync.WithC1ZPath(base.FilePath), - sync.WithSyncID(base.SyncID), + sync.WithC1ZPath(applied.FilePath), + sync.WithSyncID(applied.SyncID), sync.WithOnlyExpandGrants(), ) if err != nil { @@ -123,8 +146,8 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { } // Move last compacted file to the destination dir - finalPath := path.Join(c.destDir, fmt.Sprintf("compacted-%s.c1z", base.SyncID)) - if err := cpFile(base.FilePath, finalPath); err != nil { + finalPath := path.Join(c.destDir, fmt.Sprintf("compacted-%s.c1z", applied.SyncID)) + if err := cpFile(applied.FilePath, finalPath); err != nil { return nil, err } @@ -135,7 +158,7 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { } finalPath = abs } - return &CompactableSync{FilePath: finalPath, SyncID: base.SyncID}, nil + return &CompactableSync{FilePath: finalPath, SyncID: applied.SyncID}, nil } func cpFile(sourcePath string, destPath string) error { @@ -159,13 +182,14 @@ func cpFile(sourcePath string, destPath string) error { return nil } -func getLatestObjects(ctx context.Context, info *CompactableSync) (*reader_v2.SyncRun, *dotc1z.C1File, c1zmanager.Manager, func(), error) { - baseC1Z, err := c1zmanager.New(ctx, info.FilePath) +func (c *Compactor) getLatestObjects(ctx context.Context, info *CompactableSync) (*reader_v2.SyncRun, *dotc1z.C1File, c1zmanager.Manager, func(), error) { + cleanup := func() {} + baseC1Z, err := c1zmanager.New(ctx, info.FilePath, c1zmanager.WithTmpDir(c.tmpDir)) if err != nil { - return nil, nil, nil, nil, err + return nil, nil, nil, cleanup, err } - cleanup := func() { + cleanup = func() { _ = baseC1Z.Close(ctx) } @@ -190,7 +214,20 @@ func getLatestObjects(ctx context.Context, info *CompactableSync) (*reader_v2.Sy return latestAppliedSync.Sync, baseFile, baseC1Z, cleanup, nil } +func unionSyncTypes(a, b connectorstore.SyncType) connectorstore.SyncType { + switch { + case a == connectorstore.SyncTypeFull || b == connectorstore.SyncTypeFull: + return connectorstore.SyncTypeFull + case a == connectorstore.SyncTypeResourcesOnly || b == connectorstore.SyncTypeResourcesOnly: + return connectorstore.SyncTypeResourcesOnly + default: + return connectorstore.SyncTypePartial + } +} + func (c *Compactor) doOneCompaction(ctx context.Context, base *CompactableSync, applied *CompactableSync) (*CompactableSync, error) { + ctx, span := tracer.Start(ctx, "Compactor.doOneCompaction") + defer span.End() l := ctxzap.Extract(ctx) l.Info( "running compaction", @@ -214,30 +251,44 @@ func (c *Compactor) doOneCompaction(ctx context.Context, base *CompactableSync, } defer func() { _ = newFile.Close() }() - newSync, err := newFile.StartNewSyncV2(ctx, string(dotc1z.SyncTypeFull), "") - if err != nil { - return nil, err - } - - _, baseFile, _, cleanupBase, err := getLatestObjects(ctx, base) + baseSync, baseFile, _, cleanupBase, err := c.getLatestObjects(ctx, base) defer cleanupBase() if err != nil { return nil, err } - _, appliedFile, _, cleanupApplied, err := getLatestObjects(ctx, applied) + appliedSync, appliedFile, _, cleanupApplied, err := c.getLatestObjects(ctx, applied) defer cleanupApplied() if err != nil { return nil, err } - runner := sync_compactor.NewNaiveCompactor(baseFile, appliedFile, newFile) + syncType := unionSyncTypes(connectorstore.SyncType(baseSync.SyncType), connectorstore.SyncType(appliedSync.SyncType)) - if err := runner.Compact(ctx); err != nil { - l.Error("error running compaction", zap.Error(err)) + newSyncId, err := newFile.StartNewSync(ctx, syncType, "") + if err != nil { return nil, err } + switch c.compactorType { + case CompactorTypeNaive: + // TODO: Add support for syncID or remove naive compactor. + runner := naive.NewNaiveCompactor(baseFile, appliedFile, newFile) + if err := runner.Compact(ctx); err != nil { + l.Error("error running compaction", zap.Error(err)) + return nil, err + } + case CompactorTypeAttached: + runner := attached.NewAttachedCompactor(baseFile, appliedFile, newFile) + if err := runner.CompactWithSyncID(ctx, newSyncId); err != nil { + l.Error("error running compaction", zap.Error(err)) + return nil, err + } + default: + // c.compactorType defaults to attached, so this should never happen. + return nil, fmt.Errorf("invalid compactor type: %s", c.compactorType) + } + if err := newFile.EndSync(ctx); err != nil { return nil, err } @@ -249,6 +300,6 @@ func (c *Compactor) doOneCompaction(ctx context.Context, base *CompactableSync, return &CompactableSync{ FilePath: outputFilepath, - SyncID: newSync, + SyncID: newSyncId, }, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/delete_resource.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/delete_resource.go index 13c61576..dc2f2b8b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/delete_resource.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/delete_resource.go @@ -42,7 +42,8 @@ func (g *deleteResourceTaskHandler) HandleTask(ctx context.Context) error { cc := g.helpers.ConnectorClient() resp, err := cc.DeleteResource(ctx, &v2.DeleteResourceRequest{ - ResourceId: t.GetResourceId(), + ResourceId: t.GetResourceId(), + ParentResourceId: t.GetParentResourceId(), }) if err != nil { l.Error("failed delete resource task", zap.Error(err)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go index 0bec6a27..20b98c39 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go @@ -41,11 +41,25 @@ func (c *fullSyncTaskHandler) sync(ctx context.Context, c1zPath string) error { l := ctxzap.Extract(ctx).With(zap.String("task_id", c.task.GetId()), zap.Stringer("task_type", tasks.GetType(c.task))) + if c.task.GetSyncFull() == nil { + return errors.New("task is not a full sync task") + } + syncOpts := []sdkSync.SyncOpt{ sdkSync.WithC1ZPath(c1zPath), sdkSync.WithTmpDir(c.helpers.TempDir()), } + if c.task.GetSyncFull().GetSkipExpandGrants() { + // Have C1 expand grants. This is faster & results in a smaller c1z upload. + syncOpts = append(syncOpts, sdkSync.WithDontExpandGrants()) + } + + if c.task.GetSyncFull().GetSkipEntitlementsAndGrants() { + // Sync only resources. This is meant to be used for a first sync so initial data gets into the UI faster. + syncOpts = append(syncOpts, sdkSync.WithSkipEntitlementsAndGrants(true)) + } + if c.externalResourceC1ZPath != "" { syncOpts = append(syncOpts, sdkSync.WithExternalResourceC1ZPath(c.externalResourceC1ZPath)) } @@ -192,45 +206,45 @@ func uploadDebugLogs(ctx context.Context, helper fullSyncHelpers) error { l.Warn("unable to get the current working directory", zap.Error(err)) } if wd != "" { - l.Warn("no temporal folder found on this system according to our sync helper,"+ + l.Warn("no temporary folder found on this system according to our sync helper,"+ " we may create files in the current working directory by mistake as a result", zap.String("current working directory", wd)) } else { - l.Warn("no temporal folder found on this system according to our sync helper") + l.Warn("no temporary folder found on this system according to our sync helper") } } - debugfilelocation := filepath.Join(tempDir, "debug.log") + debugPath := filepath.Join(tempDir, "debug.log") - _, err := os.Stat(debugfilelocation) + _, err := os.Stat(debugPath) if err != nil { switch { case errors.Is(err, os.ErrNotExist): - l.Warn("debug log file does not exists", zap.Error(err)) + l.Debug("debug log file does not exist", zap.Error(err)) case errors.Is(err, os.ErrPermission): l.Warn("debug log file cannot be stat'd due to lack of permissions", zap.Error(err)) default: l.Warn("cannot stat debug log file", zap.Error(err)) } return nil - } else { - debugfile, err := os.Open(debugfilelocation) - if err != nil { - return err - } - defer debugfile.Close() + } - l.Info("uploading debug logs", zap.String("file", debugfilelocation)) - err = helper.Upload(ctx, debugfile) + debugfile, err := os.Open(debugPath) + if err != nil { + return err + } + defer func() { + err := os.Remove(debugPath) if err != nil { - return err + l.Error("failed to delete file with debug logs", zap.Error(err), zap.String("file", debugPath)) } - defer func() { - err := os.Remove(debugfilelocation) - if err != nil { - l.Error("failed to delete file with debug logs", zap.Error(err), zap.String("file", debugfilelocation)) - } - }() + }() + defer debugfile.Close() - return nil + l.Info("uploading debug logs", zap.String("file", debugPath)) + err = helper.Upload(ctx, debugfile) + if err != nil { + return err } + + return nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go index ad3867e3..21866f93 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go @@ -132,7 +132,7 @@ func (c *c1ApiTaskManager) Next(ctx context.Context) (*v1.Task, time.Duration, e zap.Stringer("task_type", tasks.GetType(resp.GetTask())), ) - l.Debug("c1_api_task_manager.Next(): got task") + l.Debug("c1_api_task_manager.Next(): got task", zap.Duration("next_poll", nextPoll)) return resp.GetTask(), nextPoll, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go index 55707ab3..29ab8ccd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go @@ -148,6 +148,39 @@ func (c *c1ServiceClient) Upload(ctx context.Context, task *v1.Task, r io.ReadSe l := ctxzap.Extract(ctx) + var err error + const maxAttempts = 3 + for i := range maxAttempts { + err = c.upload(ctx, task, r) + if err == nil { + return nil + } + l.Warn("failed to upload asset", zap.Error(err)) + if i < maxAttempts-1 { + backoff := time.Second * time.Duration(i) + select { + case <-time.After(backoff): + case <-ctx.Done(): + return ctx.Err() + } + } + } + + return err +} + +func (c *c1ServiceClient) upload(ctx context.Context, task *v1.Task, r io.ReadSeeker) error { + ctx, span := tracer.Start(ctx, "c1ServiceClient.Upload") + defer span.End() + + l := ctxzap.Extract(ctx) + + _, err := r.Seek(0, io.SeekStart) + if err != nil { + l.Error("failed to seek to start of upload asset", zap.Error(err)) + return err + } + client, done, err := c.getClientConn(ctx) if err != nil { return err diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go index d02a6d9a..86084448 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go @@ -21,6 +21,7 @@ type localSyncer struct { externalResourceC1Z string externalResourceEntitlementIdFilter string targetedSyncResourceIDs []string + skipEntitlementsAndGrants bool } type Option func(*localSyncer) @@ -49,6 +50,12 @@ func WithTargetedSyncResourceIDs(resourceIDs []string) Option { } } +func WithSkipEntitlementsAndGrants(skip bool) Option { + return func(m *localSyncer) { + m.skipEntitlementsAndGrants = skip + } +} + func (m *localSyncer) GetTempDir() string { return "" } @@ -77,6 +84,7 @@ func (m *localSyncer) Process(ctx context.Context, task *v1.Task, cc types.Conne sdkSync.WithExternalResourceC1ZPath(m.externalResourceC1Z), sdkSync.WithExternalResourceEntitlementIdFilter(m.externalResourceEntitlementIdFilter), sdkSync.WithTargetedSyncResourceIDs(m.targetedSyncResourceIDs), + sdkSync.WithSkipEntitlementsAndGrants(m.skipEntitlementsAndGrants), ) if err != nil { return err diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/session_cache.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/session_cache.go new file mode 100644 index 00000000..86d69eb5 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/session_cache.go @@ -0,0 +1,58 @@ +package types + +import ( + "context" +) + +// SessionCacheKey is the context key for storing the session cache instance. +type SessionCacheKey struct{} + +// SessionCache is an interface for caching session data. +type SessionCache interface { + Get(ctx context.Context, key string, opt ...SessionCacheOption) ([]byte, bool, error) + GetMany(ctx context.Context, keys []string, opt ...SessionCacheOption) (map[string][]byte, error) + Set(ctx context.Context, key string, value []byte, opt ...SessionCacheOption) error + SetMany(ctx context.Context, values map[string][]byte, opt ...SessionCacheOption) error + Delete(ctx context.Context, key string, opt ...SessionCacheOption) error + Clear(ctx context.Context, opt ...SessionCacheOption) error + GetAll(ctx context.Context, opt ...SessionCacheOption) (map[string][]byte, error) + Close(ctx context.Context) error +} + +// SessionCacheOption is a function that modifies a SessionCacheBag. +type SessionCacheOption func(ctx context.Context, bag *SessionCacheBag) error + +// SessionCacheConstructor is a function that creates a SessionCache instance. +type SessionCacheConstructor func(ctx context.Context, opt ...SessionCacheConstructorOption) (SessionCache, error) + +// SessionCacheConstructorOption is a function that modifies the context for session cache construction. +type SessionCacheConstructorOption func(ctx context.Context) (context.Context, error) + +// SessionCacheBag holds the configuration for session cache operations. +type SessionCacheBag struct { + SyncID string + Prefix string +} + +// SyncIDKey is the context key for storing the current sync ID. +type SyncIDKey struct{} + +// WithSyncID returns a SessionCacheOption that sets the sync ID for the operation. +func WithSyncID(syncID string) SessionCacheOption { + return func(ctx context.Context, bag *SessionCacheBag) error { + bag.SyncID = syncID + return nil + } +} + +// GetSyncID retrieves the sync ID from the context, returning empty string if not found. +func GetSyncID(ctx context.Context) string { + if syncID, ok := ctx.Value(SyncIDKey{}).(string); ok { + return syncID + } + return "" +} + +func SetSyncIDInContext(ctx context.Context, syncID string) context.Context { + return context.WithValue(ctx, SyncIDKey{}, syncID) +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/types.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/types.go index 191c0a9b..fc52f6f4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/types.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/types.go @@ -1,4 +1,4 @@ -package types +package types //nolint:revive // we want this to be "types" import ( "context" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/c1_credential_provider.go b/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/c1_credential_provider.go index 05b21aa1..6073b812 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/c1_credential_provider.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/c1_credential_provider.go @@ -1,10 +1,7 @@ package ugrpc import ( - "bytes" "context" - "crypto/ed25519" - "encoding/base64" "errors" "net" "net/http" @@ -13,6 +10,7 @@ import ( "strings" "time" + "github.com/conductorone/baton-sdk/pkg/crypto" "github.com/conductorone/baton-sdk/pkg/uhttp" "github.com/go-jose/go-jose/v4" "github.com/go-jose/go-jose/v4/json" @@ -30,10 +28,7 @@ const ( ) var ( - ErrInvalidClientSecret = errors.New("invalid client secret") - ErrInvalidClientID = errors.New("invalid client id") - - v1SecretTokenIdentifier = []byte("v1") + ErrInvalidClientID = errors.New("invalid client id") ) type c1Token struct { @@ -66,39 +61,6 @@ func parseClientID(input string) (string, string, error) { return clientName, items[0], nil } -func parseSecret(input []byte) (*jose.JSONWebKey, error) { - items := bytes.SplitN(input, []byte(":"), 4) - if len(items) != 4 { - return nil, ErrInvalidClientSecret - } - - if !bytes.Equal(items[2], v1SecretTokenIdentifier) { - return nil, ErrInvalidClientSecret - } - - jwkData, err := base64.RawURLEncoding.DecodeString(string(items[3])) - if err != nil { - return nil, ErrInvalidClientSecret - } - - npk := &jose.JSONWebKey{} - err = npk.UnmarshalJSON(jwkData) - if err != nil { - return nil, ErrInvalidClientSecret - } - - if npk.IsPublic() || !npk.Valid() { - return nil, ErrInvalidClientSecret - } - - _, ok := npk.Key.(ed25519.PrivateKey) - if !ok { - return nil, ErrInvalidClientSecret - } - - return npk, nil -} - func (c *c1TokenSource) Token() (*oauth2.Token, error) { jsigner, err := jose.NewSigner( jose.SigningKey{ @@ -197,7 +159,7 @@ func newC1TokenSource(ctx context.Context, clientID string, clientSecret string) return nil, "", "", err } - secret, err := parseSecret([]byte(clientSecret)) + secret, err := crypto.ParseClientSecret([]byte(clientSecret), false) if err != nil { return nil, "", "", err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/interceptors.go b/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/interceptors.go index e2a76cba..9b96e079 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/interceptors.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ugrpc/interceptors.go @@ -2,7 +2,10 @@ package ugrpc import ( "context" + "reflect" + "github.com/conductorone/baton-sdk/pkg/annotations" + "github.com/conductorone/baton-sdk/pkg/types" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags" @@ -11,8 +14,80 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/anypb" ) +func ChainUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor { + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + // Compose from last to first + chained := handler + for i := len(interceptors) - 1; i >= 0; i-- { + currentInterceptor := interceptors[i] + next := chained + chained = func(currentCtx context.Context, currentReq interface{}) (interface{}, error) { + return currentInterceptor(currentCtx, currentReq, info, next) + } + } + return chained(ctx, req) + } +} + +/* +SessionCacheUnaryInterceptor creates a unary interceptor that: +1. Propagates the session cache from the server context to the handler context. +2. Extracts annotations from requests and adds syncID to context (for the session manager). +*/ +func SessionCacheUnaryInterceptor(serverCtx context.Context) grpc.UnaryServerInterceptor { + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + // Propagate session cache from server context to handler context + ctx = ContextWithSyncID(ctx, req) + + if sessionCache, ok := serverCtx.Value(types.SessionCacheKey{}).(types.SessionCache); ok { + ctx = context.WithValue(ctx, types.SessionCacheKey{}, sessionCache) + } + + return handler(ctx, req) + } +} + +func SessionCacheStreamInterceptor(serverCtx context.Context) grpc.StreamServerInterceptor { + return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + // Start with the original stream context + ctx := ss.Context() + + // Propagate session cache from server context to stream context + if sessionCache, ok := serverCtx.Value(types.SessionCacheKey{}).(types.SessionCache); ok { + ctx = context.WithValue(ctx, types.SessionCacheKey{}, sessionCache) + } + + // Create a wrapped stream that handles both session cache and annotation extraction + wrappedStream := &sessionCacheServerStream{ + ServerStream: ss, + ctx: ctx, + } + + return handler(srv, wrappedStream) + } +} + +type sessionCacheServerStream struct { + grpc.ServerStream + ctx context.Context +} + +func (s *sessionCacheServerStream) Context() context.Context { + return s.ctx +} + +func (s *sessionCacheServerStream) RecvMsg(m interface{}) error { + err := s.ServerStream.RecvMsg(m) + if err != nil { + return err + } + s.ctx = ContextWithSyncID(s.ctx, m) + return nil +} + // StreamServerInterceptors returns a slice of interceptors that includes the default interceptors, // plus any interceptors passed in as arguments. func StreamServerInterceptors(ctx context.Context, interceptors ...grpc.StreamServerInterceptor) []grpc.StreamServerInterceptor { @@ -21,6 +96,7 @@ func StreamServerInterceptors(ctx context.Context, interceptors ...grpc.StreamSe LoggingStreamServerInterceptor(ctxzap.Extract(ctx)), grpc_recovery.StreamServerInterceptor(grpc_recovery.WithRecoveryHandlerContext(recoveryHandler)), grpc_validator.StreamServerInterceptor(), + SessionCacheStreamInterceptor(ctx), } rv = append(rv, interceptors...) @@ -35,6 +111,7 @@ func UnaryServerInterceptor(ctx context.Context, interceptors ...grpc.UnaryServe LoggingUnaryServerInterceptor(ctxzap.Extract(ctx)), grpc_recovery.UnaryServerInterceptor(grpc_recovery.WithRecoveryHandlerContext(recoveryHandler)), grpc_validator.UnaryServerInterceptor(), + SessionCacheUnaryInterceptor(ctx), } rv = append(rv, interceptors...) @@ -55,3 +132,59 @@ func recoveryHandler(ctx context.Context, p interface{}) error { ) return err } + +// ContextWithSyncID extracts syncID from a request annotations and adds it to the context. +func ContextWithSyncID(ctx context.Context, req interface{}) context.Context { + if ctx == nil || req == nil { + return ctx + } + + // Use reflection to check if the request has an Annotations field + reqValue := reflect.ValueOf(req) + if reqValue.Kind() == reflect.Ptr { + reqValue = reqValue.Elem() + } + + annotationsField := reqValue.FieldByName("Annotations") + if !annotationsField.IsValid() { + return ctx + } + + // Check if the field is of the correct type + if annotationsField.Type() != reflect.TypeOf(annotations.Annotations{}) && + annotationsField.Type() != reflect.TypeOf([]*anypb.Any{}) { + return ctx + } + + // Get the annotations from the request + if annotationsField.IsNil() { + return ctx + } + + // Handle both annotations.Annotations and []*anypb.Any types + var annos annotations.Annotations + if annotationsField.Type() == reflect.TypeOf(annotations.Annotations{}) { + annos = annotationsField.Interface().(annotations.Annotations) + } else { + // Convert []*anypb.Any to annotations.Annotations + anySlice := annotationsField.Interface().([]*anypb.Any) + annos = annotations.Annotations(anySlice) + } + + if len(annos) == 0 { + return ctx + } + + syncID, err := annotations.GetActiveSyncIdFromAnnotations(annos) + if err != nil { + l := ctxzap.Extract(ctx) + l.Warn("error getting active sync id from annotations", zap.Error(err)) + return ctx + } + + if syncID == "" { + return ctx + } + + return context.WithValue(ctx, types.SyncIDKey{}, syncID) +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/dbcache.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/dbcache.go index 9fb32424..459990df 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/dbcache.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/dbcache.go @@ -192,7 +192,7 @@ func (d *DBCache) removeDB(ctx context.Context) error { // Get returns cached response (if exists). func (d *DBCache) Get(req *http.Request) (*http.Response, error) { var ( - isFound bool = false + isFound = false resp *http.Response ) key, err := CreateCacheKey(req) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go index 1a368cac..0073f1c1 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go @@ -271,6 +271,11 @@ func WithGenericResponse(response *map[string]any) DoOption { if response == nil { return status.Error(codes.InvalidArgument, "response is nil") } + + if resp.StatusCode == http.StatusNoContent { + return nil + } + var v any var err error @@ -348,7 +353,7 @@ func (c *BaseHttpClient) Do(req *http.Request, options ...DoOption) (*http.Respo c.rateLimiter.Take() } - if req.Method == http.MethodGet { + if req.Method == http.MethodGet && req.Header.Get("Cache-Control") != "no-cache" { resp, err = c.baseHttpCache.Get(req) if err != nil { return nil, err @@ -364,6 +369,13 @@ func (c *BaseHttpClient) Do(req *http.Request, options ...DoOption) (*http.Respo resp, err = c.HttpClient.Do(req) if err != nil { l.Error("base-http-client: HTTP error response", zap.Error(err)) + // Turn certain network errors into grpc statuses so we retry + if errors.Is(err, io.ErrUnexpectedEOF) { + return resp, WrapErrors(codes.Unavailable, "unexpected EOF", err) + } + if errors.Is(err, syscall.ECONNRESET) { + return nil, WrapErrors(codes.Unavailable, "connection reset", err) + } var urlErr *url.Error if errors.As(err, &urlErr) { if urlErr.Timeout() { @@ -432,7 +444,7 @@ func (c *BaseHttpClient) Do(req *http.Request, options ...DoOption) (*http.Respo switch resp.StatusCode { case http.StatusRequestTimeout: return resp, WrapErrorsWithRateLimitInfo(codes.DeadlineExceeded, resp, optErrs...) - case http.StatusTooManyRequests, http.StatusBadGateway, http.StatusServiceUnavailable: + case http.StatusTooManyRequests, http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout: return resp, WrapErrorsWithRateLimitInfo(codes.Unavailable, resp, optErrs...) case http.StatusNotFound: return resp, WrapErrorsWithRateLimitInfo(codes.NotFound, resp, optErrs...) @@ -485,6 +497,14 @@ func WithHeader(key, value string) RequestOption { } } +func WithNoCache() RequestOption { + return func() (io.ReadWriter, map[string]string, error) { + return nil, map[string]string{ + "Cache-Control": "no-cache", + }, nil + } +} + func WithBody(body []byte) RequestOption { return func() (io.ReadWriter, map[string]string, error) { return bytes.NewBuffer(body), nil, nil @@ -585,7 +605,7 @@ func WithBearerToken(token string) RequestOption { func (c *BaseHttpClient) NewRequest(ctx context.Context, method string, url *url.URL, options ...RequestOption) (*http.Request, error) { var buffer io.ReadWriter - var headers map[string]string = make(map[string]string) + var headers = make(map[string]string) for _, option := range options { buf, h, err := option() if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/us3/s3.go b/vendor/github.com/conductorone/baton-sdk/pkg/us3/s3.go index 2f9f05c2..4f699815 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/us3/s3.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/us3/s3.go @@ -15,7 +15,6 @@ import ( awsSdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/arn" - _ "github.com/aws/aws-sdk-go-v2/aws/arn" awsConfig "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/credentials/stscreds" diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index de264c85..244ee19c 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -14,8 +14,34 @@ This package provides various compression algorithms. [![Go](https://github.com/klauspost/compress/actions/workflows/go.yml/badge.svg)](https://github.com/klauspost/compress/actions/workflows/go.yml) [![Sourcegraph Badge](https://sourcegraph.com/github.com/klauspost/compress/-/badge.svg)](https://sourcegraph.com/github.com/klauspost/compress?badge) +# package usage + +Use `go get github.com/klauspost/compress@latest` to add it to your project. + +This package will support the current Go version and 2 versions back. + +* Use the `nounsafe` tag to disable all use of the "unsafe" package. +* Use the `noasm` tag to disable all assembly across packages. + +Use the links above for more information on each. + # changelog +* Feb 19th, 2025 - [1.18.0](https://github.com/klauspost/compress/releases/tag/v1.18.0) + * Add unsafe little endian loaders https://github.com/klauspost/compress/pull/1036 + * fix: check `r.err != nil` but return a nil value error `err` by @alingse in https://github.com/klauspost/compress/pull/1028 + * flate: Simplify L4-6 loading https://github.com/klauspost/compress/pull/1043 + * flate: Simplify matchlen (remove asm) https://github.com/klauspost/compress/pull/1045 + * s2: Improve small block compression speed w/o asm https://github.com/klauspost/compress/pull/1048 + * flate: Fix matchlen L5+L6 https://github.com/klauspost/compress/pull/1049 + * flate: Cleanup & reduce casts https://github.com/klauspost/compress/pull/1050 + +* Oct 11th, 2024 - [1.17.11](https://github.com/klauspost/compress/releases/tag/v1.17.11) + * zstd: Fix extra CRC written with multiple Close calls https://github.com/klauspost/compress/pull/1017 + * s2: Don't use stack for index tables https://github.com/klauspost/compress/pull/1014 + * gzhttp: No content-type on no body response code by @juliens in https://github.com/klauspost/compress/pull/1011 + * gzhttp: Do not set the content-type when response has no body by @kevinpollet in https://github.com/klauspost/compress/pull/1013 + * Sep 23rd, 2024 - [1.17.10](https://github.com/klauspost/compress/releases/tag/v1.17.10) * gzhttp: Add TransportAlwaysDecompress option. https://github.com/klauspost/compress/pull/978 * gzhttp: Add supported decompress request body by @mirecl in https://github.com/klauspost/compress/pull/1002 @@ -65,9 +91,9 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Fix rare *CORRUPTION* output in "best" mode. See https://github.com/klauspost/compress/pull/876 * Oct 14th, 2023 - [v1.17.1](https://github.com/klauspost/compress/releases/tag/v1.17.1) - * s2: Fix S2 "best" dictionary wrong encoding by @klauspost in https://github.com/klauspost/compress/pull/871 + * s2: Fix S2 "best" dictionary wrong encoding https://github.com/klauspost/compress/pull/871 * flate: Reduce allocations in decompressor and minor code improvements by @fakefloordiv in https://github.com/klauspost/compress/pull/869 - * s2: Fix EstimateBlockSize on 6&7 length input by @klauspost in https://github.com/klauspost/compress/pull/867 + * s2: Fix EstimateBlockSize on 6&7 length input https://github.com/klauspost/compress/pull/867 * Sept 19th, 2023 - [v1.17.0](https://github.com/klauspost/compress/releases/tag/v1.17.0) * Add experimental dictionary builder https://github.com/klauspost/compress/pull/853 @@ -124,7 +150,7 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp See changes to v1.15.x * Jan 21st, 2023 (v1.15.15) - * deflate: Improve level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/739 + * deflate: Improve level 7-9 https://github.com/klauspost/compress/pull/739 * zstd: Add delta encoding support by @greatroar in https://github.com/klauspost/compress/pull/728 * zstd: Various speed improvements by @greatroar https://github.com/klauspost/compress/pull/741 https://github.com/klauspost/compress/pull/734 https://github.com/klauspost/compress/pull/736 https://github.com/klauspost/compress/pull/744 https://github.com/klauspost/compress/pull/743 https://github.com/klauspost/compress/pull/745 * gzhttp: Add SuffixETag() and DropETag() options to prevent ETag collisions on compressed responses by @willbicks in https://github.com/klauspost/compress/pull/740 @@ -167,7 +193,7 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Fix decoder crash on amd64 (no BMI) on invalid input https://github.com/klauspost/compress/pull/645 * zstd: Disable decoder extended memory copies (amd64) due to possible crashes https://github.com/klauspost/compress/pull/644 - * zstd: Allow single segments up to "max decoded size" by @klauspost in https://github.com/klauspost/compress/pull/643 + * zstd: Allow single segments up to "max decoded size" https://github.com/klauspost/compress/pull/643 * July 13, 2022 (v1.15.8) @@ -209,7 +235,7 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Speed up when WithDecoderLowmem(false) https://github.com/klauspost/compress/pull/599 * zstd: faster next state update in BMI2 version of decode by @WojciechMula in https://github.com/klauspost/compress/pull/593 * huff0: Do not check max size when reading table. https://github.com/klauspost/compress/pull/586 - * flate: Inplace hashing for level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/590 + * flate: Inplace hashing for level 7-9 https://github.com/klauspost/compress/pull/590 * May 11, 2022 (v1.15.4) @@ -236,12 +262,12 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Add stricter block size checks in [#523](https://github.com/klauspost/compress/pull/523) * Mar 3, 2022 (v1.15.0) - * zstd: Refactor decoder by @klauspost in [#498](https://github.com/klauspost/compress/pull/498) - * zstd: Add stream encoding without goroutines by @klauspost in [#505](https://github.com/klauspost/compress/pull/505) + * zstd: Refactor decoder [#498](https://github.com/klauspost/compress/pull/498) + * zstd: Add stream encoding without goroutines [#505](https://github.com/klauspost/compress/pull/505) * huff0: Prevent single blocks exceeding 16 bits by @klauspost in[#507](https://github.com/klauspost/compress/pull/507) - * flate: Inline literal emission by @klauspost in [#509](https://github.com/klauspost/compress/pull/509) - * gzhttp: Add zstd to transport by @klauspost in [#400](https://github.com/klauspost/compress/pull/400) - * gzhttp: Make content-type optional by @klauspost in [#510](https://github.com/klauspost/compress/pull/510) + * flate: Inline literal emission [#509](https://github.com/klauspost/compress/pull/509) + * gzhttp: Add zstd to transport [#400](https://github.com/klauspost/compress/pull/400) + * gzhttp: Make content-type optional [#510](https://github.com/klauspost/compress/pull/510) Both compression and decompression now supports "synchronous" stream operations. This means that whenever "concurrency" is set to 1, they will operate without spawning goroutines. @@ -258,7 +284,7 @@ While the release has been extensively tested, it is recommended to testing when * flate: Fix rare huffman only (-2) corruption. [#503](https://github.com/klauspost/compress/pull/503) * zip: Update deprecated CreateHeaderRaw to correctly call CreateRaw by @saracen in [#502](https://github.com/klauspost/compress/pull/502) * zip: don't read data descriptor early by @saracen in [#501](https://github.com/klauspost/compress/pull/501) #501 - * huff0: Use static decompression buffer up to 30% faster by @klauspost in [#499](https://github.com/klauspost/compress/pull/499) [#500](https://github.com/klauspost/compress/pull/500) + * huff0: Use static decompression buffer up to 30% faster [#499](https://github.com/klauspost/compress/pull/499) [#500](https://github.com/klauspost/compress/pull/500) * Feb 17, 2022 (v1.14.3) * flate: Improve fastest levels compression speed ~10% more throughput. [#482](https://github.com/klauspost/compress/pull/482) [#489](https://github.com/klauspost/compress/pull/489) [#490](https://github.com/klauspost/compress/pull/490) [#491](https://github.com/klauspost/compress/pull/491) [#494](https://github.com/klauspost/compress/pull/494) [#478](https://github.com/klauspost/compress/pull/478) @@ -565,12 +591,14 @@ While the release has been extensively tested, it is recommended to testing when The packages are drop-in replacements for standard libraries. Simply replace the import path to use them: -| old import | new import | Documentation -|--------------------|-----------------------------------------|--------------------| -| `compress/gzip` | `github.com/klauspost/compress/gzip` | [gzip](https://pkg.go.dev/github.com/klauspost/compress/gzip?tab=doc) -| `compress/zlib` | `github.com/klauspost/compress/zlib` | [zlib](https://pkg.go.dev/github.com/klauspost/compress/zlib?tab=doc) -| `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc) -| `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc) +Typical speed is about 2x of the standard library packages. + +| old import | new import | Documentation | +|------------------|---------------------------------------|-------------------------------------------------------------------------| +| `compress/gzip` | `github.com/klauspost/compress/gzip` | [gzip](https://pkg.go.dev/github.com/klauspost/compress/gzip?tab=doc) | +| `compress/zlib` | `github.com/klauspost/compress/zlib` | [zlib](https://pkg.go.dev/github.com/klauspost/compress/zlib?tab=doc) | +| `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc) | +| `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc) | * Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). @@ -625,84 +653,6 @@ This will only use up to 4KB in memory when the writer is idle. Compression is almost always worse than the fastest compression level and each write will allocate (a little) memory. -# Performance Update 2018 - -It has been a while since we have been looking at the speed of this package compared to the standard library, so I thought I would re-do my tests and give some overall recommendations based on the current state. All benchmarks have been performed with Go 1.10 on my Desktop Intel(R) Core(TM) i7-2600 CPU @3.40GHz. Since I last ran the tests, I have gotten more RAM, which means tests with big files are no longer limited by my SSD. - -The raw results are in my [updated spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). Due to cgo changes and upstream updates i could not get the cgo version of gzip to compile. Instead I included the [zstd](https://github.com/datadog/zstd) cgo implementation. If I get cgo gzip to work again, I might replace the results in the sheet. - -The columns to take note of are: *MB/s* - the throughput. *Reduction* - the data size reduction in percent of the original. *Rel Speed* relative speed compared to the standard library at the same level. *Smaller* - how many percent smaller is the compressed output compared to stdlib. Negative means the output was bigger. *Loss* means the loss (or gain) in compression as a percentage difference of the input. - -The `gzstd` (standard library gzip) and `gzkp` (this package gzip) only uses one CPU core. [`pgzip`](https://github.com/klauspost/pgzip), [`bgzf`](https://github.com/biogo/hts/tree/master/bgzf) uses all 4 cores. [`zstd`](https://github.com/DataDog/zstd) uses one core, and is a beast (but not Go, yet). - - -## Overall differences. - -There appears to be a roughly 5-10% speed advantage over the standard library when comparing at similar compression levels. - -The biggest difference you will see is the result of [re-balancing](https://blog.klauspost.com/rebalancing-deflate-compression-levels/) the compression levels. I wanted by library to give a smoother transition between the compression levels than the standard library. - -This package attempts to provide a more smooth transition, where "1" is taking a lot of shortcuts, "5" is the reasonable trade-off and "9" is the "give me the best compression", and the values in between gives something reasonable in between. The standard library has big differences in levels 1-4, but levels 5-9 having no significant gains - often spending a lot more time than can be justified by the achieved compression. - -There are links to all the test data in the [spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) in the top left field on each tab. - -## Web Content - -This test set aims to emulate typical use in a web server. The test-set is 4GB data in 53k files, and is a mixture of (mostly) HTML, JS, CSS. - -Since level 1 and 9 are close to being the same code, they are quite close. But looking at the levels in-between the differences are quite big. - -Looking at level 6, this package is 88% faster, but will output about 6% more data. For a web server, this means you can serve 88% more data, but have to pay for 6% more bandwidth. You can draw your own conclusions on what would be the most expensive for your case. - -## Object files - -This test is for typical data files stored on a server. In this case it is a collection of Go precompiled objects. They are very compressible. - -The picture is similar to the web content, but with small differences since this is very compressible. Levels 2-3 offer good speed, but is sacrificing quite a bit of compression. - -The standard library seems suboptimal on level 3 and 4 - offering both worse compression and speed than level 6 & 7 of this package respectively. - -## Highly Compressible File - -This is a JSON file with very high redundancy. The reduction starts at 95% on level 1, so in real life terms we are dealing with something like a highly redundant stream of data, etc. - -It is definitely visible that we are dealing with specialized content here, so the results are very scattered. This package does not do very well at levels 1-4, but picks up significantly at level 5 and levels 7 and 8 offering great speed for the achieved compression. - -So if you know you content is extremely compressible you might want to go slightly higher than the defaults. The standard library has a huge gap between levels 3 and 4 in terms of speed (2.75x slowdown), so it offers little "middle ground". - -## Medium-High Compressible - -This is a pretty common test corpus: [enwik9](http://mattmahoney.net/dc/textdata.html). It contains the first 10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. This is a very good test of typical text based compression and more data heavy streams. - -We see a similar picture here as in "Web Content". On equal levels some compression is sacrificed for more speed. Level 5 seems to be the best trade-off between speed and size, beating stdlib level 3 in both. - -## Medium Compressible - -I will combine two test sets, one [10GB file set](http://mattmahoney.net/dc/10gb.html) and a VM disk image (~8GB). Both contain different data types and represent a typical backup scenario. - -The most notable thing is how quickly the standard library drops to very low compression speeds around level 5-6 without any big gains in compression. Since this type of data is fairly common, this does not seem like good behavior. - - -## Un-compressible Content - -This is mainly a test of how good the algorithms are at detecting un-compressible input. The standard library only offers this feature with very conservative settings at level 1. Obviously there is no reason for the algorithms to try to compress input that cannot be compressed. The only downside is that it might skip some compressible data on false detections. - - -## Huffman only compression - -This compression library adds a special compression level, named `HuffmanOnly`, which allows near linear time compression. This is done by completely disabling matching of previous data, and only reduce the number of bits to represent each character. - -This means that often used characters, like 'e' and ' ' (space) in text use the fewest bits to represent, and rare characters like '¤' takes more bits to represent. For more information see [wikipedia](https://en.wikipedia.org/wiki/Huffman_coding) or this nice [video](https://youtu.be/ZdooBTdW5bM). - -Since this type of compression has much less variance, the compression speed is mostly unaffected by the input data, and is usually more than *180MB/s* for a single core. - -The downside is that the compression ratio is usually considerably worse than even the fastest conventional compression. The compression ratio can never be better than 8:1 (12.5%). - -The linear time compression can be used as a "better than nothing" mode, where you cannot risk the encoder to slow down on some content. For comparison, the size of the "Twain" text is *233460 bytes* (+29% vs. level 1) and encode speed is 144MB/s (4.5x level 1). So in this case you trade a 30% size increase for a 4 times speedup. - -For more information see my blog post on [Fast Linear Time Compression](http://blog.klauspost.com/constant-time-gzipzip-compression/). - -This is implemented on Go 1.7 as "Huffman Only" mode, though not exposed for gzip. # Other packages diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go index e36d9742..bfc7a523 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitreader.go +++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -6,10 +6,11 @@ package huff0 import ( - "encoding/binary" "errors" "fmt" "io" + + "github.com/klauspost/compress/internal/le" ) // bitReader reads a bitstream in reverse. @@ -46,7 +47,7 @@ func (b *bitReaderBytes) init(in []byte) error { return nil } -// peekBitsFast requires that at least one bit is requested every time. +// peekByteFast requires that at least one byte is requested every time. // There are no checks if the buffer is filled. func (b *bitReaderBytes) peekByteFast() uint8 { got := uint8(b.value >> 56) @@ -66,8 +67,7 @@ func (b *bitReaderBytes) fillFast() { } // 2 bounds checks. - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << (b.bitsRead - 32) b.bitsRead -= 32 b.off -= 4 @@ -76,7 +76,7 @@ func (b *bitReaderBytes) fillFast() { // fillFastStart() assumes the bitReaderBytes is empty and there is at least 8 bytes to read. func (b *bitReaderBytes) fillFastStart() { // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.value = le.Load64(b.in, b.off-8) b.bitsRead = 0 b.off -= 8 } @@ -86,9 +86,8 @@ func (b *bitReaderBytes) fill() { if b.bitsRead < 32 { return } - if b.off > 4 { - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + if b.off >= 4 { + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << (b.bitsRead - 32) b.bitsRead -= 32 b.off -= 4 @@ -175,9 +174,7 @@ func (b *bitReaderShifted) fillFast() { return } - // 2 bounds checks. - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << ((b.bitsRead - 32) & 63) b.bitsRead -= 32 b.off -= 4 @@ -185,8 +182,7 @@ func (b *bitReaderShifted) fillFast() { // fillFastStart() assumes the bitReaderShifted is empty and there is at least 8 bytes to read. func (b *bitReaderShifted) fillFastStart() { - // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.value = le.Load64(b.in, b.off-8) b.bitsRead = 0 b.off -= 8 } @@ -197,8 +193,7 @@ func (b *bitReaderShifted) fill() { return } if b.off > 4 { - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << ((b.bitsRead - 32) & 63) b.bitsRead -= 32 b.off -= 4 diff --git a/vendor/github.com/klauspost/compress/internal/le/le.go b/vendor/github.com/klauspost/compress/internal/le/le.go new file mode 100644 index 00000000..e54909e1 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/le/le.go @@ -0,0 +1,5 @@ +package le + +type Indexer interface { + int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 +} diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go new file mode 100644 index 00000000..0cfb5c0e --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go @@ -0,0 +1,42 @@ +//go:build !(amd64 || arm64 || ppc64le || riscv64) || nounsafe || purego || appengine + +package le + +import ( + "encoding/binary" +) + +// Load8 will load from b at index i. +func Load8[I Indexer](b []byte, i I) byte { + return b[i] +} + +// Load16 will load from b at index i. +func Load16[I Indexer](b []byte, i I) uint16 { + return binary.LittleEndian.Uint16(b[i:]) +} + +// Load32 will load from b at index i. +func Load32[I Indexer](b []byte, i I) uint32 { + return binary.LittleEndian.Uint32(b[i:]) +} + +// Load64 will load from b at index i. +func Load64[I Indexer](b []byte, i I) uint64 { + return binary.LittleEndian.Uint64(b[i:]) +} + +// Store16 will store v at b. +func Store16(b []byte, v uint16) { + binary.LittleEndian.PutUint16(b, v) +} + +// Store32 will store v at b. +func Store32(b []byte, v uint32) { + binary.LittleEndian.PutUint32(b, v) +} + +// Store64 will store v at b. +func Store64(b []byte, v uint64) { + binary.LittleEndian.PutUint64(b, v) +} diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go new file mode 100644 index 00000000..ada45cd9 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go @@ -0,0 +1,55 @@ +// We enable 64 bit LE platforms: + +//go:build (amd64 || arm64 || ppc64le || riscv64) && !nounsafe && !purego && !appengine + +package le + +import ( + "unsafe" +) + +// Load8 will load from b at index i. +func Load8[I Indexer](b []byte, i I) byte { + //return binary.LittleEndian.Uint16(b[i:]) + //return *(*uint16)(unsafe.Pointer(&b[i])) + return *(*byte)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Load16 will load from b at index i. +func Load16[I Indexer](b []byte, i I) uint16 { + //return binary.LittleEndian.Uint16(b[i:]) + //return *(*uint16)(unsafe.Pointer(&b[i])) + return *(*uint16)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Load32 will load from b at index i. +func Load32[I Indexer](b []byte, i I) uint32 { + //return binary.LittleEndian.Uint32(b[i:]) + //return *(*uint32)(unsafe.Pointer(&b[i])) + return *(*uint32)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Load64 will load from b at index i. +func Load64[I Indexer](b []byte, i I) uint64 { + //return binary.LittleEndian.Uint64(b[i:]) + //return *(*uint64)(unsafe.Pointer(&b[i])) + return *(*uint64)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Store16 will store v at b. +func Store16(b []byte, v uint16) { + //binary.LittleEndian.PutUint16(b, v) + *(*uint16)(unsafe.Pointer(unsafe.SliceData(b))) = v +} + +// Store32 will store v at b. +func Store32(b []byte, v uint32) { + //binary.LittleEndian.PutUint32(b, v) + *(*uint32)(unsafe.Pointer(unsafe.SliceData(b))) = v +} + +// Store64 will store v at b. +func Store64(b []byte, v uint64) { + //binary.LittleEndian.PutUint64(b, v) + *(*uint64)(unsafe.Pointer(unsafe.SliceData(b))) = v +} diff --git a/vendor/github.com/klauspost/compress/s2sx.mod b/vendor/github.com/klauspost/compress/s2sx.mod index 5a4412f9..81bda5e2 100644 --- a/vendor/github.com/klauspost/compress/s2sx.mod +++ b/vendor/github.com/klauspost/compress/s2sx.mod @@ -1,4 +1,3 @@ module github.com/klauspost/compress -go 1.19 - +go 1.22 diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index 92e2347b..c11d7fa2 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -6,7 +6,7 @@ A high performance compression algorithm is implemented. For now focused on spee This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content. -This package is pure Go and without use of "unsafe". +This package is pure Go. Use `noasm` and `nounsafe` to disable relevant features. The `zstd` package is provided as open source software using a Go standard license. diff --git a/vendor/github.com/klauspost/compress/zstd/bitreader.go b/vendor/github.com/klauspost/compress/zstd/bitreader.go index 25ca9839..d41e3e17 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitreader.go +++ b/vendor/github.com/klauspost/compress/zstd/bitreader.go @@ -5,11 +5,12 @@ package zstd import ( - "encoding/binary" "errors" "fmt" "io" "math/bits" + + "github.com/klauspost/compress/internal/le" ) // bitReader reads a bitstream in reverse. @@ -18,6 +19,7 @@ import ( type bitReader struct { in []byte value uint64 // Maybe use [16]byte, but shifting is awkward. + cursor int // offset where next read should end bitsRead uint8 } @@ -32,6 +34,7 @@ func (b *bitReader) init(in []byte) error { if v == 0 { return errors.New("corrupt stream, did not find end of stream") } + b.cursor = len(in) b.bitsRead = 64 b.value = 0 if len(in) >= 8 { @@ -67,18 +70,15 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - v := b.in[len(b.in)-4:] - b.in = b.in[:len(b.in)-4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value = (b.value << 32) | uint64(low) + b.cursor -= 4 + b.value = (b.value << 32) | uint64(le.Load32(b.in, b.cursor)) b.bitsRead -= 32 } // fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. func (b *bitReader) fillFastStart() { - v := b.in[len(b.in)-8:] - b.in = b.in[:len(b.in)-8] - b.value = binary.LittleEndian.Uint64(v) + b.cursor -= 8 + b.value = le.Load64(b.in, b.cursor) b.bitsRead = 0 } @@ -87,25 +87,23 @@ func (b *bitReader) fill() { if b.bitsRead < 32 { return } - if len(b.in) >= 4 { - v := b.in[len(b.in)-4:] - b.in = b.in[:len(b.in)-4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value = (b.value << 32) | uint64(low) + if b.cursor >= 4 { + b.cursor -= 4 + b.value = (b.value << 32) | uint64(le.Load32(b.in, b.cursor)) b.bitsRead -= 32 return } - b.bitsRead -= uint8(8 * len(b.in)) - for len(b.in) > 0 { - b.value = (b.value << 8) | uint64(b.in[len(b.in)-1]) - b.in = b.in[:len(b.in)-1] + b.bitsRead -= uint8(8 * b.cursor) + for b.cursor > 0 { + b.cursor -= 1 + b.value = (b.value << 8) | uint64(b.in[b.cursor]) } } // finished returns true if all bits have been read from the bit stream. func (b *bitReader) finished() bool { - return len(b.in) == 0 && b.bitsRead >= 64 + return b.cursor == 0 && b.bitsRead >= 64 } // overread returns true if more bits have been requested than is on the stream. @@ -115,13 +113,14 @@ func (b *bitReader) overread() bool { // remain returns the number of bits remaining. func (b *bitReader) remain() uint { - return 8*uint(len(b.in)) + 64 - uint(b.bitsRead) + return 8*uint(b.cursor) + 64 - uint(b.bitsRead) } // close the bitstream and returns an error if out-of-buffer reads occurred. func (b *bitReader) close() error { // Release reference. b.in = nil + b.cursor = 0 if !b.finished() { return fmt.Errorf("%d extra bits on block, should be 0", b.remain()) } diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index 9c28840c..0dd742fd 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -5,14 +5,10 @@ package zstd import ( - "bytes" - "encoding/binary" "errors" "fmt" "hash/crc32" "io" - "os" - "path/filepath" "sync" "github.com/klauspost/compress/huff0" @@ -648,21 +644,6 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { println("initializing sequences:", err) return err } - // Extract blocks... - if false && hist.dict == nil { - fatalErr := func(err error) { - if err != nil { - panic(err) - } - } - fn := fmt.Sprintf("n-%d-lits-%d-prev-%d-%d-%d-win-%d.blk", hist.decoders.nSeqs, len(hist.decoders.literals), hist.recentOffsets[0], hist.recentOffsets[1], hist.recentOffsets[2], hist.windowSize) - var buf bytes.Buffer - fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.litLengths.fse)) - fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.matchLengths.fse)) - fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.offsets.fse)) - buf.Write(in) - os.WriteFile(filepath.Join("testdata", "seqs", fn), buf.Bytes(), os.ModePerm) - } return nil } diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go index 32a7f401..fd35ea14 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockenc.go +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -9,6 +9,7 @@ import ( "fmt" "math" "math/bits" + "slices" "github.com/klauspost/compress/huff0" ) @@ -457,16 +458,7 @@ func fuzzFseEncoder(data []byte) int { // All 0 return 0 } - maxCount := func(a []uint32) int { - var max uint32 - for _, v := range a { - if v > max { - max = v - } - } - return int(max) - } - cnt := maxCount(hist[:maxSym]) + cnt := int(slices.Max(hist[:maxSym])) if cnt == len(data) { // RLE return 0 @@ -884,15 +876,6 @@ func (b *blockEnc) genCodes() { } } } - maxCount := func(a []uint32) int { - var max uint32 - for _, v := range a { - if v > max { - max = v - } - } - return int(max) - } if debugAsserts && mlMax > maxMatchLengthSymbol { panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d)", mlMax)) } @@ -903,7 +886,7 @@ func (b *blockEnc) genCodes() { panic(fmt.Errorf("llMax > maxLiteralLengthSymbol (%d)", llMax)) } - b.coders.mlEnc.HistogramFinished(mlMax, maxCount(mlH[:mlMax+1])) - b.coders.ofEnc.HistogramFinished(ofMax, maxCount(ofH[:ofMax+1])) - b.coders.llEnc.HistogramFinished(llMax, maxCount(llH[:llMax+1])) + b.coders.mlEnc.HistogramFinished(mlMax, int(slices.Max(mlH[:mlMax+1]))) + b.coders.ofEnc.HistogramFinished(ofMax, int(slices.Max(ofH[:ofMax+1]))) + b.coders.llEnc.HistogramFinished(llMax, int(slices.Max(llH[:llMax+1]))) } diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index bbca1723..ea2a1937 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -123,7 +123,7 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { } // Read bytes from the decompressed stream into p. -// Returns the number of bytes written and any error that occurred. +// Returns the number of bytes read and any error that occurred. // When the stream is done, io.EOF will be returned. func (d *Decoder) Read(p []byte) (int, error) { var n int @@ -323,6 +323,7 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { frame.bBuf = nil if frame.history.decoders.br != nil { frame.history.decoders.br.in = nil + frame.history.decoders.br.cursor = 0 } d.decoders <- block }() diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go index 5ca46038..7d250c67 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -116,7 +116,7 @@ func (e *fastBase) matchlen(s, t int32, src []byte) int32 { panic(err) } if t < 0 { - err := fmt.Sprintf("s (%d) < 0", s) + err := fmt.Sprintf("t (%d) < 0", t) panic(err) } if s-t > e.maxMatchOff { diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go index 57b9c31c..bea1779e 100644 --- a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go @@ -7,20 +7,25 @@ package zstd import ( - "encoding/binary" "math/bits" + + "github.com/klauspost/compress/internal/le" ) // matchLen returns the maximum common prefix length of a and b. // a must be the shortest of the two. func matchLen(a, b []byte) (n int) { - for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { - diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) + left := len(a) + for left >= 8 { + diff := le.Load64(a, n) ^ le.Load64(b, n) if diff != 0 { return n + bits.TrailingZeros64(diff)>>3 } n += 8 + left -= 8 } + a = a[n:] + b = b[n:] for i := range a { if a[i] != b[i] { diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index d7fe6d82..9a7de82f 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -245,7 +245,7 @@ func (s *sequenceDecs) decodeSync(hist []byte) error { return io.ErrUnexpectedEOF } var ll, mo, ml int - if len(br.in) > 4+((maxOffsetBits+16+16)>>3) { + if br.cursor > 4+((maxOffsetBits+16+16)>>3) { // inlined function: // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s index f5591fa1..a708ca6d 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s @@ -7,9 +7,9 @@ TEXT ·sequenceDecs_decode_amd64(SB), $8-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -299,8 +299,8 @@ sequenceDecs_decode_amd64_match_len_ofs_ok: MOVQ R13, 160(AX) MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -335,9 +335,9 @@ error_overread: TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -598,8 +598,8 @@ sequenceDecs_decode_56_amd64_match_len_ofs_ok: MOVQ R13, 160(AX) MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -634,9 +634,9 @@ error_overread: TEXT ·sequenceDecs_decode_bmi2(SB), $8-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -884,8 +884,8 @@ sequenceDecs_decode_bmi2_match_len_ofs_ok: MOVQ R12, 160(CX) MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -920,9 +920,9 @@ error_overread: TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -1141,8 +1141,8 @@ sequenceDecs_decode_56_bmi2_match_len_ofs_ok: MOVQ R12, 160(CX) MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -1787,9 +1787,9 @@ empty_seqs: TEXT ·sequenceDecs_decodeSync_amd64(SB), $64-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -2281,8 +2281,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Update the context MOVQ ctx+16(FP), AX @@ -2349,9 +2349,9 @@ error_not_enough_space: TEXT ·sequenceDecs_decodeSync_bmi2(SB), $64-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -2801,8 +2801,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Update the context MOVQ ctx+16(FP), AX @@ -2869,9 +2869,9 @@ error_not_enough_space: TEXT ·sequenceDecs_decodeSync_safe_amd64(SB), $64-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -3465,8 +3465,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Update the context MOVQ ctx+16(FP), AX @@ -3533,9 +3533,9 @@ error_not_enough_space: TEXT ·sequenceDecs_decodeSync_safe_bmi2(SB), $64-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -4087,8 +4087,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Update the context MOVQ ctx+16(FP), AX diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go index 2fb35b78..7cec2197 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go @@ -29,7 +29,7 @@ func (s *sequenceDecs) decode(seqs []seqVals) error { } for i := range seqs { var ll, mo, ml int - if len(br.in) > 4+((maxOffsetBits+16+16)>>3) { + if br.cursor > 4+((maxOffsetBits+16+16)>>3) { // inlined function: // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) diff --git a/vendor/github.com/klauspost/compress/zstd/seqenc.go b/vendor/github.com/klauspost/compress/zstd/seqenc.go index 8014174a..65045eab 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqenc.go +++ b/vendor/github.com/klauspost/compress/zstd/seqenc.go @@ -69,7 +69,6 @@ var llBitsTable = [maxLLCode + 1]byte{ func llCode(litLength uint32) uint8 { const llDeltaCode = 19 if litLength <= 63 { - // Compiler insists on bounds check (Go 1.12) return llCodeTable[litLength&63] } return uint8(highBit(litLength)) + llDeltaCode @@ -102,7 +101,6 @@ var mlBitsTable = [maxMLCode + 1]byte{ func mlCode(mlBase uint32) uint8 { const mlDeltaCode = 36 if mlBase <= 127 { - // Compiler insists on bounds check (Go 1.12) return mlCodeTable[mlBase&127] } return uint8(highBit(mlBase)) + mlDeltaCode diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go index ec13594e..a17381b8 100644 --- a/vendor/github.com/klauspost/compress/zstd/snappy.go +++ b/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -197,7 +197,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { n, r.err = w.Write(r.block.output) if r.err != nil { - return written, err + return written, r.err } written += int64(n) continue @@ -239,7 +239,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { } n, r.err = w.Write(r.block.output) if r.err != nil { - return written, err + return written, r.err } written += int64(n) continue diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index 066bef2a..6252b46a 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -5,10 +5,11 @@ package zstd import ( "bytes" - "encoding/binary" "errors" "log" "math" + + "github.com/klauspost/compress/internal/le" ) // enable debug printing @@ -110,11 +111,11 @@ func printf(format string, a ...interface{}) { } func load3232(b []byte, i int32) uint32 { - return binary.LittleEndian.Uint32(b[:len(b):len(b)][i:]) + return le.Load32(b, i) } func load6432(b []byte, i int32) uint64 { - return binary.LittleEndian.Uint64(b[:len(b):len(b)][i:]) + return le.Load64(b, i) } type byter interface { diff --git a/vendor/modules.txt b/vendor/modules.txt index a64847a8..fc9ee79c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -156,8 +156,8 @@ github.com/benbjohnson/clock # github.com/cenkalti/backoff/v4 v4.3.0 ## explicit; go 1.18 github.com/cenkalti/backoff/v4 -# github.com/conductorone/baton-sdk v0.3.30 -## explicit; go 1.23.4 +# github.com/conductorone/baton-sdk v0.4.2 +## explicit; go 1.25 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 github.com/conductorone/baton-sdk/pb/c1/config/v1 @@ -194,9 +194,12 @@ github.com/conductorone/baton-sdk/pkg/provisioner github.com/conductorone/baton-sdk/pkg/ratelimit github.com/conductorone/baton-sdk/pkg/retry github.com/conductorone/baton-sdk/pkg/sdk +github.com/conductorone/baton-sdk/pkg/session github.com/conductorone/baton-sdk/pkg/sync github.com/conductorone/baton-sdk/pkg/sync/expand +github.com/conductorone/baton-sdk/pkg/sync/expand/scc github.com/conductorone/baton-sdk/pkg/synccompactor +github.com/conductorone/baton-sdk/pkg/synccompactor/attached github.com/conductorone/baton-sdk/pkg/synccompactor/naive github.com/conductorone/baton-sdk/pkg/tasks github.com/conductorone/baton-sdk/pkg/tasks/c1api @@ -333,12 +336,13 @@ github.com/inconshreveable/mousetrap # github.com/jellydator/ttlcache/v3 v3.3.0 ## explicit; go 1.18 github.com/jellydator/ttlcache/v3 -# github.com/klauspost/compress v1.17.11 -## explicit; go 1.21 +# github.com/klauspost/compress v1.18.0 +## explicit; go 1.22 github.com/klauspost/compress github.com/klauspost/compress/fse github.com/klauspost/compress/huff0 github.com/klauspost/compress/internal/cpuinfo +github.com/klauspost/compress/internal/le github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash From a8f0d5ad2621d746acb7ea26cc20eed98130046d Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Mon, 22 Sep 2025 17:14:43 -0700 Subject: [PATCH 2/3] Add a CI test. --- .github/workflows/ci.yaml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 31027cc3..65e26c94 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,4 +34,25 @@ jobs: if: always() uses: guyarb/golang-test-annotations@v0.6.0 with: - test-results: test.json \ No newline at end of file + test-results: test.json + ci: + runs-on: ubuntu-latest + env: + BATON_LOG_LEVEL: debug + BATON_TOKEN: ${{ github.token }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - name: Build baton-github + run: go build ./cmd/baton-github + - name: Grant/revoke + uses: ConductorOne/github-workflows/actions/sync-test@v2 + with: + connector: ./baton-github + baton-entitlement: 'repository:642588514:triage' + baton-principal: '190765094' + baton-principal-type: 'user' \ No newline at end of file From 4d4718bd8f62dba8592bd6c4a6047ff4fc4b998c Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Mon, 22 Sep 2025 17:17:30 -0700 Subject: [PATCH 3/3] Fix CI test. --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 65e26c94..1e57e426 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,8 +38,8 @@ jobs: ci: runs-on: ubuntu-latest env: - BATON_LOG_LEVEL: debug - BATON_TOKEN: ${{ github.token }} + BATON_TOKEN: ${{ secrets.BATON_TOKEN }} + BATON_ORGS: ConductorOne steps: - name: Checkout code uses: actions/checkout@v4 @@ -54,5 +54,5 @@ jobs: with: connector: ./baton-github baton-entitlement: 'repository:642588514:triage' - baton-principal: '190765094' + baton-principal: '166871869' baton-principal-type: 'user' \ No newline at end of file