diff --git a/go.mod b/go.mod index 7bc29efd..b15bd30d 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,13 @@ module github.com/conductorone/baton-postgresql go 1.23.4 require ( - github.com/conductorone/baton-sdk v0.2.93 + github.com/conductorone/baton-sdk v0.3.10 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/georgysavva/scany v1.2.2 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/jackc/pgconn v1.14.3 github.com/jackc/pgx/v4 v4.18.3 github.com/quasilyte/go-ruleguard/dsl v0.3.22 - github.com/spf13/viper v1.19.0 go.uber.org/zap v1.27.0 ) @@ -91,6 +90,7 @@ require ( github.com/spf13/cast v1.7.1 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.9.0 // indirect diff --git a/go.sum b/go.sum index ce713d2d..2c7245f0 100644 --- a/go.sum +++ b/go.sum @@ -63,8 +63,8 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go/v2 v2.2.0 h1:/5znzg5n373N/3ESjHF5SMLxiW4RKB05Ql//KWfeTFs= github.com/cockroachdb/cockroach-go/v2 v2.2.0/go.mod h1:u3MiKYGupPPjkn3ozknpMUpxPaNLTFWAya419/zv6eI= -github.com/conductorone/baton-sdk v0.2.93 h1:zAj0CdZ0T9EcwDD0S26QBOJABp9KR8em4G5LCj3CSbw= -github.com/conductorone/baton-sdk v0.2.93/go.mod h1:nUgHSAf9P0lfamti5NlOSpeh1t99UNzMjIwf0I7n4/g= +github.com/conductorone/baton-sdk v0.3.10 h1:e1J0Y2knHTbzn9bAsjElmhv5lRpYwI6ixw0Ak+gx0JY= +github.com/conductorone/baton-sdk v0.3.10/go.mod h1:lWZHgu025Rsgs5jvBrhilGti0zWF2+YfaFY/bWOS/g0= 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= diff --git a/pkg/config/config.go b/pkg/config/config.go index 4e01ced5..1fc676b6 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -5,16 +5,46 @@ import ( ) var ( - dsn = field.StringField("dsn", field.WithRequired(true), field.WithDescription("The DSN to connect to the database")) - schemas = field.StringSliceField("schemas", field.WithDefaultValue([]string{"public"}), field.WithDescription("The schemas to include in the sync")) - includeColumns = field.BoolField("include-columns", field.WithDescription("Include column privileges when syncing. This can result in large amounts of data")) - includeLargeObjects = field.BoolField("include-large-objects", field.WithDescription("Include large objects when syncing. This can result in large amounts of data")) - syncAllDatabases = field.BoolField("sync-all-databases", field.WithDescription("Sync all databases. This can result in large amounts of data"), field.WithDefaultValue(false)) + dsn = field.StringField( + "dsn", + field.WithDisplayName("DSN"), + field.WithRequired(true), + field.WithDescription("The DSN to connect to the database"), + field.WithIsSecret(true), + ) + schemas = field.StringSliceField( + "schemas", + field.WithDisplayName("Schemas"), + field.WithDefaultValue([]string{"public"}), + field.WithDescription("The schemas to include in the sync"), + ) + includeColumns = field.BoolField( + "include-columns", + field.WithDisplayName("Include Columns"), + field.WithDescription("Include column privileges when syncing. This can result in large amounts of data"), + ) + includeLargeObjects = field.BoolField( + "include-large-objects", + field.WithDisplayName("Include Large Objects"), + field.WithDescription("Include large objects when syncing. This can result in large amounts of data"), + ) + syncAllDatabases = field.BoolField( + "sync-all-databases", + field.WithDisplayName("Sync All Databases"), + field.WithDescription("Sync all databases. This can result in large amounts of data"), + field.WithDefaultValue(false), + ) ) -var relationships = []field.SchemaFieldRelationship{} - //go:generate go run ./gen -var Config = field.NewConfiguration([]field.SchemaField{ - dsn, schemas, includeColumns, includeLargeObjects, syncAllDatabases, -}, relationships...) +var Config = field.NewConfiguration( + []field.SchemaField{ + dsn, + schemas, + includeColumns, + includeLargeObjects, + syncAllDatabases, + }, + field.WithConnectorDisplayName("PostgreSQL"), + field.WithHelpUrl("/docs/baton/postgresql"), +) 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 19229226..45642ad3 100644 --- a/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go +++ b/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go @@ -35,6 +35,7 @@ const listenerFdEnv = "BATON_CONNECTOR_SERVICE_LISTENER_FD" type connectorClient struct { connectorV2.ResourceTypesServiceClient connectorV2.ResourcesServiceClient + connectorV2.ResourceGetterServiceClient connectorV2.EntitlementsServiceClient connectorV2.GrantsServiceClient connectorV2.ConnectorServiceClient @@ -55,13 +56,14 @@ var ErrConnectorNotImplemented = errors.New("client does not implement connector type wrapper struct { mtx sync.RWMutex - server types.ConnectorServer - client types.ConnectorClient - serverStdin io.WriteCloser - conn *grpc.ClientConn - provisioningEnabled bool - ticketingEnabled bool - fullSyncDisabled bool + server types.ConnectorServer + client types.ConnectorClient + serverStdin io.WriteCloser + conn *grpc.ClientConn + provisioningEnabled bool + ticketingEnabled bool + fullSyncDisabled bool + targetedSyncResourceIDs []string rateLimiter ratelimitV1.RateLimiterServiceServer rlCfg *ratelimitV1.RateLimiterConfig @@ -115,6 +117,13 @@ func WithTicketingEnabled() Option { } } +func WithTargetedSyncResourceIDs(resourceIDs []string) Option { + return func(ctx context.Context, w *wrapper) error { + w.targetedSyncResourceIDs = resourceIDs + return nil + } +} + // NewConnectorWrapper returns a connector wrapper for running connector services locally. func NewWrapper(ctx context.Context, server interface{}, opts ...Option) (*wrapper, error) { connectorServer, isServer := server.(types.ConnectorServer) @@ -372,6 +381,7 @@ func Register(ctx context.Context, s grpc.ServiceRegistrar, srv types.ConnectorS connectorV2.RegisterResourceTypesServiceServer(s, srv) connectorV2.RegisterAssetServiceServer(s, srv) connectorV2.RegisterEventServiceServer(s, srv) + connectorV2.RegisterResourceGetterServiceServer(s, srv) if opts.TicketingEnabled { connectorV2.RegisterTicketsServiceServer(s, srv) @@ -421,5 +431,6 @@ func NewConnectorClient(ctx context.Context, cc grpc.ClientConnInterface) types. EventServiceClient: connectorV2.NewEventServiceClient(cc), TicketsServiceClient: connectorV2.NewTicketsServiceClient(cc), ActionServiceClient: connectorV2.NewActionServiceClient(cc), + ResourceGetterServiceClient: connectorV2.NewResourceGetterServiceClient(cc), } } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go index ac5856b5..ebbf484a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go @@ -133,16 +133,18 @@ func (StringFieldType) EnumDescriptor() ([]byte, []int) { } type Configuration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Fields []*Field `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` - Constraints []*Constraint `protobuf:"bytes,2,rep,name=constraints,proto3" json:"constraints,omitempty"` - DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - HelpUrl string `protobuf:"bytes,4,opt,name=help_url,json=helpUrl,proto3" json:"help_url,omitempty"` - IconUrl string `protobuf:"bytes,5,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` - IsDirectory bool `protobuf:"varint,7,opt,name=is_directory,json=isDirectory,proto3" json:"is_directory,omitempty"` - CatalogId string `protobuf:"bytes,8,opt,name=catalog_id,json=catalogId,proto3" json:"catalog_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Fields []*Field `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` + Constraints []*Constraint `protobuf:"bytes,2,rep,name=constraints,proto3" json:"constraints,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + HelpUrl string `protobuf:"bytes,4,opt,name=help_url,json=helpUrl,proto3" json:"help_url,omitempty"` + IconUrl string `protobuf:"bytes,5,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` + IsDirectory bool `protobuf:"varint,7,opt,name=is_directory,json=isDirectory,proto3" json:"is_directory,omitempty"` + CatalogId string `protobuf:"bytes,8,opt,name=catalog_id,json=catalogId,proto3" json:"catalog_id,omitempty"` + SupportsExternalResources bool `protobuf:"varint,9,opt,name=supports_external_resources,json=supportsExternalResources,proto3" json:"supports_external_resources,omitempty"` + RequiresExternalConnector bool `protobuf:"varint,10,opt,name=requires_external_connector,json=requiresExternalConnector,proto3" json:"requires_external_connector,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Configuration) Reset() { @@ -224,6 +226,20 @@ func (x *Configuration) GetCatalogId() string { return "" } +func (x *Configuration) GetSupportsExternalResources() bool { + if x != nil { + return x.SupportsExternalResources + } + return false +} + +func (x *Configuration) GetRequiresExternalConnector() bool { + if x != nil { + return x.RequiresExternalConnector + } + return false +} + type Constraint struct { state protoimpl.MessageState `protogen:"open.v1"` Kind ConstraintKind `protobuf:"varint,1,opt,name=kind,proto3,enum=c1.config.v1.ConstraintKind" json:"kind,omitempty"` @@ -849,7 +865,7 @@ var file_c1_config_v1_config_proto_rawDesc = string([]byte{ 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, - 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x03, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x3a, 0x0a, @@ -866,7 +882,15 @@ var file_c1_config_v1_config_proto_rawDesc = string([]byte{ 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x74, 0x61, 0x6c, - 0x6f, 0x67, 0x49, 0x64, 0x22, 0xea, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, + 0x6f, 0x67, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x1b, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, + 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x1b, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, + 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x72, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x22, 0xea, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x52, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go index c97b1e8f..e2114f8d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go @@ -135,6 +135,10 @@ func (m *Configuration) validate(all bool) error { // no validation rules for CatalogId + // no validation rules for SupportsExternalResources + + // no validation rules for RequiresExternalConnector + if len(errors) > 0 { return ConfigurationMultiError(errors) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_raw_id.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_raw_id.pb.go new file mode 100644 index 00000000..72063239 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_raw_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_raw_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) +) + +// Raw ID from whatever API the resource/entitlement/grant came from. +type RawId 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 *RawId) Reset() { + *x = RawId{} + mi := &file_c1_connector_v2_annotation_raw_id_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RawId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RawId) ProtoMessage() {} + +func (x *RawId) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_raw_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 RawId.ProtoReflect.Descriptor instead. +func (*RawId) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_annotation_raw_id_proto_rawDescGZIP(), []int{0} +} + +func (x *RawId) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +var File_c1_connector_v2_annotation_raw_id_proto protoreflect.FileDescriptor + +var file_c1_connector_v2_annotation_raw_id_proto_rawDesc = string([]byte{ + 0x0a, 0x27, 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, 0x72, 0x61, 0x77, + 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, 0x17, 0x0a, 0x05, 0x52, 0x61, + 0x77, 0x49, 0x64, 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_raw_id_proto_rawDescOnce sync.Once + file_c1_connector_v2_annotation_raw_id_proto_rawDescData []byte +) + +func file_c1_connector_v2_annotation_raw_id_proto_rawDescGZIP() []byte { + file_c1_connector_v2_annotation_raw_id_proto_rawDescOnce.Do(func() { + file_c1_connector_v2_annotation_raw_id_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_raw_id_proto_rawDesc), len(file_c1_connector_v2_annotation_raw_id_proto_rawDesc))) + }) + return file_c1_connector_v2_annotation_raw_id_proto_rawDescData +} + +var file_c1_connector_v2_annotation_raw_id_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_c1_connector_v2_annotation_raw_id_proto_goTypes = []any{ + (*RawId)(nil), // 0: c1.connector.v2.RawId +} +var file_c1_connector_v2_annotation_raw_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_raw_id_proto_init() } +func file_c1_connector_v2_annotation_raw_id_proto_init() { + if File_c1_connector_v2_annotation_raw_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_raw_id_proto_rawDesc), len(file_c1_connector_v2_annotation_raw_id_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_c1_connector_v2_annotation_raw_id_proto_goTypes, + DependencyIndexes: file_c1_connector_v2_annotation_raw_id_proto_depIdxs, + MessageInfos: file_c1_connector_v2_annotation_raw_id_proto_msgTypes, + }.Build() + File_c1_connector_v2_annotation_raw_id_proto = out.File + file_c1_connector_v2_annotation_raw_id_proto_goTypes = nil + file_c1_connector_v2_annotation_raw_id_proto_depIdxs = nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_raw_id.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_raw_id.pb.validate.go new file mode 100644 index 00000000..f2bb5688 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_raw_id.pb.validate.go @@ -0,0 +1,136 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: c1/connector/v2/annotation_raw_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 RawId 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 *RawId) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RawId 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 RawIdMultiError, or nil if none found. +func (m *RawId) ValidateAll() error { + return m.validate(true) +} + +func (m *RawId) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return RawIdMultiError(errors) + } + + return nil +} + +// RawIdMultiError is an error wrapping multiple validation errors returned by +// RawId.ValidateAll() if the designated constraints aren't met. +type RawIdMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RawIdMultiError) 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 RawIdMultiError) AllErrors() []error { return m } + +// RawIdValidationError is the validation error returned by RawId.Validate if +// the designated constraints aren't met. +type RawIdValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RawIdValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RawIdValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RawIdValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RawIdValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RawIdValidationError) ErrorName() string { return "RawIdValidationError" } + +// Error satisfies the builtin error interface +func (e RawIdValidationError) 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 %sRawId.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RawIdValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RawIdValidationError{} 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 51436ad9..3027d370 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 @@ -38,6 +38,8 @@ const ( Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 Capability_CAPABILITY_SYNC_SECRETS Capability = 9 Capability_CAPABILITY_ACTIONS Capability = 10 + Capability_CAPABILITY_TARGETED_SYNC Capability = 11 + Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 ) // Enum value maps for Capability. @@ -54,6 +56,8 @@ var ( 8: "CAPABILITY_RESOURCE_DELETE", 9: "CAPABILITY_SYNC_SECRETS", 10: "CAPABILITY_ACTIONS", + 11: "CAPABILITY_TARGETED_SYNC", + 12: "CAPABILITY_EVENT_FEED_V2", } Capability_value = map[string]int32{ "CAPABILITY_UNSPECIFIED": 0, @@ -67,6 +71,8 @@ var ( "CAPABILITY_RESOURCE_DELETE": 8, "CAPABILITY_SYNC_SECRETS": 9, "CAPABILITY_ACTIONS": 10, + "CAPABILITY_TARGETED_SYNC": 11, + "CAPABILITY_EVENT_FEED_V2": 12, } ) @@ -1470,7 +1476,7 @@ var file_c1_connector_v2_connector_proto_rawDesc = string([]byte{ 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, - 0xca, 0x02, 0x0a, 0x0a, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, + 0x86, 0x03, 0x0a, 0x0a, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, @@ -1490,49 +1496,53 @@ var file_c1_connector_v2_connector_proto_rawDesc = string([]byte{ 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x08, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x53, 0x10, 0x09, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x41, 0x50, 0x41, 0x42, 0x49, 0x4c, 0x49, - 0x54, 0x59, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x0a, 0x2a, 0xf2, 0x01, 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, 0x49, 0x4c, 0x5f, 0x43, 0x52, 0x45, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x41, - 0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2f, 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, 0x4e, 0x4f, - 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x37, 0x0a, 0x33, 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, 0x52, 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, + 0x54, 0x59, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x0a, 0x12, 0x1c, 0x0a, 0x18, + 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, + 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, + 0x49, 0x4c, 0x5f, 0x43, 0x52, 0x45, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x4f, 0x50, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2f, 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, 0x4e, 0x4f, 0x5f, 0x50, 0x41, 0x53, + 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x37, 0x0a, 0x33, 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, 0x52, + 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, + 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, + 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, }) 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 aa8b9b60..0da9efb1 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 @@ -24,13 +24,65 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type EventType int32 + +const ( + EventType_EVENT_TYPE_UNSPECIFIED EventType = 0 + EventType_EVENT_TYPE_USAGE EventType = 1 + EventType_EVENT_TYPE_RESOURCE_CHANGE EventType = 4 +) + +// Enum value maps for EventType. +var ( + EventType_name = map[int32]string{ + 0: "EVENT_TYPE_UNSPECIFIED", + 1: "EVENT_TYPE_USAGE", + 4: "EVENT_TYPE_RESOURCE_CHANGE", + } + EventType_value = map[string]int32{ + "EVENT_TYPE_UNSPECIFIED": 0, + "EVENT_TYPE_USAGE": 1, + "EVENT_TYPE_RESOURCE_CHANGE": 4, + } +) + +func (x EventType) Enum() *EventType { + p := new(EventType) + *p = x + return p +} + +func (x EventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EventType) Descriptor() protoreflect.EnumDescriptor { + return file_c1_connector_v2_event_feed_proto_enumTypes[0].Descriptor() +} + +func (EventType) Type() protoreflect.EnumType { + return &file_c1_connector_v2_event_feed_proto_enumTypes[0] +} + +func (x EventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EventType.Descriptor instead. +func (EventType) EnumDescriptor() ([]byte, []int) { + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{0} +} + type ListEventsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Can function like a page token but also can be arbitrary to resume a feed at any point - Cursor string `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"` - StartAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_at,json=startAt,proto3" json:"start_at,omitempty"` - PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` + Cursor string `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"` + StartAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_at,json=startAt,proto3" json:"start_at,omitempty"` + PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` + // Used to specify a specific event feed to list events from. + // If not provided, the connector will use the old event feed. + EventFeedId string `protobuf:"bytes,5,opt,name=event_feed_id,json=eventFeedId,proto3" json:"event_feed_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -93,6 +145,13 @@ func (x *ListEventsRequest) GetAnnotations() []*anypb.Any { return nil } +func (x *ListEventsRequest) GetEventFeedId() string { + if x != nil { + return x.EventFeedId + } + return "" +} + type ListEventsResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` @@ -161,6 +220,102 @@ func (x *ListEventsResponse) GetAnnotations() []*anypb.Any { return nil } +type ListEventFeedsRequest 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 +} + +func (x *ListEventFeedsRequest) Reset() { + *x = ListEventFeedsRequest{} + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListEventFeedsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEventFeedsRequest) ProtoMessage() {} + +func (x *ListEventFeedsRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_event_feed_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 ListEventFeedsRequest.ProtoReflect.Descriptor instead. +func (*ListEventFeedsRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{2} +} + +func (x *ListEventFeedsRequest) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +type ListEventFeedsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*EventFeedMetadata `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListEventFeedsResponse) Reset() { + *x = ListEventFeedsResponse{} + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListEventFeedsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEventFeedsResponse) ProtoMessage() {} + +func (x *ListEventFeedsResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_event_feed_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 ListEventFeedsResponse.ProtoReflect.Descriptor instead. +func (*ListEventFeedsResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{3} +} + +func (x *ListEventFeedsResponse) GetList() []*EventFeedMetadata { + if x != nil { + return x.List + } + return nil +} + +func (x *ListEventFeedsResponse) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + type Event struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -173,6 +328,7 @@ type Event struct { // *Event_UsageEvent // *Event_GrantEvent // *Event_RevokeEvent + // *Event_ResourceChangeEvent 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"` @@ -182,7 +338,7 @@ type Event struct { func (x *Event) Reset() { *x = Event{} - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[2] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -194,7 +350,7 @@ func (x *Event) String() string { func (*Event) ProtoMessage() {} func (x *Event) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[2] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -207,7 +363,7 @@ func (x *Event) ProtoReflect() protoreflect.Message { // Deprecated: Use Event.ProtoReflect.Descriptor instead. func (*Event) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{2} + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{4} } func (x *Event) GetId() string { @@ -258,6 +414,15 @@ func (x *Event) GetRevokeEvent() *RevokeEvent { return nil } +func (x *Event) GetResourceChangeEvent() *ResourceChangeEvent { + if x != nil { + if x, ok := x.Event.(*Event_ResourceChangeEvent); ok { + return x.ResourceChangeEvent + } + } + return nil +} + func (x *Event) GetAnnotations() []*anypb.Any { if x != nil { return x.Annotations @@ -281,12 +446,18 @@ type Event_RevokeEvent struct { RevokeEvent *RevokeEvent `protobuf:"bytes,102,opt,name=revoke_event,json=revokeEvent,proto3,oneof"` } +type Event_ResourceChangeEvent struct { + ResourceChangeEvent *ResourceChangeEvent `protobuf:"bytes,103,opt,name=resource_change_event,json=resourceChangeEvent,proto3,oneof"` +} + func (*Event_UsageEvent) isEvent_Event() {} func (*Event_GrantEvent) isEvent_Event() {} func (*Event_RevokeEvent) isEvent_Event() {} +func (*Event_ResourceChangeEvent) 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"` @@ -297,7 +468,7 @@ type UsageEvent struct { func (x *UsageEvent) Reset() { *x = UsageEvent{} - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[3] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -309,7 +480,7 @@ func (x *UsageEvent) String() string { func (*UsageEvent) ProtoMessage() {} func (x *UsageEvent) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[3] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -322,7 +493,7 @@ func (x *UsageEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use UsageEvent.ProtoReflect.Descriptor instead. func (*UsageEvent) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{3} + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{5} } func (x *UsageEvent) GetTargetResource() *Resource { @@ -349,7 +520,7 @@ type GrantEvent struct { func (x *GrantEvent) Reset() { *x = GrantEvent{} - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[4] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -361,7 +532,7 @@ func (x *GrantEvent) String() string { func (*GrantEvent) ProtoMessage() {} func (x *GrantEvent) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[4] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -374,7 +545,7 @@ func (x *GrantEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use GrantEvent.ProtoReflect.Descriptor instead. func (*GrantEvent) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{4} + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{6} } func (x *GrantEvent) GetGrant() *Grant { @@ -394,7 +565,7 @@ type RevokeEvent struct { func (x *RevokeEvent) Reset() { *x = RevokeEvent{} - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[5] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -406,7 +577,7 @@ func (x *RevokeEvent) String() string { func (*RevokeEvent) ProtoMessage() {} func (x *RevokeEvent) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_event_feed_proto_msgTypes[5] + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -419,7 +590,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{5} + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{7} } func (x *RevokeEvent) GetEntitlement() *Entitlement { @@ -436,6 +607,112 @@ func (x *RevokeEvent) GetPrincipal() *Resource { return nil } +// generic light weight event indicating a resource was changed +type ResourceChangeEvent struct { + 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 *ResourceChangeEvent) Reset() { + *x = ResourceChangeEvent{} + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResourceChangeEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceChangeEvent) ProtoMessage() {} + +func (x *ResourceChangeEvent) 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 ResourceChangeEvent.ProtoReflect.Descriptor instead. +func (*ResourceChangeEvent) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{8} +} + +func (x *ResourceChangeEvent) GetResourceId() *ResourceId { + if x != nil { + return x.ResourceId + } + return nil +} + +func (x *ResourceChangeEvent) GetParentResourceId() *ResourceId { + if x != nil { + return x.ParentResourceId + } + return nil +} + +type EventFeedMetadata struct { + state protoimpl.MessageState `protogen:"open.v1"` + // unique identifier for the event feed + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + SupportedEventTypes []EventType `protobuf:"varint,2,rep,packed,name=supported_event_types,json=supportedEventTypes,proto3,enum=c1.connector.v2.EventType" json:"supported_event_types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventFeedMetadata) Reset() { + *x = EventFeedMetadata{} + mi := &file_c1_connector_v2_event_feed_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventFeedMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFeedMetadata) ProtoMessage() {} + +func (x *EventFeedMetadata) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_event_feed_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 EventFeedMetadata.ProtoReflect.Descriptor instead. +func (*EventFeedMetadata) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_event_feed_proto_rawDescGZIP(), []int{9} +} + +func (x *EventFeedMetadata) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EventFeedMetadata) GetSupportedEventTypes() []EventType { + if x != nil { + return x.SupportedEventTypes + } + return nil +} + var File_c1_connector_v2_event_feed_proto protoreflect.FileDescriptor var file_c1_connector_v2_event_feed_proto_rawDesc = string([]byte{ @@ -453,7 +730,7 @@ var file_c1_connector_v2_event_feed_proto_rawDesc = string([]byte{ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0xd2, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x20, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x63, @@ -466,73 +743,129 @@ var file_c1_connector_v2_event_feed_proto_rawDesc = string([]byte{ 0x65, 0x53, 0x69, 0x7a, 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, 0x22, 0xbe, 0x01, - 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x20, - 0xd0, 0x01, 0x01, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x68, - 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, - 0x61, 0x73, 0x4d, 0x6f, 0x72, 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, 0x22, 0xd8, - 0x02, 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, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6f, 0x63, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x61, - 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x67, 0x72, 0x61, 0x6e, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0c, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x5f, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x31, + 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x0a, + 0x0d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x08, + 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x49, 0x64, + 0x22, 0xbe, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, + 0x28, 0x80, 0x20, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x19, + 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 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, 0x22, 0x4f, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, + 0x65, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x88, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x46, 0x65, 0x65, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 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, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, + 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, + 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, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x61, 0x67, + 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x75, 0x73, 0x61, 0x67, 0x65, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0c, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, 0x76, 0x6f, + 0x6b, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, 0x15, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 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, + 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, - 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x72, 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, - 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, 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, 0x32, 0x65, 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, 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, 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, }) var ( @@ -547,42 +880,58 @@ func file_c1_connector_v2_event_feed_proto_rawDescGZIP() []byte { return file_c1_connector_v2_event_feed_proto_rawDescData } -var file_c1_connector_v2_event_feed_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +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_goTypes = []any{ - (*ListEventsRequest)(nil), // 0: c1.connector.v2.ListEventsRequest - (*ListEventsResponse)(nil), // 1: c1.connector.v2.ListEventsResponse - (*Event)(nil), // 2: c1.connector.v2.Event - (*UsageEvent)(nil), // 3: c1.connector.v2.UsageEvent - (*GrantEvent)(nil), // 4: c1.connector.v2.GrantEvent - (*RevokeEvent)(nil), // 5: c1.connector.v2.RevokeEvent - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp - (*anypb.Any)(nil), // 7: google.protobuf.Any - (*Resource)(nil), // 8: c1.connector.v2.Resource - (*Grant)(nil), // 9: c1.connector.v2.Grant - (*Entitlement)(nil), // 10: c1.connector.v2.Entitlement + (EventType)(0), // 0: c1.connector.v2.EventType + (*ListEventsRequest)(nil), // 1: c1.connector.v2.ListEventsRequest + (*ListEventsResponse)(nil), // 2: c1.connector.v2.ListEventsResponse + (*ListEventFeedsRequest)(nil), // 3: c1.connector.v2.ListEventFeedsRequest + (*ListEventFeedsResponse)(nil), // 4: c1.connector.v2.ListEventFeedsResponse + (*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 } var file_c1_connector_v2_event_feed_proto_depIdxs = []int32{ - 6, // 0: c1.connector.v2.ListEventsRequest.start_at:type_name -> google.protobuf.Timestamp - 7, // 1: c1.connector.v2.ListEventsRequest.annotations:type_name -> google.protobuf.Any - 2, // 2: c1.connector.v2.ListEventsResponse.events:type_name -> c1.connector.v2.Event - 7, // 3: c1.connector.v2.ListEventsResponse.annotations:type_name -> google.protobuf.Any - 6, // 4: c1.connector.v2.Event.occurred_at:type_name -> google.protobuf.Timestamp - 3, // 5: c1.connector.v2.Event.usage_event:type_name -> c1.connector.v2.UsageEvent - 4, // 6: c1.connector.v2.Event.grant_event:type_name -> c1.connector.v2.GrantEvent - 5, // 7: c1.connector.v2.Event.revoke_event:type_name -> c1.connector.v2.RevokeEvent - 7, // 8: c1.connector.v2.Event.annotations:type_name -> google.protobuf.Any - 8, // 9: c1.connector.v2.UsageEvent.target_resource:type_name -> c1.connector.v2.Resource - 8, // 10: c1.connector.v2.UsageEvent.actor_resource:type_name -> c1.connector.v2.Resource - 9, // 11: c1.connector.v2.GrantEvent.grant:type_name -> c1.connector.v2.Grant - 10, // 12: c1.connector.v2.RevokeEvent.entitlement:type_name -> c1.connector.v2.Entitlement - 8, // 13: c1.connector.v2.RevokeEvent.principal:type_name -> c1.connector.v2.Resource - 0, // 14: c1.connector.v2.EventService.ListEvents:input_type -> c1.connector.v2.ListEventsRequest - 1, // 15: c1.connector.v2.EventService.ListEvents:output_type -> c1.connector.v2.ListEventsResponse - 15, // [15:16] is the sub-list for method output_type - 14, // [14:15] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 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 + 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 + 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 } func init() { file_c1_connector_v2_event_feed_proto_init() } @@ -593,23 +942,25 @@ func file_c1_connector_v2_event_feed_proto_init() { file_c1_connector_v2_entitlement_proto_init() file_c1_connector_v2_grant_proto_init() file_c1_connector_v2_resource_proto_init() - file_c1_connector_v2_event_feed_proto_msgTypes[2].OneofWrappers = []any{ + file_c1_connector_v2_event_feed_proto_msgTypes[4].OneofWrappers = []any{ (*Event_UsageEvent)(nil), (*Event_GrantEvent)(nil), (*Event_RevokeEvent)(nil), + (*Event_ResourceChangeEvent)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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: 0, - NumMessages: 6, + NumEnums: 1, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, GoTypes: file_c1_connector_v2_event_feed_proto_goTypes, DependencyIndexes: file_c1_connector_v2_event_feed_proto_depIdxs, + EnumInfos: file_c1_connector_v2_event_feed_proto_enumTypes, MessageInfos: file_c1_connector_v2_event_feed_proto_msgTypes, }.Build() File_c1_connector_v2_event_feed_proto = out.File 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 6bc19599..bc384bf6 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 @@ -150,6 +150,21 @@ func (m *ListEventsRequest) validate(all bool) error { } + if m.GetEventFeedId() != "" { + + if l := len(m.GetEventFeedId()); l < 1 || l > 1024 { + err := ListEventsRequestValidationError{ + field: "EventFeedId", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + if len(errors) > 0 { return ListEventsRequestMultiError(errors) } @@ -417,6 +432,312 @@ var _ interface { ErrorName() string } = ListEventsResponseValidationError{} +// Validate checks the field values on ListEventFeedsRequest 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 *ListEventFeedsRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListEventFeedsRequest 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 +// ListEventFeedsRequestMultiError, or nil if none found. +func (m *ListEventFeedsRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ListEventFeedsRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + 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, ListEventFeedsRequestValidationError{ + 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, ListEventFeedsRequestValidationError{ + 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 ListEventFeedsRequestValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return ListEventFeedsRequestMultiError(errors) + } + + return nil +} + +// ListEventFeedsRequestMultiError is an error wrapping multiple validation +// errors returned by ListEventFeedsRequest.ValidateAll() if the designated +// constraints aren't met. +type ListEventFeedsRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListEventFeedsRequestMultiError) 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 ListEventFeedsRequestMultiError) AllErrors() []error { return m } + +// ListEventFeedsRequestValidationError is the validation error returned by +// ListEventFeedsRequest.Validate if the designated constraints aren't met. +type ListEventFeedsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListEventFeedsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListEventFeedsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListEventFeedsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListEventFeedsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListEventFeedsRequestValidationError) ErrorName() string { + return "ListEventFeedsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ListEventFeedsRequestValidationError) 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 %sListEventFeedsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListEventFeedsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListEventFeedsRequestValidationError{} + +// Validate checks the field values on ListEventFeedsResponse 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 *ListEventFeedsResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListEventFeedsResponse 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 +// ListEventFeedsResponseMultiError, or nil if none found. +func (m *ListEventFeedsResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListEventFeedsResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetList() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListEventFeedsResponseValidationError{ + field: fmt.Sprintf("List[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListEventFeedsResponseValidationError{ + field: fmt.Sprintf("List[%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 ListEventFeedsResponseValidationError{ + field: fmt.Sprintf("List[%v]", idx), + 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, ListEventFeedsResponseValidationError{ + 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, ListEventFeedsResponseValidationError{ + 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 ListEventFeedsResponseValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return ListEventFeedsResponseMultiError(errors) + } + + return nil +} + +// ListEventFeedsResponseMultiError is an error wrapping multiple validation +// errors returned by ListEventFeedsResponse.ValidateAll() if the designated +// constraints aren't met. +type ListEventFeedsResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListEventFeedsResponseMultiError) 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 ListEventFeedsResponseMultiError) AllErrors() []error { return m } + +// ListEventFeedsResponseValidationError is the validation error returned by +// ListEventFeedsResponse.Validate if the designated constraints aren't met. +type ListEventFeedsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListEventFeedsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListEventFeedsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListEventFeedsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListEventFeedsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListEventFeedsResponseValidationError) ErrorName() string { + return "ListEventFeedsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListEventFeedsResponseValidationError) 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 %sListEventFeedsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListEventFeedsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListEventFeedsResponseValidationError{} + // Validate checks the field values on Event 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. @@ -627,6 +948,47 @@ func (m *Event) validate(all bool) error { } } + case *Event_ResourceChangeEvent: + 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.GetResourceChangeEvent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, EventValidationError{ + field: "ResourceChangeEvent", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, EventValidationError{ + field: "ResourceChangeEvent", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResourceChangeEvent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EventValidationError{ + field: "ResourceChangeEvent", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -1149,3 +1511,318 @@ var _ interface { Cause() error ErrorName() string } = RevokeEventValidationError{} + +// Validate checks the field values on ResourceChangeEvent 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 *ResourceChangeEvent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ResourceChangeEvent 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 +// ResourceChangeEventMultiError, or nil if none found. +func (m *ResourceChangeEvent) ValidateAll() error { + return m.validate(true) +} + +func (m *ResourceChangeEvent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetResourceId() == nil { + err := ResourceChangeEventValidationError{ + field: "ResourceId", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceChangeEventValidationError{ + field: "ResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceChangeEventValidationError{ + field: "ResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResourceId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceChangeEventValidationError{ + field: "ResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetParentResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceChangeEventValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceChangeEventValidationError{ + 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 ResourceChangeEventValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ResourceChangeEventMultiError(errors) + } + + return nil +} + +// ResourceChangeEventMultiError is an error wrapping multiple validation +// errors returned by ResourceChangeEvent.ValidateAll() if the designated +// constraints aren't met. +type ResourceChangeEventMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ResourceChangeEventMultiError) 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 ResourceChangeEventMultiError) AllErrors() []error { return m } + +// ResourceChangeEventValidationError is the validation error returned by +// ResourceChangeEvent.Validate if the designated constraints aren't met. +type ResourceChangeEventValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourceChangeEventValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourceChangeEventValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourceChangeEventValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourceChangeEventValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourceChangeEventValidationError) ErrorName() string { + return "ResourceChangeEventValidationError" +} + +// Error satisfies the builtin error interface +func (e ResourceChangeEventValidationError) 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 %sResourceChangeEvent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourceChangeEventValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResourceChangeEventValidationError{} + +// Validate checks the field values on EventFeedMetadata 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 *EventFeedMetadata) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on EventFeedMetadata 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 +// EventFeedMetadataMultiError, or nil if none found. +func (m *EventFeedMetadata) ValidateAll() error { + return m.validate(true) +} + +func (m *EventFeedMetadata) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if l := len(m.GetId()); l < 1 || l > 1024 { + err := EventFeedMetadataValidationError{ + field: "Id", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + _EventFeedMetadata_SupportedEventTypes_Unique := make(map[EventType]struct{}, len(m.GetSupportedEventTypes())) + + for idx, item := range m.GetSupportedEventTypes() { + _, _ = idx, item + + if _, exists := _EventFeedMetadata_SupportedEventTypes_Unique[item]; exists { + err := EventFeedMetadataValidationError{ + field: fmt.Sprintf("SupportedEventTypes[%v]", idx), + reason: "repeated value must contain unique items", + } + if !all { + return err + } + errors = append(errors, err) + } else { + _EventFeedMetadata_SupportedEventTypes_Unique[item] = struct{}{} + } + + if _, ok := EventType_name[int32(item)]; !ok { + err := EventFeedMetadataValidationError{ + field: fmt.Sprintf("SupportedEventTypes[%v]", idx), + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if len(errors) > 0 { + return EventFeedMetadataMultiError(errors) + } + + return nil +} + +// EventFeedMetadataMultiError is an error wrapping multiple validation errors +// returned by EventFeedMetadata.ValidateAll() if the designated constraints +// aren't met. +type EventFeedMetadataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m EventFeedMetadataMultiError) 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 EventFeedMetadataMultiError) AllErrors() []error { return m } + +// EventFeedMetadataValidationError is the validation error returned by +// EventFeedMetadata.Validate if the designated constraints aren't met. +type EventFeedMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EventFeedMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EventFeedMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EventFeedMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EventFeedMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EventFeedMetadataValidationError) ErrorName() string { + return "EventFeedMetadataValidationError" +} + +// Error satisfies the builtin error interface +func (e EventFeedMetadataValidationError) 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 %sEventFeedMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EventFeedMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EventFeedMetadataValidationError{} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed_grpc.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed_grpc.pb.go index e82c8c80..1d5b11f2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed_grpc.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/event_feed_grpc.pb.go @@ -19,7 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - EventService_ListEvents_FullMethodName = "/c1.connector.v2.EventService/ListEvents" + EventService_ListEvents_FullMethodName = "/c1.connector.v2.EventService/ListEvents" + EventService_ListEventFeeds_FullMethodName = "/c1.connector.v2.EventService/ListEventFeeds" ) // EventServiceClient is the client API for EventService service. @@ -27,6 +28,7 @@ const ( // 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 EventServiceClient interface { ListEvents(ctx context.Context, in *ListEventsRequest, opts ...grpc.CallOption) (*ListEventsResponse, error) + ListEventFeeds(ctx context.Context, in *ListEventFeedsRequest, opts ...grpc.CallOption) (*ListEventFeedsResponse, error) } type eventServiceClient struct { @@ -47,11 +49,22 @@ func (c *eventServiceClient) ListEvents(ctx context.Context, in *ListEventsReque return out, nil } +func (c *eventServiceClient) ListEventFeeds(ctx context.Context, in *ListEventFeedsRequest, opts ...grpc.CallOption) (*ListEventFeedsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListEventFeedsResponse) + err := c.cc.Invoke(ctx, EventService_ListEventFeeds_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // EventServiceServer is the server API for EventService service. // All implementations should embed UnimplementedEventServiceServer // for forward compatibility. type EventServiceServer interface { ListEvents(context.Context, *ListEventsRequest) (*ListEventsResponse, error) + ListEventFeeds(context.Context, *ListEventFeedsRequest) (*ListEventFeedsResponse, error) } // UnimplementedEventServiceServer should be embedded to have @@ -64,6 +77,9 @@ type UnimplementedEventServiceServer struct{} func (UnimplementedEventServiceServer) ListEvents(context.Context, *ListEventsRequest) (*ListEventsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListEvents not implemented") } +func (UnimplementedEventServiceServer) ListEventFeeds(context.Context, *ListEventFeedsRequest) (*ListEventFeedsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEventFeeds not implemented") +} func (UnimplementedEventServiceServer) testEmbeddedByValue() {} // UnsafeEventServiceServer may be embedded to opt out of forward compatibility for this service. @@ -102,6 +118,24 @@ func _EventService_ListEvents_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _EventService_ListEventFeeds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEventFeedsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EventServiceServer).ListEventFeeds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EventService_ListEventFeeds_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EventServiceServer).ListEventFeeds(ctx, req.(*ListEventFeedsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // EventService_ServiceDesc is the grpc.ServiceDesc for EventService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -113,6 +147,10 @@ var EventService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListEvents", Handler: _EventService_ListEvents_Handler, }, + { + MethodName: "ListEventFeeds", + Handler: _EventService_ListEventFeeds_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "c1/connector/v2/event_feed.proto", 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 1639a155..ad9f2313 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 @@ -1610,6 +1610,118 @@ func (x *ResourcesServiceListResourcesResponse) GetAnnotations() []*anypb.Any { return nil } +type ResourceGetterServiceGetResourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResourceGetterServiceGetResourceRequest) Reset() { + *x = ResourceGetterServiceGetResourceRequest{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResourceGetterServiceGetResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceGetterServiceGetResourceRequest) ProtoMessage() {} + +func (x *ResourceGetterServiceGetResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + 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 ResourceGetterServiceGetResourceRequest.ProtoReflect.Descriptor instead. +func (*ResourceGetterServiceGetResourceRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{22} +} + +func (x *ResourceGetterServiceGetResourceRequest) GetResourceId() *ResourceId { + if x != nil { + return x.ResourceId + } + return nil +} + +func (x *ResourceGetterServiceGetResourceRequest) GetParentResourceId() *ResourceId { + if x != nil { + return x.ParentResourceId + } + return nil +} + +func (x *ResourceGetterServiceGetResourceRequest) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +type ResourceGetterServiceGetResourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResourceGetterServiceGetResourceResponse) Reset() { + *x = ResourceGetterServiceGetResourceResponse{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResourceGetterServiceGetResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceGetterServiceGetResourceResponse) ProtoMessage() {} + +func (x *ResourceGetterServiceGetResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + 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 ResourceGetterServiceGetResourceResponse.ProtoReflect.Descriptor instead. +func (*ResourceGetterServiceGetResourceResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{23} +} + +func (x *ResourceGetterServiceGetResourceResponse) GetResource() *Resource { + if x != nil { + return x.Resource + } + return nil +} + +func (x *ResourceGetterServiceGetResourceResponse) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + type ExternalId struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -1621,7 +1733,7 @@ type ExternalId struct { func (x *ExternalId) Reset() { *x = ExternalId{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1633,7 +1745,7 @@ func (x *ExternalId) String() string { func (*ExternalId) ProtoMessage() {} func (x *ExternalId) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1646,7 +1758,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{22} + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{24} } func (x *ExternalId) GetId() string { @@ -1681,7 +1793,7 @@ type AccountInfo_Email struct { func (x *AccountInfo_Email) Reset() { *x = AccountInfo_Email{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1693,7 +1805,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[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1732,7 +1844,7 @@ type CredentialOptions_RandomPassword struct { func (x *CredentialOptions_RandomPassword) Reset() { *x = CredentialOptions_RandomPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1744,7 +1856,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[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1775,7 +1887,7 @@ type CredentialOptions_NoPassword struct { func (x *CredentialOptions_NoPassword) Reset() { *x = CredentialOptions_NoPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1787,7 +1899,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[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1812,7 +1924,7 @@ type CredentialOptions_SSO struct { func (x *CredentialOptions_SSO) Reset() { *x = CredentialOptions_SSO{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1824,7 +1936,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[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1857,7 +1969,7 @@ type CreateAccountResponse_SuccessResult struct { func (x *CreateAccountResponse_SuccessResult) Reset() { *x = CreateAccountResponse_SuccessResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1869,7 +1981,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[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1910,7 +2022,7 @@ type CreateAccountResponse_ActionRequiredResult struct { func (x *CreateAccountResponse_ActionRequiredResult) Reset() { *x = CreateAccountResponse_ActionRequiredResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1922,7 +2034,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[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1968,7 +2080,7 @@ type EncryptionConfig_JWKPublicKeyConfig struct { func (x *EncryptionConfig_JWKPublicKeyConfig) Reset() { *x = EncryptionConfig_JWKPublicKeyConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1980,7 +2092,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[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2350,75 +2462,110 @@ var file_c1_connector_v2_resource_proto_rawDesc = string([]byte{ 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, 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, + 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, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52, + 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x32, 0xab, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x92, 0x01, 0x0a, 0x11, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x12, 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0x92, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x92, 0x01, - 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x7e, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x32, 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, + 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, 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, + 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, 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, 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 ( @@ -2434,7 +2581,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, 30) +var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 32) 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 @@ -2460,81 +2607,90 @@ var file_c1_connector_v2_resource_proto_goTypes = []any{ (*Resource)(nil), // 21: c1.connector.v2.Resource (*ResourcesServiceListResourcesRequest)(nil), // 22: c1.connector.v2.ResourcesServiceListResourcesRequest (*ResourcesServiceListResourcesResponse)(nil), // 23: c1.connector.v2.ResourcesServiceListResourcesResponse - (*ExternalId)(nil), // 24: c1.connector.v2.ExternalId - (*AccountInfo_Email)(nil), // 25: c1.connector.v2.AccountInfo.Email - (*CredentialOptions_RandomPassword)(nil), // 26: c1.connector.v2.CredentialOptions.RandomPassword - (*CredentialOptions_NoPassword)(nil), // 27: c1.connector.v2.CredentialOptions.NoPassword - (*CredentialOptions_SSO)(nil), // 28: c1.connector.v2.CredentialOptions.SSO - (*CreateAccountResponse_SuccessResult)(nil), // 29: c1.connector.v2.CreateAccountResponse.SuccessResult - (*CreateAccountResponse_ActionRequiredResult)(nil), // 30: c1.connector.v2.CreateAccountResponse.ActionRequiredResult - (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 31: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig - (*anypb.Any)(nil), // 32: google.protobuf.Any - (*structpb.Struct)(nil), // 33: google.protobuf.Struct + (*ResourceGetterServiceGetResourceRequest)(nil), // 24: c1.connector.v2.ResourceGetterServiceGetResourceRequest + (*ResourceGetterServiceGetResourceResponse)(nil), // 25: c1.connector.v2.ResourceGetterServiceGetResourceResponse + (*ExternalId)(nil), // 26: c1.connector.v2.ExternalId + (*AccountInfo_Email)(nil), // 27: c1.connector.v2.AccountInfo.Email + (*CredentialOptions_RandomPassword)(nil), // 28: c1.connector.v2.CredentialOptions.RandomPassword + (*CredentialOptions_NoPassword)(nil), // 29: c1.connector.v2.CredentialOptions.NoPassword + (*CredentialOptions_SSO)(nil), // 30: c1.connector.v2.CredentialOptions.SSO + (*CreateAccountResponse_SuccessResult)(nil), // 31: c1.connector.v2.CreateAccountResponse.SuccessResult + (*CreateAccountResponse_ActionRequiredResult)(nil), // 32: c1.connector.v2.CreateAccountResponse.ActionRequiredResult + (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 33: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + (*anypb.Any)(nil), // 34: google.protobuf.Any + (*structpb.Struct)(nil), // 35: 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 - 32, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any + 34, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any 21, // 2: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.parent:type_name -> c1.connector.v2.Resource - 32, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any + 34, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any 2, // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.list:type_name -> c1.connector.v2.ResourceType - 32, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any + 34, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any 21, // 6: c1.connector.v2.CreateResourceRequest.resource:type_name -> c1.connector.v2.Resource 21, // 7: c1.connector.v2.CreateResourceResponse.created:type_name -> c1.connector.v2.Resource - 32, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any + 34, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any 20, // 9: c1.connector.v2.DeleteResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 32, // 10: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any + 34, // 10: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any 20, // 11: c1.connector.v2.DeleteResourceV2Request.resource_id:type_name -> c1.connector.v2.ResourceId - 32, // 12: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any + 34, // 12: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any 20, // 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 19, // 15: c1.connector.v2.RotateCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig 17, // 16: c1.connector.v2.RotateCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData 20, // 17: c1.connector.v2.RotateCredentialResponse.resource_id:type_name -> c1.connector.v2.ResourceId - 32, // 18: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any - 25, // 19: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email - 33, // 20: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct - 26, // 21: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword - 27, // 22: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword - 28, // 23: c1.connector.v2.CredentialOptions.sso:type_name -> c1.connector.v2.CredentialOptions.SSO + 34, // 18: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any + 27, // 19: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email + 35, // 20: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct + 28, // 21: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword + 29, // 22: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword + 30, // 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 19, // 26: c1.connector.v2.CreateAccountRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 29, // 27: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult - 30, // 28: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult + 31, // 27: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult + 32, // 28: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult 17, // 29: c1.connector.v2.CreateAccountResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData - 32, // 30: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any + 34, // 30: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any 21, // 31: c1.connector.v2.EncryptionConfig.principal:type_name -> c1.connector.v2.Resource - 31, // 32: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + 33, // 32: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig 20, // 33: c1.connector.v2.Resource.id:type_name -> c1.connector.v2.ResourceId 20, // 34: c1.connector.v2.Resource.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 32, // 35: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any - 24, // 36: c1.connector.v2.Resource.external_id:type_name -> c1.connector.v2.ExternalId + 34, // 35: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any + 26, // 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 20, // 38: c1.connector.v2.ResourcesServiceListResourcesRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 32, // 39: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any + 34, // 39: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any 21, // 40: c1.connector.v2.ResourcesServiceListResourcesResponse.list:type_name -> c1.connector.v2.Resource - 32, // 41: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any - 21, // 42: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource - 21, // 43: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource - 3, // 44: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest - 22, // 45: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest - 5, // 46: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest - 7, // 47: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest - 9, // 48: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request - 11, // 49: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest - 15, // 50: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest - 4, // 51: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse - 23, // 52: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse - 6, // 53: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse - 8, // 54: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse - 10, // 55: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response - 12, // 56: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse - 16, // 57: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse - 51, // [51:58] is the sub-list for method output_type - 44, // [44:51] is the sub-list for method input_type - 44, // [44:44] is the sub-list for extension type_name - 44, // [44:44] is the sub-list for extension extendee - 0, // [0:44] is the sub-list for field type_name + 34, // 41: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any + 20, // 42: c1.connector.v2.ResourceGetterServiceGetResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 20, // 43: c1.connector.v2.ResourceGetterServiceGetResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 34, // 44: c1.connector.v2.ResourceGetterServiceGetResourceRequest.annotations:type_name -> google.protobuf.Any + 21, // 45: c1.connector.v2.ResourceGetterServiceGetResourceResponse.resource:type_name -> c1.connector.v2.Resource + 34, // 46: c1.connector.v2.ResourceGetterServiceGetResourceResponse.annotations:type_name -> google.protobuf.Any + 21, // 47: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource + 21, // 48: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource + 3, // 49: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest + 22, // 50: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest + 24, // 51: c1.connector.v2.ResourceGetterService.GetResource:input_type -> c1.connector.v2.ResourceGetterServiceGetResourceRequest + 5, // 52: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest + 7, // 53: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest + 9, // 54: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request + 11, // 55: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest + 15, // 56: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest + 4, // 57: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse + 23, // 58: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse + 25, // 59: c1.connector.v2.ResourceGetterService.GetResource:output_type -> c1.connector.v2.ResourceGetterServiceGetResourceResponse + 6, // 60: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse + 8, // 61: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse + 10, // 62: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response + 12, // 63: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse + 16, // 64: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse + 57, // [57:65] is the sub-list for method output_type + 49, // [49:57] is the sub-list for method input_type + 49, // [49:49] is the sub-list for extension type_name + 49, // [49:49] is the sub-list for extension extendee + 0, // [0:49] is the sub-list for field type_name } func init() { file_c1_connector_v2_resource_proto_init() } @@ -2560,9 +2716,9 @@ 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: 30, + NumMessages: 32, NumExtensions: 0, - NumServices: 6, + NumServices: 7, }, GoTypes: file_c1_connector_v2_resource_proto_goTypes, DependencyIndexes: file_c1_connector_v2_resource_proto_depIdxs, 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 ca9162e8..2e0d07a6 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 @@ -3875,6 +3875,373 @@ var _ interface { ErrorName() string } = ResourcesServiceListResourcesResponseValidationError{} +// Validate checks the field values on ResourceGetterServiceGetResourceRequest +// 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 *ResourceGetterServiceGetResourceRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on +// ResourceGetterServiceGetResourceRequest 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 +// ResourceGetterServiceGetResourceRequestMultiError, or nil if none found. +func (m *ResourceGetterServiceGetResourceRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ResourceGetterServiceGetResourceRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceGetterServiceGetResourceRequestValidationError{ + field: "ResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceGetterServiceGetResourceRequestValidationError{ + field: "ResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResourceId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceGetterServiceGetResourceRequestValidationError{ + field: "ResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetParentResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceGetterServiceGetResourceRequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceGetterServiceGetResourceRequestValidationError{ + 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 ResourceGetterServiceGetResourceRequestValidationError{ + field: "ParentResourceId", + 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, ResourceGetterServiceGetResourceRequestValidationError{ + 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, ResourceGetterServiceGetResourceRequestValidationError{ + 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 ResourceGetterServiceGetResourceRequestValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return ResourceGetterServiceGetResourceRequestMultiError(errors) + } + + return nil +} + +// ResourceGetterServiceGetResourceRequestMultiError is an error wrapping +// multiple validation errors returned by +// ResourceGetterServiceGetResourceRequest.ValidateAll() if the designated +// constraints aren't met. +type ResourceGetterServiceGetResourceRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ResourceGetterServiceGetResourceRequestMultiError) 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 ResourceGetterServiceGetResourceRequestMultiError) AllErrors() []error { return m } + +// ResourceGetterServiceGetResourceRequestValidationError is the validation +// error returned by ResourceGetterServiceGetResourceRequest.Validate if the +// designated constraints aren't met. +type ResourceGetterServiceGetResourceRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourceGetterServiceGetResourceRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourceGetterServiceGetResourceRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourceGetterServiceGetResourceRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourceGetterServiceGetResourceRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourceGetterServiceGetResourceRequestValidationError) ErrorName() string { + return "ResourceGetterServiceGetResourceRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ResourceGetterServiceGetResourceRequestValidationError) 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 %sResourceGetterServiceGetResourceRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourceGetterServiceGetResourceRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResourceGetterServiceGetResourceRequestValidationError{} + +// Validate checks the field values on ResourceGetterServiceGetResourceResponse +// 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 *ResourceGetterServiceGetResourceResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on +// ResourceGetterServiceGetResourceResponse 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 +// ResourceGetterServiceGetResourceResponseMultiError, or nil if none found. +func (m *ResourceGetterServiceGetResourceResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ResourceGetterServiceGetResourceResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetResource()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceGetterServiceGetResourceResponseValidationError{ + field: "Resource", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceGetterServiceGetResourceResponseValidationError{ + field: "Resource", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceGetterServiceGetResourceResponseValidationError{ + field: "Resource", + 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, ResourceGetterServiceGetResourceResponseValidationError{ + 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, ResourceGetterServiceGetResourceResponseValidationError{ + 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 ResourceGetterServiceGetResourceResponseValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return ResourceGetterServiceGetResourceResponseMultiError(errors) + } + + return nil +} + +// ResourceGetterServiceGetResourceResponseMultiError is an error wrapping +// multiple validation errors returned by +// ResourceGetterServiceGetResourceResponse.ValidateAll() if the designated +// constraints aren't met. +type ResourceGetterServiceGetResourceResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ResourceGetterServiceGetResourceResponseMultiError) 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 ResourceGetterServiceGetResourceResponseMultiError) AllErrors() []error { return m } + +// ResourceGetterServiceGetResourceResponseValidationError is the validation +// error returned by ResourceGetterServiceGetResourceResponse.Validate if the +// designated constraints aren't met. +type ResourceGetterServiceGetResourceResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourceGetterServiceGetResourceResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourceGetterServiceGetResourceResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourceGetterServiceGetResourceResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourceGetterServiceGetResourceResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourceGetterServiceGetResourceResponseValidationError) ErrorName() string { + return "ResourceGetterServiceGetResourceResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ResourceGetterServiceGetResourceResponseValidationError) 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 %sResourceGetterServiceGetResourceResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourceGetterServiceGetResourceResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResourceGetterServiceGetResourceResponseValidationError{} + // Validate checks the field values on ExternalId 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_grpc.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_grpc.pb.go index a3718142..c1fe9d71 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_grpc.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_grpc.pb.go @@ -218,6 +218,106 @@ var ResourcesService_ServiceDesc = grpc.ServiceDesc{ Metadata: "c1/connector/v2/resource.proto", } +const ( + ResourceGetterService_GetResource_FullMethodName = "/c1.connector.v2.ResourceGetterService/GetResource" +) + +// ResourceGetterServiceClient is the client API for ResourceGetterService 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 ResourceGetterServiceClient interface { + GetResource(ctx context.Context, in *ResourceGetterServiceGetResourceRequest, opts ...grpc.CallOption) (*ResourceGetterServiceGetResourceResponse, error) +} + +type resourceGetterServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewResourceGetterServiceClient(cc grpc.ClientConnInterface) ResourceGetterServiceClient { + return &resourceGetterServiceClient{cc} +} + +func (c *resourceGetterServiceClient) GetResource(ctx context.Context, in *ResourceGetterServiceGetResourceRequest, opts ...grpc.CallOption) (*ResourceGetterServiceGetResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ResourceGetterServiceGetResourceResponse) + err := c.cc.Invoke(ctx, ResourceGetterService_GetResource_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ResourceGetterServiceServer is the server API for ResourceGetterService service. +// All implementations should embed UnimplementedResourceGetterServiceServer +// for forward compatibility. +type ResourceGetterServiceServer interface { + GetResource(context.Context, *ResourceGetterServiceGetResourceRequest) (*ResourceGetterServiceGetResourceResponse, error) +} + +// UnimplementedResourceGetterServiceServer 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 UnimplementedResourceGetterServiceServer struct{} + +func (UnimplementedResourceGetterServiceServer) GetResource(context.Context, *ResourceGetterServiceGetResourceRequest) (*ResourceGetterServiceGetResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetResource not implemented") +} +func (UnimplementedResourceGetterServiceServer) testEmbeddedByValue() {} + +// UnsafeResourceGetterServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ResourceGetterServiceServer will +// result in compilation errors. +type UnsafeResourceGetterServiceServer interface { + mustEmbedUnimplementedResourceGetterServiceServer() +} + +func RegisterResourceGetterServiceServer(s grpc.ServiceRegistrar, srv ResourceGetterServiceServer) { + // If the following call pancis, it indicates UnimplementedResourceGetterServiceServer 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(&ResourceGetterService_ServiceDesc, srv) +} + +func _ResourceGetterService_GetResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResourceGetterServiceGetResourceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResourceGetterServiceServer).GetResource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ResourceGetterService_GetResource_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResourceGetterServiceServer).GetResource(ctx, req.(*ResourceGetterServiceGetResourceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ResourceGetterService_ServiceDesc is the grpc.ServiceDesc for ResourceGetterService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ResourceGetterService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "c1.connector.v2.ResourceGetterService", + HandlerType: (*ResourceGetterServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetResource", + Handler: _ResourceGetterService_GetResource_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "c1/connector/v2/resource.proto", +} + const ( ResourceManagerService_CreateResource_FullMethodName = "/c1.connector.v2.ResourceManagerService/CreateResource" ResourceManagerService_DeleteResource_FullMethodName = "/c1.connector.v2.ResourceManagerService/DeleteResource" 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 94fee00f..cc49f178 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 @@ -108,6 +108,8 @@ type Task struct { // *Task_ActionGetSchema // *Task_ActionInvoke // *Task_ActionStatus + // *Task_CreateSyncDiff + // *Task_CompactSyncs_ TaskType isTask_TaskType `protobuf_oneof:"task_type"` Debug bool `protobuf:"varint,3,opt,name=debug,proto3" json:"debug,omitempty"` unknownFields protoimpl.UnknownFields @@ -336,6 +338,24 @@ func (x *Task) GetActionStatus() *Task_ActionStatusTask { return nil } +func (x *Task) GetCreateSyncDiff() *Task_CreateSyncDiffTask { + if x != nil { + if x, ok := x.TaskType.(*Task_CreateSyncDiff); ok { + return x.CreateSyncDiff + } + } + return nil +} + +func (x *Task) GetCompactSyncs() *Task_CompactSyncs { + if x != nil { + if x, ok := x.TaskType.(*Task_CompactSyncs_); ok { + return x.CompactSyncs + } + } + return nil +} + func (x *Task) GetDebug() bool { if x != nil { return x.Debug @@ -423,6 +443,14 @@ type Task_ActionStatus struct { ActionStatus *Task_ActionStatusTask `protobuf:"bytes,118,opt,name=action_status,json=actionStatus,proto3,oneof"` } +type Task_CreateSyncDiff struct { + CreateSyncDiff *Task_CreateSyncDiffTask `protobuf:"bytes,119,opt,name=create_sync_diff,json=createSyncDiff,proto3,oneof"` +} + +type Task_CompactSyncs_ struct { + CompactSyncs *Task_CompactSyncs `protobuf:"bytes,120,opt,name=compact_syncs,json=compactSyncs,proto3,oneof"` +} + func (*Task_None) isTask_TaskType() {} func (*Task_Hello) isTask_TaskType() {} @@ -461,6 +489,10 @@ func (*Task_ActionInvoke) isTask_TaskType() {} func (*Task_ActionStatus) isTask_TaskType() {} +func (*Task_CreateSyncDiff) isTask_TaskType() {} + +func (*Task_CompactSyncs_) isTask_TaskType() {} + type BatonServiceHelloRequest struct { state protoimpl.MessageState `protogen:"open.v1"` HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"` @@ -2166,6 +2198,171 @@ func (x *Task_ActionStatusTask) GetAnnotations() []*anypb.Any { return nil } +type Task_CreateSyncDiffTask struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Open to suggestions here + BaseSyncId string `protobuf:"bytes,1,opt,name=base_sync_id,json=baseSyncId,proto3" json:"base_sync_id,omitempty"` + NewSyncId string `protobuf:"bytes,2,opt,name=new_sync_id,json=newSyncId,proto3" json:"new_sync_id,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_CreateSyncDiffTask) Reset() { + *x = Task_CreateSyncDiffTask{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_CreateSyncDiffTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_CreateSyncDiffTask) ProtoMessage() {} + +func (x *Task_CreateSyncDiffTask) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_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 Task_CreateSyncDiffTask.ProtoReflect.Descriptor instead. +func (*Task_CreateSyncDiffTask) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_baton_proto_rawDescGZIP(), []int{0, 19} +} + +func (x *Task_CreateSyncDiffTask) GetBaseSyncId() string { + if x != nil { + return x.BaseSyncId + } + return "" +} + +func (x *Task_CreateSyncDiffTask) GetNewSyncId() string { + if x != nil { + return x.NewSyncId + } + return "" +} + +func (x *Task_CreateSyncDiffTask) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +type Task_CompactSyncs struct { + state protoimpl.MessageState `protogen:"open.v1"` + CompactableSyncs []*Task_CompactSyncs_CompactableSync `protobuf:"bytes,1,rep,name=compactable_syncs,json=compactableSyncs,proto3" json:"compactable_syncs,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_CompactSyncs) Reset() { + *x = Task_CompactSyncs{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_CompactSyncs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_CompactSyncs) ProtoMessage() {} + +func (x *Task_CompactSyncs) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_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 Task_CompactSyncs.ProtoReflect.Descriptor instead. +func (*Task_CompactSyncs) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_baton_proto_rawDescGZIP(), []int{0, 20} +} + +func (x *Task_CompactSyncs) GetCompactableSyncs() []*Task_CompactSyncs_CompactableSync { + if x != nil { + return x.CompactableSyncs + } + return nil +} + +func (x *Task_CompactSyncs) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +type Task_CompactSyncs_CompactableSync struct { + state protoimpl.MessageState `protogen:"open.v1"` + FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` + SyncId string `protobuf:"bytes,2,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_CompactSyncs_CompactableSync) Reset() { + *x = Task_CompactSyncs_CompactableSync{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_CompactSyncs_CompactableSync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_CompactSyncs_CompactableSync) ProtoMessage() {} + +func (x *Task_CompactSyncs_CompactableSync) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_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 Task_CompactSyncs_CompactableSync.ProtoReflect.Descriptor instead. +func (*Task_CompactSyncs_CompactableSync) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_baton_proto_rawDescGZIP(), []int{0, 20, 0} +} + +func (x *Task_CompactSyncs_CompactableSync) GetFilePath() string { + if x != nil { + return x.FilePath + } + return "" +} + +func (x *Task_CompactSyncs_CompactableSync) GetSyncId() string { + if x != nil { + return x.SyncId + } + return "" +} + type BatonServiceHelloRequest_BuildInfo struct { state protoimpl.MessageState `protogen:"open.v1"` LangVersion string `protobuf:"bytes,1,opt,name=lang_version,json=langVersion,proto3" json:"lang_version,omitempty"` @@ -2177,7 +2374,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2189,7 +2386,7 @@ func (x *BatonServiceHelloRequest_BuildInfo) String() string { func (*BatonServiceHelloRequest_BuildInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_BuildInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2242,7 +2439,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2254,7 +2451,7 @@ func (x *BatonServiceHelloRequest_OSInfo) String() string { func (*BatonServiceHelloRequest_OSInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_OSInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2337,7 +2534,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2349,7 +2546,7 @@ func (x *BatonServiceUploadAssetRequest_UploadMetadata) String() string { func (*BatonServiceUploadAssetRequest_UploadMetadata) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadMetadata) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2396,7 +2593,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2408,7 +2605,7 @@ func (x *BatonServiceUploadAssetRequest_UploadData) String() string { func (*BatonServiceUploadAssetRequest_UploadData) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2441,7 +2638,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2453,7 +2650,7 @@ func (x *BatonServiceUploadAssetRequest_UploadEOF) String() string { func (*BatonServiceUploadAssetRequest_UploadEOF) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadEOF) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2495,7 +2692,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2507,7 +2704,7 @@ func (x *BatonServiceFinishTaskRequest_Error) String() string { func (*BatonServiceFinishTaskRequest_Error) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Error) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2555,7 +2752,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2567,7 +2764,7 @@ func (x *BatonServiceFinishTaskRequest_Success) String() string { func (*BatonServiceFinishTaskRequest_Success) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Success) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2624,7 +2821,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, 0xdd, 0x21, 0x0a, 0x04, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x26, 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, @@ -2733,160 +2930,196 @@ var file_c1_connectorapi_baton_v1_baton_proto_rawDesc = string([]byte{ 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, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, - 0x0c, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, - 0x62, 0x75, 0x67, 0x1a, 0x42, 0x0a, 0x08, 0x4e, 0x6f, 0x6e, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, + 0x0c, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x5d, 0x0a, + 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x64, 0x69, 0x66, + 0x66, 0x18, 0x77, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 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, 0x53, 0x79, + 0x6e, 0x63, 0x44, 0x69, 0x66, 0x66, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x69, 0x66, 0x66, 0x12, 0x52, 0x0a, 0x0d, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x73, 0x18, 0x78, 0x20, + 0x01, 0x28, 0x0b, 0x32, 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, 0x54, + 0x61, 0x73, 0x6b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, + 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x1a, 0x42, 0x0a, 0x08, 0x4e, 0x6f, 0x6e, 0x65, 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, 0x43, 0x0a, 0x09, 0x48, 0x65, + 0x6c, 0x6c, 0x6f, 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, + 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, 0x43, 0x0a, 0x09, 0x48, 0x65, 0x6c, 0x6c, 0x6f, - 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, 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, 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, 0x41, 0x6e, 0x79, - 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, - 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x41, 0x74, 0x1a, 0xf3, 0x01, 0x0a, 0x09, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x54, 0x61, - 0x73, 0x6b, 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, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, + 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x35, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x74, 0x1a, 0xf3, 0x01, 0x0a, 0x09, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x54, 0x61, 0x73, 0x6b, 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, 0x12, 0x36, + 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 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, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x72, 0x0a, + 0x0a, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x54, 0x61, 0x73, 0x6b, 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, 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, 0xf9, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x54, 0x61, 0x73, 0x6b, 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, 0x1a, 0x4b, 0x0a, + 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, + 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, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x0b, 0x61, + 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, + 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, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 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, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x72, 0x0a, 0x0a, 0x52, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x54, 0x61, 0x73, 0x6b, 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, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 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, 0xf9, - 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x54, 0x61, 0x73, 0x6b, 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, 0x1a, 0x4b, 0x0a, 0x12, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 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, 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, + 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, 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, 0x22, 0x73, 0x0a, 0x06, 0x53, 0x74, 0x61, + 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, @@ -3174,7 +3407,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_rawDescGZIP() []byte { } var file_c1_connectorapi_baton_v1_baton_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 39) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (Task_Status)(0), // 0: c1.connectorapi.baton.v1.Task.Status (*Task)(nil), // 1: c1.connectorapi.baton.v1.Task @@ -3209,28 +3442,31 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (*Task_ActionGetSchemaTask)(nil), // 30: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask (*Task_ActionInvokeTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionInvokeTask (*Task_ActionStatusTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionStatusTask - (*BatonServiceHelloRequest_BuildInfo)(nil), // 33: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 34: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 35: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 40: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 41: google.protobuf.Any - (*durationpb.Duration)(nil), // 42: google.protobuf.Duration - (*status.Status)(nil), // 43: google.rpc.Status - (*timestamppb.Timestamp)(nil), // 44: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 45: c1.connector.v2.Entitlement - (*v2.Resource)(nil), // 46: c1.connector.v2.Resource - (*v2.Grant)(nil), // 47: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 48: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 49: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 50: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 51: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 52: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 53: c1.connector.v2.TicketSchema - (*structpb.Struct)(nil), // 54: google.protobuf.Struct + (*Task_CreateSyncDiffTask)(nil), // 33: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + (*Task_CompactSyncs)(nil), // 34: c1.connectorapi.baton.v1.Task.CompactSyncs + (*Task_CompactSyncs_CompactableSync)(nil), // 35: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + (*BatonServiceHelloRequest_BuildInfo)(nil), // 36: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 37: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 43: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 44: google.protobuf.Any + (*durationpb.Duration)(nil), // 45: google.protobuf.Duration + (*status.Status)(nil), // 46: google.rpc.Status + (*timestamppb.Timestamp)(nil), // 47: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 48: c1.connector.v2.Entitlement + (*v2.Resource)(nil), // 49: c1.connector.v2.Resource + (*v2.Grant)(nil), // 50: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 51: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 52: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 53: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 54: c1.connector.v2.ResourceId + (*v2.TicketRequest)(nil), // 55: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 56: c1.connector.v2.TicketSchema + (*structpb.Struct)(nil), // 57: google.protobuf.Struct } var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 0, // 0: c1.connectorapi.baton.v1.Task.status:type_name -> c1.connectorapi.baton.v1.Task.Status @@ -3253,80 +3489,85 @@ var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 30, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask 31, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask 32, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask - 33, // 20: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 34, // 21: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 40, // 22: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 41, // 23: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 41, // 24: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any - 1, // 25: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 42, // 26: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 42, // 27: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 41, // 28: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 41, // 29: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 42, // 30: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 41, // 31: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 35, // 32: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 36, // 33: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 37, // 34: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 41, // 35: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 43, // 36: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 38, // 37: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 39, // 38: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 41, // 39: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 41, // 40: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 41, // 41: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 41, // 42: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 41, // 43: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 44, // 44: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 45, // 45: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 46, // 46: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 41, // 47: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 42, // 48: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 47, // 49: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 41, // 50: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 48, // 51: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 49, // 52: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 50, // 53: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 46, // 54: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 51, // 55: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 51, // 56: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 49, // 57: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 50, // 58: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 52, // 59: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 53, // 60: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 41, // 61: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 24, // 62: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 28, // 63: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 41, // 64: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 41, // 65: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 41, // 66: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 41, // 67: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 54, // 68: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 41, // 69: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 41, // 70: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 41, // 71: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 41, // 72: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 41, // 73: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 41, // 74: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 41, // 75: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 41, // 76: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 77: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 78: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 6, // 79: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 10, // 80: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 8, // 81: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 12, // 82: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 83: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 5, // 84: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 7, // 85: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 11, // 86: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 9, // 87: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 13, // 88: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 83, // [83:89] is the sub-list for method output_type - 77, // [77:83] is the sub-list for method input_type - 77, // [77:77] is the sub-list for extension type_name - 77, // [77:77] is the sub-list for extension extendee - 0, // [0:77] is the sub-list for field type_name + 33, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + 34, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs + 36, // 22: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 37, // 23: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 43, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 44, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 44, // 26: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 1, // 27: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task + 45, // 28: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 45, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 44, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 44, // 31: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 45, // 32: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 44, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 38, // 34: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 39, // 35: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 44, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 46, // 38: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 41, // 39: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 42, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 44, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 44, // 42: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 44, // 43: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 44, // 44: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 44, // 45: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 47, // 46: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 48, // 47: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 49, // 48: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 44, // 49: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 45, // 50: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 50, // 51: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 44, // 52: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 51, // 53: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 52, // 54: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 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 } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } @@ -3354,6 +3595,8 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { (*Task_ActionGetSchema)(nil), (*Task_ActionInvoke)(nil), (*Task_ActionStatus)(nil), + (*Task_CreateSyncDiff)(nil), + (*Task_CompactSyncs_)(nil), } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[7].OneofWrappers = []any{ (*BatonServiceUploadAssetRequest_Metadata)(nil), @@ -3370,7 +3613,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connectorapi_baton_v1_baton_proto_rawDesc), len(file_c1_connectorapi_baton_v1_baton_proto_rawDesc)), NumEnums: 1, - NumMessages: 39, + NumMessages: 42, NumExtensions: 0, NumServices: 1, }, 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 da7fa9c8..15741a2a 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 @@ -842,6 +842,88 @@ func (m *Task) validate(all bool) error { } } + case *Task_CreateSyncDiff: + if v == nil { + err := TaskValidationError{ + field: "TaskType", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetCreateSyncDiff()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TaskValidationError{ + field: "CreateSyncDiff", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TaskValidationError{ + field: "CreateSyncDiff", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreateSyncDiff()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TaskValidationError{ + field: "CreateSyncDiff", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Task_CompactSyncs_: + if v == nil { + err := TaskValidationError{ + field: "TaskType", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetCompactSyncs()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TaskValidationError{ + field: "CompactSyncs", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TaskValidationError{ + field: "CompactSyncs", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCompactSyncs()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TaskValidationError{ + field: "CompactSyncs", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -5932,6 +6014,425 @@ var _ interface { ErrorName() string } = Task_ActionStatusTaskValidationError{} +// Validate checks the field values on Task_CreateSyncDiffTask 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 *Task_CreateSyncDiffTask) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Task_CreateSyncDiffTask 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 +// Task_CreateSyncDiffTaskMultiError, or nil if none found. +func (m *Task_CreateSyncDiffTask) ValidateAll() error { + return m.validate(true) +} + +func (m *Task_CreateSyncDiffTask) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for BaseSyncId + + // no validation rules for NewSyncId + + 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, Task_CreateSyncDiffTaskValidationError{ + 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, Task_CreateSyncDiffTaskValidationError{ + 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 Task_CreateSyncDiffTaskValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return Task_CreateSyncDiffTaskMultiError(errors) + } + + return nil +} + +// Task_CreateSyncDiffTaskMultiError is an error wrapping multiple validation +// errors returned by Task_CreateSyncDiffTask.ValidateAll() if the designated +// constraints aren't met. +type Task_CreateSyncDiffTaskMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Task_CreateSyncDiffTaskMultiError) 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 Task_CreateSyncDiffTaskMultiError) AllErrors() []error { return m } + +// Task_CreateSyncDiffTaskValidationError is the validation error returned by +// Task_CreateSyncDiffTask.Validate if the designated constraints aren't met. +type Task_CreateSyncDiffTaskValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Task_CreateSyncDiffTaskValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Task_CreateSyncDiffTaskValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Task_CreateSyncDiffTaskValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Task_CreateSyncDiffTaskValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Task_CreateSyncDiffTaskValidationError) ErrorName() string { + return "Task_CreateSyncDiffTaskValidationError" +} + +// Error satisfies the builtin error interface +func (e Task_CreateSyncDiffTaskValidationError) 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 %sTask_CreateSyncDiffTask.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Task_CreateSyncDiffTaskValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Task_CreateSyncDiffTaskValidationError{} + +// Validate checks the field values on Task_CompactSyncs 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 *Task_CompactSyncs) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Task_CompactSyncs 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 +// Task_CompactSyncsMultiError, or nil if none found. +func (m *Task_CompactSyncs) ValidateAll() error { + return m.validate(true) +} + +func (m *Task_CompactSyncs) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetCompactableSyncs() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Task_CompactSyncsValidationError{ + field: fmt.Sprintf("CompactableSyncs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Task_CompactSyncsValidationError{ + field: fmt.Sprintf("CompactableSyncs[%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 Task_CompactSyncsValidationError{ + field: fmt.Sprintf("CompactableSyncs[%v]", idx), + 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, Task_CompactSyncsValidationError{ + 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, Task_CompactSyncsValidationError{ + 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 Task_CompactSyncsValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return Task_CompactSyncsMultiError(errors) + } + + return nil +} + +// Task_CompactSyncsMultiError is an error wrapping multiple validation errors +// returned by Task_CompactSyncs.ValidateAll() if the designated constraints +// aren't met. +type Task_CompactSyncsMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Task_CompactSyncsMultiError) 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 Task_CompactSyncsMultiError) AllErrors() []error { return m } + +// Task_CompactSyncsValidationError is the validation error returned by +// Task_CompactSyncs.Validate if the designated constraints aren't met. +type Task_CompactSyncsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Task_CompactSyncsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Task_CompactSyncsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Task_CompactSyncsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Task_CompactSyncsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Task_CompactSyncsValidationError) ErrorName() string { + return "Task_CompactSyncsValidationError" +} + +// Error satisfies the builtin error interface +func (e Task_CompactSyncsValidationError) 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 %sTask_CompactSyncs.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Task_CompactSyncsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Task_CompactSyncsValidationError{} + +// Validate checks the field values on Task_CompactSyncs_CompactableSync 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 *Task_CompactSyncs_CompactableSync) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Task_CompactSyncs_CompactableSync +// 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 +// Task_CompactSyncs_CompactableSyncMultiError, or nil if none found. +func (m *Task_CompactSyncs_CompactableSync) ValidateAll() error { + return m.validate(true) +} + +func (m *Task_CompactSyncs_CompactableSync) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for FilePath + + // no validation rules for SyncId + + if len(errors) > 0 { + return Task_CompactSyncs_CompactableSyncMultiError(errors) + } + + return nil +} + +// Task_CompactSyncs_CompactableSyncMultiError is an error wrapping multiple +// validation errors returned by +// Task_CompactSyncs_CompactableSync.ValidateAll() if the designated +// constraints aren't met. +type Task_CompactSyncs_CompactableSyncMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Task_CompactSyncs_CompactableSyncMultiError) 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 Task_CompactSyncs_CompactableSyncMultiError) AllErrors() []error { return m } + +// Task_CompactSyncs_CompactableSyncValidationError is the validation error +// returned by Task_CompactSyncs_CompactableSync.Validate if the designated +// constraints aren't met. +type Task_CompactSyncs_CompactableSyncValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Task_CompactSyncs_CompactableSyncValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Task_CompactSyncs_CompactableSyncValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Task_CompactSyncs_CompactableSyncValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Task_CompactSyncs_CompactableSyncValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Task_CompactSyncs_CompactableSyncValidationError) ErrorName() string { + return "Task_CompactSyncs_CompactableSyncValidationError" +} + +// Error satisfies the builtin error interface +func (e Task_CompactSyncs_CompactableSyncValidationError) 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 %sTask_CompactSyncs_CompactableSync.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Task_CompactSyncs_CompactableSyncValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Task_CompactSyncs_CompactableSyncValidationError{} + // Validate checks the field values on BatonServiceHelloRequest_BuildInfo 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/reader/v2/sync.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/reader/v2/sync.pb.go index 9b50c16f..ec106f8e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/reader/v2/sync.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/reader/v2/sync.pb.go @@ -30,6 +30,8 @@ type SyncRun struct { StartedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` EndedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=ended_at,json=endedAt,proto3" json:"ended_at,omitempty"` SyncToken string `protobuf:"bytes,4,opt,name=sync_token,json=syncToken,proto3" json:"sync_token,omitempty"` + SyncType string `protobuf:"bytes,5,opt,name=sync_type,json=syncType,proto3" json:"sync_type,omitempty"` + ParentSyncId string `protobuf:"bytes,6,opt,name=parent_sync_id,json=parentSyncId,proto3" json:"parent_sync_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -92,6 +94,20 @@ func (x *SyncRun) GetSyncToken() string { return "" } +func (x *SyncRun) GetSyncType() string { + if x != nil { + return x.SyncType + } + return "" +} + +func (x *SyncRun) GetParentSyncId() string { + if x != nil { + return x.ParentSyncId + } + return "" +} + type SyncsReaderServiceGetSyncRequest struct { state protoimpl.MessageState `protogen:"open.v1"` SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3" json:"sync_id,omitempty"` @@ -319,6 +335,7 @@ func (x *SyncsReaderServiceListSyncsResponse) GetAnnotations() []*anypb.Any { type SyncsReaderServiceGetLatestFinishedSyncRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` + SyncType string `protobuf:"bytes,2,opt,name=sync_type,json=syncType,proto3" json:"sync_type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -360,6 +377,13 @@ func (x *SyncsReaderServiceGetLatestFinishedSyncRequest) GetAnnotations() []*any return nil } +func (x *SyncsReaderServiceGetLatestFinishedSyncRequest) GetSyncType() string { + if x != nil { + return x.SyncType + } + return "" +} + type SyncsReaderServiceGetLatestFinishedSyncResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Sync *SyncRun `protobuf:"bytes,1,opt,name=sync,proto3" json:"sync,omitempty"` @@ -422,7 +446,7 @@ var file_c1_reader_v2_sync_proto_rawDesc = string([]byte{ 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0xaa, 0x01, 0x0a, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x01, 0x0a, 0x07, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, @@ -433,91 +457,97 @@ var file_c1_reader_v2_sync_proto_rawDesc = string([]byte{ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x79, 0x6e, 0x63, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x73, 0x0a, 0x20, 0x53, 0x79, 0x6e, - 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, - 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x79, 0x6e, 0x63, 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, 0x86, - 0x01, 0x0a, 0x21, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, - 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x52, 0x04, 0x73, 0x79, 0x6e, 0x63, 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, 0xb3, 0x01, 0x0a, 0x22, 0x53, 0x79, 0x6e, 0x63, - 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, - 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 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, 0x2c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, - 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x10, 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, 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, 0xc1, 0x01, - 0x0a, 0x23, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x73, 0x79, 0x6e, 0x63, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x52, 0x05, 0x73, 0x79, 0x6e, - 0x63, 0x73, 0x12, 0x35, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, - 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x10, 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, + 0x73, 0x79, 0x6e, 0x63, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x79, + 0x6e, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x22, 0x73, 0x0a, 0x20, + 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 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, 0x68, 0x0a, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 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, 0x94, 0x01, 0x0a, 0x2f, + 0x73, 0x22, 0x86, 0x01, 0x0a, 0x21, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x73, 0x79, 0x6e, 0x63, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x52, 0x04, 0x73, 0x79, + 0x6e, 0x63, 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, 0xb3, 0x01, 0x0a, 0x22, 0x53, + 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x27, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, + 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, 0x2c, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, + 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x10, 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, 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, 0xc1, 0x01, 0x0a, 0x23, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x73, 0x79, 0x6e, 0x63, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x52, 0x05, + 0x73, 0x79, 0x6e, 0x63, 0x73, 0x12, 0x35, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, + 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x10, 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, 0x85, 0x01, 0x0a, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, + 0x1b, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x79, 0x70, 0x65, 0x22, 0x94, 0x01, 0x0a, + 0x2f, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x69, + 0x73, 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x29, 0x0a, 0x04, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x52, 0x75, 0x6e, 0x52, 0x04, 0x73, 0x79, 0x6e, 0x63, 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, 0x32, 0x89, 0x03, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x07, 0x47, 0x65, + 0x74, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x2e, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x70, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, + 0x6e, 0x63, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, + 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x53, 0x79, + 0x6e, 0x63, 0x12, 0x3c, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, + 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, + 0x69, 0x73, 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x29, 0x0a, 0x04, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x52, 0x75, 0x6e, 0x52, 0x04, 0x73, 0x79, 0x6e, 0x63, 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, 0x32, 0x89, 0x03, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x07, 0x47, 0x65, 0x74, - 0x53, 0x79, 0x6e, 0x63, 0x12, 0x2e, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x70, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, - 0x63, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, - 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, - 0x63, 0x12, 0x3c, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x32, - 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x69, - 0x73, 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x73, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, - 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, - 0x5a, 0x31, 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, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x33, 0x5a, 0x31, 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, 0x72, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/reader/v2/sync.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/reader/v2/sync.pb.validate.go index 13702f99..b87264e2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/reader/v2/sync.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/reader/v2/sync.pb.validate.go @@ -118,6 +118,10 @@ func (m *SyncRun) validate(all bool) error { // no validation rules for SyncToken + // no validation rules for SyncType + + // no validation rules for ParentSyncId + if len(errors) > 0 { return SyncRunMultiError(errors) } @@ -919,6 +923,8 @@ func (m *SyncsReaderServiceGetLatestFinishedSyncRequest) validate(all bool) erro } + // no validation rules for SyncType + if len(errors) > 0 { return SyncsReaderServiceGetLatestFinishedSyncRequestMultiError(errors) } 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 21fdaf07..14cdde2a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "os" + "sort" "time" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" @@ -131,7 +132,7 @@ func MakeMainCommand[T field.Configurable]( v.GetString("revoke-grant"), )) case v.GetBool("event-feed"): - opts = append(opts, connectorrunner.WithOnDemandEventStream()) + opts = append(opts, connectorrunner.WithOnDemandEventStream(v.GetString("event-feed-id"), v.GetTime("event-feed-start-at"))) case v.GetString("create-account-profile") != "": profileMap := v.GetStringMap("create-account-profile") if profileMap == nil { @@ -219,6 +220,28 @@ func MakeMainCommand[T field.Configurable]( opts = append(opts, connectorrunner.WithTicketingEnabled(), connectorrunner.WithGetTicket(v.GetString("ticket-id"))) + case len(v.GetStringSlice("sync-resources")) > 0: + opts = append(opts, + connectorrunner.WithTargetedSyncResourceIDs(v.GetStringSlice("sync-resources")), + connectorrunner.WithOnDemandSync(v.GetString("file")), + ) + case v.GetBool("diff-syncs"): + opts = append(opts, + connectorrunner.WithDiffSyncs( + v.GetString("file"), + v.GetString("base-sync-id"), + v.GetString("applied-sync-id"), + ), + ) + case v.GetBool("compact-syncs"): + opts = append(opts, + connectorrunner.WithSyncCompactor( + v.GetString("compact-output-path"), + v.GetStringSlice("compact-file-paths"), + v.GetStringSlice("compact-sync-ids"), + ), + ) + default: opts = append(opts, connectorrunner.WithOnDemandSync(v.GetString("file"))) } @@ -401,6 +424,8 @@ func MakeGRPCServerCommand[T field.Configurable]( copts = append(copts, connector.WithTicketingEnabled()) case v.GetBool("get-ticket"): copts = append(copts, connector.WithTicketingEnabled()) + case len(v.GetStringSlice("sync-resources")) > 0: + copts = append(copts, connector.WithTargetedSyncResourceIDs(v.GetStringSlice("sync-resources"))) } cw, err := connector.NewWrapper(runCtx, c, copts...) @@ -532,7 +557,13 @@ func MakeConfigSchemaCommand[T field.Configurable]( getconnector GetConnectorFunc[T], ) func(*cobra.Command, []string) error { return func(cmd *cobra.Command, args []string) error { - pb, err := json.Marshal(&confschema) + // Sort fields by FieldName + sort.Slice(confschema.Fields, func(i, j int) bool { + return confschema.Fields[i].FieldName < confschema.Fields[j].FieldName + }) + + // Use MarshalIndent for pretty printing + pb, err := json.MarshalIndent(&confschema, "", " ") 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 d84ba414..8791cdfd 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 @@ -36,7 +36,7 @@ func OptionallyAddLambdaCommand[T field.Configurable]( connectorSchema field.Configuration, mainCmd *cobra.Command, ) error { - lambdaSchema := field.NewConfiguration(field.LambdaServerFields(), field.LambdaServerRelationships...) + lambdaSchema := field.NewConfiguration(field.LambdaServerFields(), field.WithConstraints(field.LambdaServerRelationships...)) lambdaCmd, err := AddCommand(mainCmd, v, &lambdaSchema, &cobra.Command{ Use: "lambda", 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 493788a4..4149a39b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go @@ -51,6 +51,12 @@ func DefineConfiguration[T field.Configurable]( // Ensure unique fields uniqueFields := make(map[string]field.SchemaField) for _, f := range confschema.Fields { + if s, ok := uniqueFields[f.FieldName]; ok { + 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) + } + } + uniqueFields[f.FieldName] = f } confschema.Fields = make([]field.SchemaField, 0, len(uniqueFields)) @@ -66,14 +72,13 @@ func DefineConfiguration[T field.Configurable]( SilenceUsage: true, RunE: cli.MakeMainCommand(ctx, connectorName, v, confschema, connector, options...), } + + relationships := []field.SchemaFieldRelationship{} // set persistent flags only on the main subcommand - err = cli.SetFlagsAndConstraints(mainCMD, field.NewConfiguration(field.DefaultFields, field.DefaultRelationships...)) - if err != nil { - return nil, nil, err - } + relationships = append(relationships, field.DefaultRelationships...) + relationships = append(relationships, confschema.Constraints...) - // set the rest of flags - err = cli.SetFlagsAndConstraints(mainCMD, schema) + err = cli.SetFlagsAndConstraints(mainCMD, field.NewConfiguration(confschema.Fields, field.WithConstraints(relationships...))) if err != nil { return nil, nil, err } 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 b454c808..80d86e0b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go @@ -22,6 +22,7 @@ import ( "github.com/conductorone/baton-sdk/pkg/crypto" "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/types" "github.com/conductorone/baton-sdk/pkg/types/tasks" "github.com/conductorone/baton-sdk/pkg/uhttp" @@ -41,6 +42,7 @@ var tracer = otel.Tracer("baton-sdk/pkg.connectorbuilder") // - ResourceDeleter: For deleting resources // - AccountManager: For account provisioning operations // - CredentialManager: For credential rotation operations. +// - ResourceTargetedSyncer: For directly getting a resource supporting targeted sync. type ResourceSyncer interface { ResourceType(ctx context.Context) *v2.ResourceType List(ctx context.Context, parentResourceID *v2.ResourceId, pToken *pagination.Token) ([]*v2.Resource, string, annotations.Annotations, error) @@ -94,6 +96,15 @@ type ResourceDeleter interface { Delete(ctx context.Context, resourceId *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 +// of the associated resource type. +type ResourceTargetedSyncer interface { + ResourceSyncer + Get(ctx context.Context, resourceId *v2.ResourceId, parentResourceId *v2.ResourceId) (*v2.Resource, annotations.Annotations, error) +} + // CreateAccountResponse is a semi-opaque type returned from CreateAccount operations. // // This is used to communicate the result of account creation back to Baton. @@ -124,13 +135,57 @@ type CredentialManager interface { RotateCapabilityDetails(ctx context.Context) (*v2.CredentialDetailsCredentialRotation, annotations.Annotations, error) } -// EventProvider extends ConnectorBuilder to add capabilities for providing event streams. -// -// Implementing this interface indicates the connector can provide a stream of events -// from the external system, enabling near real-time updates in Baton. +// 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) +} + +// Deprecated: This interface is deprecated in favor of EventProviderV2 which supports +// multiple event feeds. Implementing this interface indicates the connector can provide +// a single stream of events from the external system, enabling near real-time updates +// in Baton. New connectors should implement EventProviderV2 instead. type EventProvider interface { ConnectorBuilder - ListEvents(ctx context.Context, earliestEvent *timestamppb.Timestamp, pToken *pagination.StreamToken) ([]*v2.Event, *pagination.StreamState, annotations.Annotations, error) + EventLister +} + +// NewEventProviderV2 is a new interface that allows connectors to provide multiple event feeds. +// +// This is the recommended interface for implementing event feed support in new connectors. +type EventProviderV2 interface { + ConnectorBuilder + EventFeeds(ctx context.Context) []EventFeed +} + +// EventFeed is a single stream of events from the external system. +// +// EventFeedMetadata describes this feed, and a connector can have multiple feeds. +type EventFeed interface { + EventLister + EventFeedMetadata(ctx context.Context) *v2.EventFeedMetadata +} + +type oldEventFeedWrapper struct { + feed EventLister +} + +const ( + LegacyBatonFeedId = "baton_feed_event" +) + +func (e *oldEventFeedWrapper) EventFeedMetadata(ctx context.Context) *v2.EventFeedMetadata { + return &v2.EventFeedMetadata{ + Id: LegacyBatonFeedId, + SupportedEventTypes: []v2.EventType{v2.EventType_EVENT_TYPE_UNSPECIFIED}, + } +} + +func (e *oldEventFeedWrapper) ListEvents( + ctx context.Context, + earliestEvent *timestamppb.Timestamp, + pToken *pagination.StreamToken, +) ([]*v2.Event, *pagination.StreamState, annotations.Annotations, error) { + return e.feed.ListEvents(ctx, earliestEvent, pToken) } // TicketManager extends ConnectorBuilder to add capabilities for ticket management. @@ -184,20 +239,21 @@ type ConnectorBuilder interface { } type builderImpl struct { - resourceBuilders map[string]ResourceSyncer - resourceProvisioners map[string]ResourceProvisioner - resourceProvisionersV2 map[string]ResourceProvisionerV2 - resourceManagers map[string]ResourceManager - resourceDeleters map[string]ResourceDeleter - accountManager AccountManager - actionManager CustomActionManager - credentialManagers map[string]CredentialManager - eventFeed EventProvider - cb ConnectorBuilder - ticketManager TicketManager - ticketingEnabled bool - m *metrics.M - nowFunc func() time.Time + resourceBuilders map[string]ResourceSyncer + resourceProvisioners map[string]ResourceProvisioner + resourceProvisionersV2 map[string]ResourceProvisionerV2 + resourceManagers map[string]ResourceManager + resourceDeleters map[string]ResourceDeleter + resourceTargetedSyncers map[string]ResourceTargetedSyncer + accountManager AccountManager + actionManager CustomActionManager + credentialManagers map[string]CredentialManager + eventFeeds map[string]EventFeed + cb ConnectorBuilder + ticketManager TicketManager + ticketingEnabled bool + m *metrics.M + nowFunc func() time.Time } func (b *builderImpl) BulkCreateTickets(ctx context.Context, request *v2.TicketsServiceBulkCreateTicketsRequest) (*v2.TicketsServiceBulkCreateTicketsResponse, error) { @@ -395,17 +451,19 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne switch c := in.(type) { case ConnectorBuilder: ret := &builderImpl{ - resourceBuilders: make(map[string]ResourceSyncer), - resourceProvisioners: make(map[string]ResourceProvisioner), - resourceProvisionersV2: make(map[string]ResourceProvisionerV2), - resourceManagers: make(map[string]ResourceManager), - resourceDeleters: make(map[string]ResourceDeleter), - accountManager: nil, - actionManager: nil, - credentialManagers: make(map[string]CredentialManager), - cb: c, - ticketManager: nil, - nowFunc: time.Now, + resourceBuilders: make(map[string]ResourceSyncer), + resourceProvisioners: make(map[string]ResourceProvisioner), + resourceProvisionersV2: make(map[string]ResourceProvisionerV2), + resourceManagers: make(map[string]ResourceManager), + resourceDeleters: make(map[string]ResourceDeleter), + resourceTargetedSyncers: make(map[string]ResourceTargetedSyncer), + accountManager: nil, + actionManager: nil, + credentialManagers: make(map[string]CredentialManager), + eventFeeds: make(map[string]EventFeed), + cb: c, + ticketManager: nil, + nowFunc: time.Now, } err := ret.options(opts...) @@ -417,8 +475,31 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne ret.m = metrics.New(metrics.NewNoOpHandler(ctx)) } + if b, ok := c.(EventProviderV2); ok { + for _, ef := range b.EventFeeds(ctx) { + feedData := ef.EventFeedMetadata(ctx) + if feedData == nil { + return nil, fmt.Errorf("error: event feed metadata is nil") + } + if err := feedData.Validate(); err != nil { + return nil, fmt.Errorf("error: event feed metadata for %s is invalid: %w", feedData.Id, err) + } + if _, ok := ret.eventFeeds[feedData.Id]; ok { + return nil, fmt.Errorf("error: duplicate event feed id found: %s", feedData.Id) + } + ret.eventFeeds[feedData.Id] = ef + } + } + if b, ok := c.(EventProvider); ok { - ret.eventFeed = b + // Register the legacy Baton feed as a v2 event feed + // implementing both v1 and v2 event feeds is not supported. + if len(ret.eventFeeds) != 0 { + return nil, fmt.Errorf("error: using legacy event feed is not supported when using EventProviderV2") + } + ret.eventFeeds[LegacyBatonFeedId] = &oldEventFeedWrapper{ + feed: b, + } } if ticketManager, ok := c.(TicketManager); ok { @@ -472,6 +553,12 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne } ret.resourceProvisionersV2[rType.Id] = provisioner } + if targetedSyncer, ok := rb.(ResourceTargetedSyncer); ok { + if _, ok := ret.resourceTargetedSyncers[rType.Id]; ok { + return nil, fmt.Errorf("error: duplicate resource type found for resource targeted syncer %s", rType.Id) + } + ret.resourceTargetedSyncers[rType.Id] = targetedSyncer + } if resourceManager, ok := rb.(ResourceManager); ok { if _, ok := ret.resourceManagers[rType.Id]; ok { @@ -568,10 +655,20 @@ func (b *builderImpl) ListResourceTypes( tt := tasks.ListResourceTypesType var out []*v2.ResourceType + if len(b.resourceBuilders) == 0 { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: no resource builders found") + } + for _, rb := range b.resourceBuilders { out = append(out, rb.ResourceType(ctx)) } + if len(out) == 0 { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: no resource types found") + } + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) return &v2.ResourceTypesServiceListResourceTypesResponse{List: out}, nil } @@ -611,6 +708,36 @@ func (b *builderImpl) ListResources(ctx context.Context, request *v2.ResourcesSe return resp, nil } +func (b *builderImpl) GetResource(ctx context.Context, request *v2.ResourceGetterServiceGetResourceRequest) (*v2.ResourceGetterServiceGetResourceResponse, error) { + ctx, span := tracer.Start(ctx, "builderImpl.GetResource") + defer span.End() + + start := b.nowFunc() + tt := tasks.GetResourceType + resourceType := request.GetResourceId().GetResourceType() + rb, ok := b.resourceTargetedSyncers[resourceType] + if !ok { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Errorf(codes.Unimplemented, "error: get resource with unknown resource type %s", resourceType) + } + + resource, annos, err := rb.Get(ctx, request.GetResourceId(), request.GetParentResourceId()) + if err != nil { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: get resource failed: %w", err) + } + if resource == nil { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.NotFound, "error: get resource returned nil") + } + + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) + return &v2.ResourceGetterServiceGetResourceResponse{ + Resource: resource, + Annotations: annos, + }, nil +} + // ListEntitlements returns all the entitlements for a given resource. func (b *builderImpl) ListEntitlements(ctx context.Context, request *v2.EntitlementsServiceListEntitlementsRequest) (*v2.EntitlementsServiceListEntitlementsResponse, error) { ctx, span := tracer.Start(ctx, "builderImpl.ListEntitlements") @@ -779,6 +906,10 @@ func getCapabilities(ctx context.Context, b *builderImpl) (*v2.ConnectorCapabili Capabilities: []v2.Capability{v2.Capability_CAPABILITY_SYNC}, } connectorCaps[v2.Capability_CAPABILITY_SYNC] = struct{}{} + if _, ok := rb.(ResourceTargetedSyncer); ok { + resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_TARGETED_SYNC) + connectorCaps[v2.Capability_CAPABILITY_TARGETED_SYNC] = struct{}{} + } if _, ok := rb.(ResourceProvisioner); ok { resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_PROVISION) connectorCaps[v2.Capability_CAPABILITY_PROVISION] = struct{}{} @@ -811,8 +942,8 @@ func getCapabilities(ctx context.Context, b *builderImpl) (*v2.ConnectorCapabili return resourceTypeCapabilities[i].ResourceType.GetId() < resourceTypeCapabilities[j].ResourceType.GetId() }) - if b.eventFeed != nil { - connectorCaps[v2.Capability_CAPABILITY_EVENT_FEED] = struct{}{} + if len(b.eventFeeds) > 0 { + connectorCaps[v2.Capability_CAPABILITY_EVENT_FEED_V2] = struct{}{} } if b.ticketManager != nil { @@ -863,35 +994,48 @@ func (b *builderImpl) Grant(ctx context.Context, request *v2.GrantManagerService l := ctxzap.Extract(ctx) rt := request.Entitlement.Resource.Id.ResourceType + + retryer := retry.NewRetryer(ctx, retry.RetryConfig{ + MaxAttempts: 3, + InitialDelay: 15 * time.Second, + MaxDelay: 60 * time.Second, + }) + + var grantFunc func(ctx context.Context, principal *v2.Resource, entitlement *v2.Entitlement) ([]*v2.Grant, annotations.Annotations, error) provisioner, ok := b.resourceProvisioners[rt] if ok { - annos, err := provisioner.Grant(ctx, request.Principal, request.Entitlement) - if err != nil { - l.Error("error: grant failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: grant failed: %w", err) + grantFunc = func(ctx context.Context, principal *v2.Resource, entitlement *v2.Entitlement) ([]*v2.Grant, annotations.Annotations, error) { + annos, err := provisioner.Grant(ctx, principal, entitlement) + if err != nil { + return nil, annos, err + } + return nil, annos, nil } - - b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) - return &v2.GrantManagerServiceGrantResponse{Annotations: annos}, nil } - provisionerV2, ok := b.resourceProvisionersV2[rt] if ok { - grants, annos, err := provisionerV2.Grant(ctx, request.Principal, request.Entitlement) - if err != nil { - l.Error("error: grant failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: grant failed: %w", err) - } + grantFunc = provisionerV2.Grant + } - b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) - return &v2.GrantManagerServiceGrantResponse{Annotations: annos, Grants: grants}, nil + if grantFunc == nil { + l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: resource type does not have provisioner configured") } - l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: resource type does not have provisioner configured") + for { + grants, annos, err := grantFunc(ctx, request.Principal, request.Entitlement) + if err == nil { + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) + return &v2.GrantManagerServiceGrantResponse{Annotations: annos, Grants: grants}, nil + } + if retryer.ShouldWaitAndRetry(ctx, err) { + continue + } + l.Error("error: grant failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("err: grant failed: %w", err) + } } func (b *builderImpl) Revoke(ctx context.Context, request *v2.GrantManagerServiceRevokeRequest) (*v2.GrantManagerServiceRevokeResponse, error) { @@ -904,33 +1048,42 @@ func (b *builderImpl) Revoke(ctx context.Context, request *v2.GrantManagerServic l := ctxzap.Extract(ctx) rt := request.Grant.Entitlement.Resource.Id.ResourceType + + retryer := retry.NewRetryer(ctx, retry.RetryConfig{ + MaxAttempts: 3, + InitialDelay: 15 * time.Second, + MaxDelay: 60 * time.Second, + }) + + var revokeFunc func(ctx context.Context, grant *v2.Grant) (annotations.Annotations, error) provisioner, ok := b.resourceProvisioners[rt] if ok { - annos, err := provisioner.Revoke(ctx, request.Grant) - if err != nil { - l.Error("error: revoke failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: revoke failed: %w", err) - } - return &v2.GrantManagerServiceRevokeResponse{Annotations: annos}, nil + revokeFunc = provisioner.Revoke } - provisionerV2, ok := b.resourceProvisionersV2[rt] if ok { - annos, err := provisionerV2.Revoke(ctx, request.Grant) - if err != nil { - l.Error("error: revoke failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: revoke failed: %w", err) - } + revokeFunc = provisionerV2.Revoke + } - b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) - return &v2.GrantManagerServiceRevokeResponse{Annotations: annos}, nil + if revokeFunc == nil { + l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: resource type does not have provisioner configured") } - l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, "resource type does not have provisioner configured") + for { + annos, err := revokeFunc(ctx, request.Grant) + if err == nil { + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) + return &v2.GrantManagerServiceRevokeResponse{Annotations: annos}, nil + } + if retryer.ShouldWaitAndRetry(ctx, err) { + continue + } + l.Error("error: revoke failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: revoke failed: %w", err) + } } // GetAsset streams the asset to the client. @@ -942,17 +1095,44 @@ func (b *builderImpl) GetAsset(request *v2.AssetServiceGetAssetRequest, server v return nil } +func (b *builderImpl) ListEventFeeds(ctx context.Context, request *v2.ListEventFeedsRequest) (*v2.ListEventFeedsResponse, error) { + ctx, span := tracer.Start(ctx, "builderImpl.ListEventFeeds") + defer span.End() + + start := b.nowFunc() + tt := tasks.ListEventFeedsType + + feeds := make([]*v2.EventFeedMetadata, 0, len(b.eventFeeds)) + + for _, feed := range b.eventFeeds { + feeds = append(feeds, feed.EventFeedMetadata(ctx)) + } + + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) + return &v2.ListEventFeedsResponse{ + List: feeds, + }, nil +} + func (b *builderImpl) ListEvents(ctx context.Context, request *v2.ListEventsRequest) (*v2.ListEventsResponse, error) { ctx, span := tracer.Start(ctx, "builderImpl.ListEvents") defer span.End() start := b.nowFunc() - tt := tasks.ListEventsType - if b.eventFeed == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: event feed not implemented") + feedId := request.GetEventFeedId() + + // If no feedId is provided, use the legacy Baton feed Id + if feedId == "" { + feedId = LegacyBatonFeedId } - events, streamState, annotations, err := b.eventFeed.ListEvents(ctx, request.StartAt, &pagination.StreamToken{ + + feed, ok := b.eventFeeds[feedId] + if !ok { + return nil, status.Errorf(codes.NotFound, "error: event feed not found") + } + + tt := tasks.ListEventsType + events, streamState, annotations, err := feed.ListEvents(ctx, request.StartAt, &pagination.StreamToken{ Size: int(request.PageSize), Cursor: request.Cursor, }) 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 2b1aba42..d6468d82 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/conductorone/baton-sdk/pkg/synccompactor" "golang.org/x/sync/semaphore" "google.golang.org/protobuf/types/known/structpb" @@ -44,20 +45,36 @@ var ErrSigTerm = errors.New("context cancelled by process shutdown") // Run starts a connector and creates a new C1Z file. func (c *connectorRunner) Run(ctx context.Context) error { + l := ctxzap.Extract(ctx) ctx, cancel := context.WithCancelCause(ctx) defer cancel(ErrSigTerm) if c.tasks.ShouldDebug() && c.debugFile == nil { var err error - c.debugFile, err = os.Create(filepath.Join(c.tasks.GetTempDir(), "debug.log")) + tempDir := c.tasks.GetTempDir() + if tempDir == "" { + wd, err := os.Getwd() + if err != nil { + 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 task manager,"+ + " 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 task manager") + } + } + debugFile := filepath.Join(tempDir, "debug.log") + c.debugFile, err = os.Create(debugFile) if err != nil { - return err + l.Warn("cannot create file", zap.String("full file path", debugFile), zap.Error(err)) } } // modify the context to insert a logger directed to a file if c.debugFile != nil { - l := ctxzap.Extract(ctx) writeSyncer := zapcore.AddSync(c.debugFile) encoder := zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig()) core := zapcore.NewCore(encoder, writeSyncer, zapcore.DebugLevel) @@ -101,6 +118,7 @@ func (c *connectorRunner) handleContextCancel(ctx context.Context) error { l.Debug("runner: unexpected context cancellation", zap.Error(err)) return err } + func (c *connectorRunner) processTask(ctx context.Context, task *v1.Task) error { cc, err := c.cw.C(ctx) if err != nil { @@ -280,6 +298,19 @@ type rotateCredentialsConfig struct { } type eventStreamConfig struct { + feedId string + startAt time.Time +} + +type syncDifferConfig struct { + baseSyncID string + appliedSyncID string +} + +type syncCompactorConfig struct { + filePaths []string + syncIDs []string + outputPath string } type runnerConfig struct { @@ -303,7 +334,10 @@ type runnerConfig struct { bulkCreateTicketConfig *bulkCreateTicketConfig listTicketSchemasConfig *listTicketSchemasConfig getTicketConfig *getTicketConfig + syncDifferConfig *syncDifferConfig + syncCompactorConfig *syncCompactorConfig skipFullSync bool + targetedSyncResourceIDs []string externalResourceC1Z string externalResourceEntitlementIdFilter string } @@ -395,6 +429,7 @@ func WithOnDemandGrant(c1zPath string, entitlementID string, principalID string, return nil } } + func WithClientCredentials(clientID string, clientSecret string) Option { return func(ctx context.Context, cfg *runnerConfig) error { cfg.clientID = clientID @@ -459,10 +494,14 @@ func WithOnDemandSync(c1zPath string) Option { return nil } } -func WithOnDemandEventStream() Option { + +func WithOnDemandEventStream(feedId string, startAt time.Time) Option { return func(ctx context.Context, cfg *runnerConfig) error { cfg.onDemand = true - cfg.eventFeedConfig = &eventStreamConfig{} + cfg.eventFeedConfig = &eventStreamConfig{ + feedId: feedId, + startAt: startAt, + } return nil } } @@ -481,6 +520,13 @@ func WithFullSyncDisabled() Option { } } +func WithTargetedSyncResourceIDs(resourceIDs []string) Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.targetedSyncResourceIDs = resourceIDs + return nil + } +} + func WithTicketingEnabled() Option { return func(ctx context.Context, cfg *runnerConfig) error { cfg.ticketingEnabled = true @@ -547,6 +593,32 @@ func WithExternalResourceEntitlementFilter(entitlementId string) Option { } } +func WithDiffSyncs(c1zPath string, baseSyncID string, newSyncID string) Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.onDemand = true + cfg.c1zPath = c1zPath + cfg.syncDifferConfig = &syncDifferConfig{ + baseSyncID: baseSyncID, + appliedSyncID: newSyncID, + } + return nil + } +} + +func WithSyncCompactor(outputPath string, filePaths []string, syncIDs []string) Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.onDemand = true + cfg.c1zPath = "dummy" + + cfg.syncCompactorConfig = &syncCompactorConfig{ + filePaths: filePaths, + syncIDs: syncIDs, + outputPath: outputPath, + } + return nil + } +} + // NewConnectorRunner creates a new connector runner. func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Option) (*connectorRunner, error) { runner := &connectorRunner{} @@ -578,6 +650,10 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op wrapperOpts = append(wrapperOpts, connector.WithFullSyncDisabled()) } + if len(cfg.targetedSyncResourceIDs) > 0 { + wrapperOpts = append(wrapperOpts, connector.WithTargetedSyncResourceIDs(cfg.targetedSyncResourceIDs)) + } + cw, err := connector.NewWrapper(ctx, c, wrapperOpts...) if err != nil { return nil, err @@ -614,7 +690,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op tm = local.NewCredentialRotator(ctx, cfg.c1zPath, cfg.rotateCredentialsConfig.resourceId, cfg.rotateCredentialsConfig.resourceType) case cfg.eventFeedConfig != nil: - tm = local.NewEventFeed(ctx) + tm = local.NewEventFeed(ctx, cfg.eventFeedConfig.feedId, cfg.eventFeedConfig.startAt) case cfg.createTicketConfig != nil: tm = local.NewTicket(ctx, cfg.createTicketConfig.templatePath) case cfg.listTicketSchemasConfig != nil: @@ -623,11 +699,28 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op tm = local.NewGetTicket(ctx, cfg.getTicketConfig.ticketID) case cfg.bulkCreateTicketConfig != nil: tm = local.NewBulkTicket(ctx, cfg.bulkCreateTicketConfig.templatePath) + case cfg.syncDifferConfig != nil: + tm = local.NewDiffer(ctx, cfg.c1zPath, cfg.syncDifferConfig.baseSyncID, cfg.syncDifferConfig.appliedSyncID) + case cfg.syncCompactorConfig != nil: + c := cfg.syncCompactorConfig + if len(c.filePaths) != len(c.syncIDs) { + return nil, errors.New("sync-compactor: must include exactly one syncID per file") + } + configs := make([]*synccompactor.CompactableSync, 0, len(c.filePaths)) + for i, filePath := range c.filePaths { + configs = append(configs, &synccompactor.CompactableSync{ + FilePath: filePath, + SyncID: c.syncIDs[i], + }) + } + tm = local.NewLocalCompactor(ctx, cfg.syncCompactorConfig.outputPath, configs) default: tm, err = local.NewSyncer(ctx, cfg.c1zPath, local.WithTmpDir(cfg.tempDir), local.WithExternalResourceC1Z(cfg.externalResourceC1Z), - local.WithExternalResourceEntitlementIdFilter(cfg.externalResourceEntitlementIdFilter)) + local.WithExternalResourceEntitlementIdFilter(cfg.externalResourceEntitlementIdFilter), + local.WithTargetedSyncResourceIDs(cfg.targetedSyncResourceIDs), + ) if err != nil { return nil, err } @@ -639,7 +732,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op return runner, nil } - tm, err := c1api.NewC1TaskManager(ctx, cfg.clientID, cfg.clientSecret, cfg.tempDir, cfg.skipFullSync, cfg.externalResourceC1Z, cfg.externalResourceEntitlementIdFilter) + tm, err := c1api.NewC1TaskManager(ctx, cfg.clientID, cfg.clientSecret, cfg.tempDir, cfg.skipFullSync, cfg.externalResourceC1Z, cfg.externalResourceEntitlementIdFilter, cfg.targetedSyncResourceIDs) 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 7ca90658..71db3b92 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go @@ -36,6 +36,8 @@ 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) + SetCurrentSync(ctx context.Context, syncID string) error CurrentSyncStep(ctx context.Context) (string, error) CheckpointSync(ctx context.Context, syncToken string) error EndSync(ctx context.Context) error diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/assets.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/assets.go index 6fc9066f..035fbcf6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/assets.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/assets.go @@ -49,6 +49,10 @@ func (r *assetsTable) Schema() (string, []interface{}) { } } +func (r *assetsTable) Migrations(ctx context.Context, db *goqu.Database) error { + return nil +} + // PutAsset stores the given asset in the database. func (c *C1File) PutAsset(ctx context.Context, assetRef *v2.AssetRef, contentType string, data []byte) error { ctx, span := tracer.Start(ctx, "C1File.PutAsset") 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 87fe0270..11bf0fc6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go @@ -93,6 +93,11 @@ func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1Fi return nil, err } + err = c1File.init(ctx) + if err != nil { + return nil, err + } + return c1File, nil } @@ -141,11 +146,6 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( c1File.outputFilePath = outputFilePath - err = c1File.init(ctx) - if err != nil { - return nil, err - } - return c1File, nil } @@ -192,11 +192,14 @@ func (c *C1File) init(ctx context.Context) error { for _, t := range allTableDescriptors { query, args := t.Schema() - _, err = c.db.ExecContext(ctx, fmt.Sprintf(query, args...)) if err != nil { return err } + err = t.Migrations(ctx, c.db) + if err != nil { + return err + } } for _, pragma := range c.pragmas { @@ -288,3 +291,10 @@ func (c *C1File) validateSyncDb(ctx context.Context) error { return c.validateDb(ctx) } + +func (c *C1File) OutputFilepath() (string, error) { + if c.outputFilePath == "" { + return "", fmt.Errorf("c1file: output file path is empty") + } + return c.outputFilePath, 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 new file mode 100644 index 00000000..476b4ccc --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/diff.go @@ -0,0 +1,113 @@ +package dotc1z + +import ( + "context" + "fmt" + "strings" + + "github.com/doug-martin/goqu/v9" + "github.com/segmentio/ksuid" +) + +func (c *C1File) GenerateSyncDiff(ctx context.Context, baseSyncID string, appliedSyncID string) (string, error) { + // Validate that both sync runs exist + baseSync, err := c.getSync(ctx, baseSyncID) + if err != nil { + return "", err + } + if baseSync == nil { + return "", fmt.Errorf("generate-diff: base sync not found") + } + + newSync, err := c.getSync(ctx, appliedSyncID) + if err != nil { + return "", err + } + if newSync == nil { + return "", fmt.Errorf("generate-diff: new sync not found") + } + + // Generate a new unique ID for the diff sync + diffSyncID := ksuid.New().String() + + if err := c.insertSyncRun(ctx, diffSyncID, SyncTypePartial, baseSyncID); err != nil { + return "", err + } + + for _, t := range allTableDescriptors { + if strings.Contains(t.Name(), syncRunsTableName) { + continue + } + + q, args, err := c.diffTableQuery(t, baseSyncID, appliedSyncID, diffSyncID) + if err != nil { + return "", err + } + _, err = c.db.ExecContext(ctx, q, args...) + if err != nil { + return "", err + } + c.dbUpdated = true + } + + if err := c.endSyncRun(ctx, diffSyncID); err != nil { + return "", err + } + + return diffSyncID, nil +} + +func (c *C1File) diffTableQuery(table tableDescriptor, baseSyncID, appliedSyncID, newSyncID string) (string, []any, error) { + // Define the columns to select based on the table name + columns := []interface{}{ + "external_id", + "data", + "sync_id", + "discovered_at", + } + + tableName := table.Name() + // Add table-specific columns + switch { + case strings.Contains(tableName, resourcesTableName): + columns = append(columns, "resource_type_id", "parent_resource_type_id", "parent_resource_id") + case strings.Contains(tableName, resourceTypesTableName): + // Nothing new to add here + case strings.Contains(tableName, grantsTableName): + columns = append(columns, "resource_type_id", "resource_id", "entitlement_id", "principal_resource_type_id", "principal_resource_id") + case strings.Contains(tableName, entitlementsTableName): + columns = append(columns, "resource_type_id", "resource_id") + case strings.Contains(tableName, assetsTableName): + columns = append(columns, "content_type") + } + + // Build the subquery to find external_ids in the base sync + subquery := c.db.Select("external_id"). + From(tableName). + Where(goqu.C("sync_id").Eq(baseSyncID)) + + queryColumns := []interface{}{} + for _, col := range columns { + if col == "sync_id" { + queryColumns = append(queryColumns, goqu.L(fmt.Sprintf("'%s' as sync_id", newSyncID))) + continue + } + queryColumns = append(queryColumns, col) + } + + // Build the main query to select records from newSyncID that don't exist in baseSyncID + query := c.db.Insert(tableName). + Cols(columns...). + Prepared(true). + FromQuery( + c.db.Select(queryColumns...). + From(tableName). + Where( + goqu.C("sync_id").Eq(appliedSyncID), + goqu.C("external_id").NotIn(subquery), + ), + ) + + // Generate the SQL and args + return query.ToSQL() +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/entitlements.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/entitlements.go index 55a8a408..9456ae77 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/entitlements.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/entitlements.go @@ -49,6 +49,10 @@ func (r *entitlementsTable) Schema() (string, []interface{}) { } } +func (r *entitlementsTable) Migrations(ctx context.Context, db *goqu.Database) error { + return nil +} + func (c *C1File) ListEntitlements(ctx context.Context, request *v2.EntitlementsServiceListEntitlementsRequest) (*v2.EntitlementsServiceListEntitlementsResponse, error) { ctx, span := tracer.Start(ctx, "C1File.ListEntitlements") defer span.End() @@ -97,7 +101,20 @@ func (c *C1File) PutEntitlements(ctx context.Context, entitlementObjs ...*v2.Ent ctx, span := tracer.Start(ctx, "C1File.PutEntitlements") defer span.End() - err := bulkPutConnectorObject(ctx, c, entitlements.Name(), + return c.putEntitlementsInternal(ctx, bulkPutConnectorObject, entitlementObjs...) +} + +func (c *C1File) PutEntitlementsIfNewer(ctx context.Context, entitlementObjs ...*v2.Entitlement) error { + ctx, span := tracer.Start(ctx, "C1File.PutEntitlementsIfNewer") + defer span.End() + + return c.putEntitlementsInternal(ctx, bulkPutConnectorObjectIfNewer, entitlementObjs...) +} + +type entitlementPutFunc func(context.Context, *C1File, string, func(m *v2.Entitlement) (goqu.Record, error), ...*v2.Entitlement) error + +func (c *C1File) putEntitlementsInternal(ctx context.Context, f entitlementPutFunc, entitlementObjs ...*v2.Entitlement) error { + err := f(ctx, c, entitlements.Name(), func(entitlement *v2.Entitlement) (goqu.Record, error) { return goqu.Record{ "resource_id": entitlement.Resource.Id.Resource, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go index 972dfe24..4edc283d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go @@ -58,6 +58,10 @@ func (r *grantsTable) Schema() (string, []interface{}) { } } +func (r *grantsTable) Migrations(ctx context.Context, db *goqu.Database) error { + return nil +} + func (c *C1File) ListGrants(ctx context.Context, request *v2.GrantsServiceListGrantsRequest) (*v2.GrantsServiceListGrantsResponse, error) { ctx, span := tracer.Start(ctx, "C1File.ListGrants") defer span.End() @@ -190,7 +194,20 @@ func (c *C1File) PutGrants(ctx context.Context, bulkGrants ...*v2.Grant) error { ctx, span := tracer.Start(ctx, "C1File.PutGrants") defer span.End() - err := bulkPutConnectorObject(ctx, c, grants.Name(), + return c.putGrantsInternal(ctx, bulkPutConnectorObject, bulkGrants...) +} + +func (c *C1File) PutGrantsIfNewer(ctx context.Context, bulkGrants ...*v2.Grant) error { + ctx, span := tracer.Start(ctx, "C1File.PutGrantsIfNewer") + defer span.End() + + return c.putGrantsInternal(ctx, bulkPutConnectorObjectIfNewer, bulkGrants...) +} + +type grantPutFunc func(context.Context, *C1File, string, func(m *v2.Grant) (goqu.Record, error), ...*v2.Grant) error + +func (c *C1File) putGrantsInternal(ctx context.Context, f grantPutFunc, bulkGrants ...*v2.Grant) error { + err := f(ctx, c, grants.Name(), func(grant *v2.Grant) (goqu.Record, error) { return goqu.Record{ "resource_type_id": grant.Entitlement.Resource.Id.ResourceType, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resouce_types.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resouce_types.go index 9197e751..53a7f64e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resouce_types.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resouce_types.go @@ -45,6 +45,10 @@ func (r *resourceTypesTable) Schema() (string, []interface{}) { } } +func (r *resourceTypesTable) Migrations(ctx context.Context, db *goqu.Database) error { + return nil +} + func (c *C1File) ListResourceTypes(ctx context.Context, request *v2.ResourceTypesServiceListResourceTypesRequest) (*v2.ResourceTypesServiceListResourceTypesResponse, error) { ctx, span := tracer.Start(ctx, "C1File.ListResourceTypes") defer span.End() @@ -93,7 +97,20 @@ func (c *C1File) PutResourceTypes(ctx context.Context, resourceTypesObjs ...*v2. ctx, span := tracer.Start(ctx, "C1File.PutResourceTypes") defer span.End() - err := bulkPutConnectorObject(ctx, c, resourceTypes.Name(), + return c.putResourceTypesInternal(ctx, bulkPutConnectorObject, resourceTypesObjs...) +} + +func (c *C1File) PutResourceTypesIfNewer(ctx context.Context, resourceTypesObjs ...*v2.ResourceType) error { + ctx, span := tracer.Start(ctx, "C1File.PutResourceTypesIfNewer") + defer span.End() + + return c.putResourceTypesInternal(ctx, bulkPutConnectorObjectIfNewer, resourceTypesObjs...) +} + +type resourceTypePutFunc func(context.Context, *C1File, string, func(m *v2.ResourceType) (goqu.Record, error), ...*v2.ResourceType) error + +func (c *C1File) putResourceTypesInternal(ctx context.Context, f resourceTypePutFunc, resourceTypesObjs ...*v2.ResourceType) error { + err := f(ctx, c, resourceTypes.Name(), func(resource *v2.ResourceType) (goqu.Record, error) { return nil, nil }, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resources.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resources.go index 84d16f6b..b28b8bb5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resources.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/resources.go @@ -54,6 +54,10 @@ func (r *resourcesTable) Schema() (string, []interface{}) { } } +func (r *resourcesTable) Migrations(ctx context.Context, db *goqu.Database) error { + return nil +} + func (c *C1File) ListResources(ctx context.Context, request *v2.ResourcesServiceListResourcesRequest) (*v2.ResourcesServiceListResourcesResponse, error) { ctx, span := tracer.Start(ctx, "C1File.ListResources") defer span.End() @@ -102,7 +106,20 @@ func (c *C1File) PutResources(ctx context.Context, resourceObjs ...*v2.Resource) ctx, span := tracer.Start(ctx, "C1File.PutResources") defer span.End() - err := bulkPutConnectorObject(ctx, c, resources.Name(), + return c.putResourcesInternal(ctx, bulkPutConnectorObject, resourceObjs...) +} + +func (c *C1File) PutResourcesIfNewer(ctx context.Context, resourceObjs ...*v2.Resource) error { + ctx, span := tracer.Start(ctx, "C1File.PutResourcesIfNewer") + defer span.End() + + return c.putResourcesInternal(ctx, bulkPutConnectorObjectIfNewer, resourceObjs...) +} + +type resourcePutFunc func(context.Context, *C1File, string, func(m *v2.Resource) (goqu.Record, error), ...*v2.Resource) error + +func (c *C1File) putResourcesInternal(ctx context.Context, f resourcePutFunc, resourceObjs ...*v2.Resource) error { + err := f(ctx, c, resources.Name(), func(resource *v2.Resource) (goqu.Record, error) { fields := goqu.Record{ "resource_type_id": resource.Id.ResourceType, 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 931a3245..01e1e4bb 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 @@ -32,6 +32,7 @@ type tableDescriptor interface { Name() string Schema() (string, []interface{}) Version() string + Migrations(ctx context.Context, db *goqu.Database) error } type listRequest interface { @@ -178,7 +179,7 @@ func (c *C1File) listConnectorObjects(ctx context.Context, tableName string, req default: var latestSyncRun *syncRun var err error - latestSyncRun, err = c.getFinishedSync(ctx, 0) + latestSyncRun, err = c.getFinishedSync(ctx, 0, SyncTypeFull) if err != nil { return nil, "", err } @@ -263,31 +264,22 @@ func (c *C1File) listConnectorObjects(ctx context.Context, tableName string, req var protoMarshaler = proto.MarshalOptions{Deterministic: true} -func bulkPutConnectorObject[T proto.Message](ctx context.Context, c *C1File, - tableName string, +// prepareConnectorObjectRows prepares the rows for bulk insertion. +func prepareConnectorObjectRows[T proto.Message]( + c *C1File, + msgs []T, extractFields func(m T) (goqu.Record, error), - msgs ...T) error { - if len(msgs) == 0 { - return nil - } - ctx, span := tracer.Start(ctx, "C1File.bulkPutConnectorObjectTx") - defer span.End() - - err := c.validateSyncDb(ctx) - if err != nil { - return err - } - +) ([]*goqu.Record, error) { rows := make([]*goqu.Record, len(msgs)) for i, m := range msgs { messageBlob, err := protoMarshaler.Marshal(m) if err != nil { - return err + return nil, err } fields, err := extractFields(m) if err != nil { - return err + return nil, err } if fields == nil { fields = goqu.Record{} @@ -296,7 +288,7 @@ func bulkPutConnectorObject[T proto.Message](ctx context.Context, c *C1File, if _, idSet := fields["external_id"]; !idSet { idGetter, ok := any(m).(protoHasID) if !ok { - return fmt.Errorf("unable to get ID for object") + return nil, fmt.Errorf("unable to get ID for object") } fields["external_id"] = idGetter.GetId() } @@ -305,6 +297,17 @@ func bulkPutConnectorObject[T proto.Message](ctx context.Context, c *C1File, fields["discovered_at"] = time.Now().Format("2006-01-02 15:04:05.999999999") rows[i] = &fields } + return rows, nil +} + +// executeChunkedInsert executes the insert query in chunks. +func executeChunkedInsert( + ctx context.Context, + c *C1File, + tableName string, + rows []*goqu.Record, + buildQueryFn func(*goqu.InsertDataset, []*goqu.Record) (*goqu.InsertDataset, error), +) error { chunkSize := 100 chunks := len(rows) / chunkSize if len(rows)%chunkSize != 0 { @@ -318,14 +321,23 @@ func bulkPutConnectorObject[T proto.Message](ctx context.Context, c *C1File, end = len(rows) } chunkedRows := rows[start:end] - query, args, err := c.db.Insert(tableName). - OnConflict(goqu.DoUpdate("external_id, sync_id", goqu.C("data").Set(goqu.I("EXCLUDED.data")))). - Rows(chunkedRows). - Prepared(true). - ToSQL() + + // Create the base insert dataset + insertDs := c.db.Insert(tableName) + + // Apply the custom query building function + insertDs, err := buildQueryFn(insertDs, chunkedRows) if err != nil { return err } + + // Generate the SQL + query, args, err := insertDs.ToSQL() + if err != nil { + return err + } + + // Execute the query _, err = c.db.Exec(query, args...) if err != nil { return err @@ -335,6 +347,82 @@ func bulkPutConnectorObject[T proto.Message](ctx context.Context, c *C1File, return nil } +func bulkPutConnectorObject[T proto.Message]( + ctx context.Context, c *C1File, + tableName string, + extractFields func(m T) (goqu.Record, error), + msgs ...T, +) error { + if len(msgs) == 0 { + return nil + } + ctx, span := tracer.Start(ctx, "C1File.bulkPutConnectorObject") + defer span.End() + + err := c.validateSyncDb(ctx) + if err != nil { + return err + } + + // Prepare rows + rows, err := prepareConnectorObjectRows(c, msgs, extractFields) + if err != nil { + return err + } + + // Define query building function + buildQueryFn := func(insertDs *goqu.InsertDataset, chunkedRows []*goqu.Record) (*goqu.InsertDataset, error) { + return insertDs. + OnConflict(goqu.DoUpdate("external_id, sync_id", goqu.C("data").Set(goqu.I("EXCLUDED.data")))). + Rows(chunkedRows). + Prepared(true), nil + } + + // Execute the insert + return executeChunkedInsert(ctx, c, tableName, rows, buildQueryFn) +} + +func bulkPutConnectorObjectIfNewer[T proto.Message]( + ctx context.Context, c *C1File, + tableName string, + extractFields func(m T) (goqu.Record, error), + msgs ...T, +) error { + if len(msgs) == 0 { + return nil + } + ctx, span := tracer.Start(ctx, "C1File.bulkPutConnectorObjectIfNewer") + defer span.End() + + err := c.validateSyncDb(ctx) + if err != nil { + return err + } + + // Prepare rows + rows, err := prepareConnectorObjectRows(c, msgs, extractFields) + if err != nil { + return err + } + + // Define query building function + buildQueryFn := func(insertDs *goqu.InsertDataset, chunkedRows []*goqu.Record) (*goqu.InsertDataset, error) { + return insertDs. + OnConflict(goqu.DoUpdate("external_id, sync_id", + goqu.Record{ + "data": goqu.I("EXCLUDED.data"), + "discovered_at": goqu.I("EXCLUDED.discovered_at"), + }).Where( + goqu.L("EXCLUDED.discovered_at > ?.discovered_at", goqu.I(tableName)), + )). + Rows(chunkedRows). + Prepared(true), nil + } + + // Execute the insert + return executeChunkedInsert(ctx, c, tableName, rows, buildQueryFn) +} + func (c *C1File) getResourceObject(ctx context.Context, resourceID *v2.ResourceId, m *v2.Resource, syncID string) error { ctx, span := tracer.Start(ctx, "C1File.getResourceObject") defer span.End() @@ -359,7 +447,7 @@ func (c *C1File) getResourceObject(ctx context.Context, resourceID *v2.ResourceI default: var latestSyncRun *syncRun var err error - latestSyncRun, err = c.getFinishedSync(ctx, 0) + latestSyncRun, err = c.getFinishedSync(ctx, 0, SyncTypeFull) if err != nil { return err } @@ -419,15 +507,15 @@ func (c *C1File) getConnectorObject(ctx context.Context, tableName string, id st default: var latestSyncRun *syncRun var err error - latestSyncRun, err = c.getFinishedSync(ctx, 0) + latestSyncRun, err = c.getFinishedSync(ctx, 0, SyncTypeAny) if err != nil { - return err + return fmt.Errorf("error getting finished sync: %w", err) } if latestSyncRun == nil { latestSyncRun, err = c.getLatestUnfinishedSync(ctx) if err != nil { - return err + 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 69f1170a..96fbfc9a 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 @@ -26,7 +26,9 @@ create table if not exists %s ( sync_id text not null, started_at datetime not null, ended_at datetime, - sync_token text not null + sync_token text not null, + sync_type text not null default 'full', + parent_sync_id text not null default '' ); create unique index if not exists %s on %s (sync_id);` @@ -50,11 +52,51 @@ func (r *syncRunsTable) Schema() (string, []interface{}) { } } +func (r *syncRunsTable) Migrations(ctx context.Context, db *goqu.Database) error { + // Check if sync_type column exists + var syncTypeExists int + err := db.QueryRowContext(ctx, fmt.Sprintf("select count(*) from pragma_table_info('%s') where name='sync_type'", r.Name())).Scan(&syncTypeExists) + if err != nil { + return err + } + if syncTypeExists == 0 { + _, err = db.ExecContext(ctx, fmt.Sprintf("alter table %s add column sync_type text not null default 'full'", r.Name())) + if err != nil { + return err + } + } + + // Check if parent_sync_id column exists + var parentSyncIDExists int + err = db.QueryRowContext(ctx, fmt.Sprintf("select count(*) from pragma_table_info('%s') where name='parent_sync_id'", r.Name())).Scan(&parentSyncIDExists) + if err != nil { + return err + } + if parentSyncIDExists == 0 { + _, err = db.ExecContext(ctx, fmt.Sprintf("alter table %s add column parent_sync_id text not null default ''", r.Name())) + if err != nil { + return err + } + } + + 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 + ID string + StartedAt *time.Time + EndedAt *time.Time + SyncToken string + Type SyncType + ParentSyncID string } func (c *C1File) getLatestUnfinishedSync(ctx context.Context) (*syncRun, error) { @@ -70,7 +112,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context) (*syncRun, error) oneWeekAgo := time.Now().AddDate(0, 0, -7) ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") 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()) @@ -83,7 +125,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context) (*syncRun, error) row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -94,7 +136,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context) (*syncRun, error) return ret, nil } -func (c *C1File) getFinishedSync(ctx context.Context, offset uint) (*syncRun, error) { +func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType SyncType) (*syncRun, error) { ctx, span := tracer.Start(ctx, "C1File.getFinishedSync") defer span.End() @@ -103,10 +145,18 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint) (*syncRun, er return nil, err } + // Validate syncType + if syncType != SyncTypeFull && syncType != SyncTypePartial && syncType != SyncTypeAny { + return nil, fmt.Errorf("invalid sync type: %s", syncType) + } + ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token") + 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 { + q = q.Where(goqu.C("sync_type").Eq(syncType)) + } q = q.Order(goqu.C("ended_at").Desc()) q = q.Limit(1) @@ -121,7 +171,7 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint) (*syncRun, er row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -142,7 +192,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui } q := c.db.From(syncRuns.Name()).Prepared(true) - q = q.Select("id", "sync_id", "started_at", "ended_at", "sync_token") + q = q.Select("id", "sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") if pageToken != "" { q = q.Where(goqu.C("id").Gte(pageToken)) @@ -177,7 +227,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui } rowId := 0 data := &syncRun{} - err := rows.Scan(&rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken) + err := rows.Scan(&rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken, &data.Type, &data.ParentSyncID) if err != nil { return nil, "", err } @@ -197,7 +247,7 @@ func (c *C1File) LatestSyncID(ctx context.Context) (string, error) { ctx, span := tracer.Start(ctx, "C1File.LatestSyncID") defer span.End() - s, err := c.getFinishedSync(ctx, 0) + s, err := c.getFinishedSync(ctx, 0, SyncTypeFull) if err != nil { return "", err } @@ -223,7 +273,7 @@ func (c *C1File) PreviousSyncID(ctx context.Context) (string, error) { ctx, span := tracer.Start(ctx, "C1File.PreviousSyncID") defer span.End() - s, err := c.getFinishedSync(ctx, 1) + s, err := c.getFinishedSync(ctx, 1, SyncTypeFull) if err != nil { return "", err } @@ -239,7 +289,7 @@ func (c *C1File) LatestFinishedSync(ctx context.Context) (string, error) { ctx, span := tracer.Start(ctx, "C1File.LatestFinishedSync") defer span.End() - s, err := c.getFinishedSync(ctx, 0) + s, err := c.getFinishedSync(ctx, 0, SyncTypeFull) if err != nil { return "", err } @@ -263,16 +313,15 @@ func (c *C1File) getSync(ctx context.Context, syncID string) (*syncRun, error) { ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") q = q.Where(goqu.C("sync_id").Eq(syncID)) query, args, err := q.ToSQL() if err != nil { return nil, err } - row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) if err != nil { return nil, err } @@ -291,6 +340,19 @@ func (c *C1File) getCurrentSync(ctx context.Context) (*syncRun, error) { return c.getSync(ctx, c.currentSyncID) } +func (c *C1File) SetCurrentSync(ctx context.Context, syncID string) error { + ctx, span := tracer.Start(ctx, "C1File.SetCurrentSync") + defer span.End() + + _, err := c.getSync(ctx, syncID) + if err != nil { + return err + } + + c.currentSyncID = syncID + return nil +} + func (c *C1File) CheckpointSync(ctx context.Context, syncToken string) error { ctx, span := tracer.Start(ctx, "C1File.CheckpointSync") defer span.End() @@ -355,6 +417,26 @@ func (c *C1File) StartNewSync(ctx context.Context) (string, error) { ctx, span := tracer.Start(ctx, "C1File.StartNewSync") defer span.End() + return c.startNewSyncInternal(ctx, SyncTypeFull, "") +} + +func (c *C1File) StartNewSyncV2(ctx context.Context, syncType string, parentSyncID string) (string, error) { + ctx, span := tracer.Start(ctx, "C1File.StartNewSyncV2") + defer span.End() + + var syncTypeEnum SyncType + switch syncType { + case "full": + syncTypeEnum = SyncTypeFull + case "partial": + syncTypeEnum = SyncTypePartial + default: + return "", fmt.Errorf("invalid sync type: %s", syncType) + } + return c.startNewSyncInternal(ctx, syncTypeEnum, parentSyncID) +} + +func (c *C1File) startNewSyncInternal(ctx context.Context, syncType SyncType, parentSyncID string) (string, error) { // Not sure if we want to do this here if c.currentSyncID != "" { return c.currentSyncID, nil @@ -362,27 +444,36 @@ func (c *C1File) StartNewSync(ctx context.Context) (string, error) { syncID := ksuid.New().String() + if err := c.insertSyncRun(ctx, syncID, syncType, parentSyncID); err != nil { + return "", err + } + + c.currentSyncID = syncID + + return c.currentSyncID, nil +} + +func (c *C1File) insertSyncRun(ctx context.Context, syncID string, syncType SyncType, parentSyncID string) error { q := c.db.Insert(syncRuns.Name()) q = q.Rows(goqu.Record{ - "sync_id": syncID, - "started_at": time.Now().Format("2006-01-02 15:04:05.999999999"), - "sync_token": "", + "sync_id": syncID, + "started_at": time.Now().Format("2006-01-02 15:04:05.999999999"), + "sync_token": "", + "sync_type": syncType, + "parent_sync_id": parentSyncID, }) query, args, err := q.ToSQL() if err != nil { - return "", err + return err } _, err = c.db.ExecContext(ctx, query, args...) if err != nil { - return "", err + return err } - c.dbUpdated = true - c.currentSyncID = syncID - - return c.currentSyncID, nil + return nil } func (c *C1File) CurrentSyncStep(ctx context.Context) (string, error) { @@ -407,11 +498,21 @@ func (c *C1File) EndSync(ctx context.Context) error { return err } + if err := c.endSyncRun(ctx, c.currentSyncID); err != nil { + return err + } + + c.currentSyncID = "" + + return nil +} + +func (c *C1File) endSyncRun(ctx context.Context, syncID string) error { q := c.db.Update(syncRuns.Name()) q = q.Set(goqu.Record{ "ended_at": time.Now().Format("2006-01-02 15:04:05.999999999"), }) - q = q.Where(goqu.C("sync_id").Eq(c.currentSyncID)) + q = q.Where(goqu.C("sync_id").Eq(syncID)) q = q.Where(goqu.C("ended_at").IsNull()) query, args, err := q.ToSQL() @@ -423,8 +524,6 @@ func (c *C1File) EndSync(ctx context.Context) error { if err != nil { return err } - - c.currentSyncID = "" c.dbUpdated = true return nil @@ -452,6 +551,7 @@ func (c *C1File) Cleanup(ctx context.Context) error { } var ret []*syncRun + var partials []*syncRun pageToken := "" for { @@ -464,7 +564,11 @@ func (c *C1File) Cleanup(ctx context.Context) error { if sr.EndedAt == nil { continue } - ret = append(ret, sr) + if sr.Type == SyncTypePartial { + partials = append(partials, sr) + } else { + ret = append(ret, sr) + } } if nextPageToken == "" { @@ -492,6 +596,25 @@ 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 + 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)) + + for _, partial := range partials { + if partial.EndedAt != nil && partial.EndedAt.Before(*earliestKeptSync.StartedAt) { + err = c.DeleteSyncRun(ctx, partial.ID) + if err != nil { + return err + } + l.Info("Removed partial sync that ended before earliest kept sync.", + zap.String("partial_sync_end", partial.EndedAt.Format(time.RFC3339)), + zap.String("earliest_kept_sync_start", earliestKeptSync.StartedAt.Format(time.RFC3339)), + zap.String("sync_id", partial.ID)) + } + } + } + err = c.Vacuum(ctx) if err != nil { return err @@ -574,10 +697,12 @@ func (c *C1File) GetSync(ctx context.Context, request *reader_v2.SyncsReaderServ return &reader_v2.SyncsReaderServiceGetSyncResponse{ Sync: &reader_v2.SyncRun{ - Id: sr.ID, - StartedAt: toTimeStamp(sr.StartedAt), - EndedAt: toTimeStamp(sr.EndedAt), - SyncToken: sr.SyncToken, + Id: sr.ID, + StartedAt: toTimeStamp(sr.StartedAt), + EndedAt: toTimeStamp(sr.EndedAt), + SyncToken: sr.SyncToken, + SyncType: string(sr.Type), + ParentSyncId: sr.ParentSyncID, }, }, nil } @@ -594,10 +719,12 @@ func (c *C1File) ListSyncs(ctx context.Context, request *reader_v2.SyncsReaderSe syncRuns := make([]*reader_v2.SyncRun, len(syncs)) for i, sr := range syncs { syncRuns[i] = &reader_v2.SyncRun{ - Id: sr.ID, - StartedAt: toTimeStamp(sr.StartedAt), - EndedAt: toTimeStamp(sr.EndedAt), - SyncToken: sr.SyncToken, + Id: sr.ID, + StartedAt: toTimeStamp(sr.StartedAt), + EndedAt: toTimeStamp(sr.EndedAt), + SyncToken: sr.SyncToken, + SyncType: string(sr.Type), + ParentSyncId: sr.ParentSyncID, } } @@ -611,17 +738,30 @@ func (c *C1File) GetLatestFinishedSync(ctx context.Context, request *reader_v2.S ctx, span := tracer.Start(ctx, "C1File.GetLatestFinishedSync") defer span.End() - sync, err := c.getFinishedSync(ctx, 0) + syncType := request.SyncType + if syncType == "" { + syncType = string(SyncTypeFull) + } + + sync, err := c.getFinishedSync(ctx, 0, SyncType(syncType)) if err != nil { return nil, fmt.Errorf("error fetching latest finished sync: %w", err) } + if sync == nil { + return &reader_v2.SyncsReaderServiceGetLatestFinishedSyncResponse{ + Sync: nil, + }, nil + } + return &reader_v2.SyncsReaderServiceGetLatestFinishedSyncResponse{ Sync: &reader_v2.SyncRun{ - Id: sync.ID, - StartedAt: toTimeStamp(sync.StartedAt), - EndedAt: toTimeStamp(sync.EndedAt), - SyncToken: sync.SyncToken, + Id: sync.ID, + StartedAt: toTimeStamp(sync.StartedAt), + EndedAt: toTimeStamp(sync.EndedAt), + SyncToken: sync.SyncToken, + SyncType: string(sync.Type), + ParentSyncId: sync.ParentSyncID, }, }, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go index 07a00ca9..ef8f093e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go @@ -6,6 +6,8 @@ var DefaultRelationships = []SchemaFieldRelationship{ FieldsRequiredTogether(createTicketField, ticketTemplatePathField), FieldsRequiredTogether(bulkCreateTicketField, bulkTicketTemplatePathField), FieldsRequiredTogether(getTicketField, ticketIDField), + FieldsRequiredTogether(diffSyncsField, diffSyncsBaseSyncField, diffSyncsAppliedSyncField), + FieldsRequiredTogether(compactSyncsField, compactSyncIDsField, compactFilePathsField, compactOutputDirectoryField), FieldsMutuallyExclusive( grantEntitlementField, revokeGrantField, @@ -25,6 +27,8 @@ var DefaultRelationships = []SchemaFieldRelationship{ deleteResourceTypeField, rotateCredentialsTypeField, eventFeedField, + diffSyncsField, + compactSyncsField, ListTicketSchemasField, ), FieldsDependentOn( 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 169593ef..54b7717f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go @@ -1,6 +1,10 @@ package field -import "github.com/conductorone/baton-sdk/pkg/logging" +import ( + "time" + + "github.com/conductorone/baton-sdk/pkg/logging" +) const ( OtelCollectorEndpointFieldName = "otel-collector-endpoint" @@ -34,7 +38,14 @@ var ( deleteResourceField = StringField("delete-resource", WithHidden(true), WithDescription("The id of the resource to delete"), WithPersistent(true), WithExportTarget(ExportTargetNone)) deleteResourceTypeField = StringField("delete-resource-type", WithHidden(true), WithDescription("The type of the resource to delete"), WithPersistent(true), WithExportTarget(ExportTargetNone)) eventFeedField = StringField("event-feed", WithHidden(true), WithDescription("Read feed events to stdout"), WithPersistent(true), WithExportTarget(ExportTargetNone)) - fileField = StringField("file", WithShortHand("f"), WithDefaultValue("sync.c1z"), WithDescription("The path to the c1z file to sync with"), + eventFeedIdField = StringField("event-feed-id", WithHidden(true), WithDescription("The id of the event feed to read events from"), WithPersistent(true), WithExportTarget(ExportTargetNone)) + eventFeedStartAtField = StringField("event-feed-start-at", + WithDefaultValue(time.Now().AddDate(0, 0, -1).Format(time.RFC3339)), + WithHidden(true), + WithDescription("The start time of the event feed to read events from"), + WithPersistent(true), + WithExportTarget(ExportTargetNone)) + fileField = StringField("file", WithShortHand("f"), WithDefaultValue("sync.c1z"), WithDescription("The path to the c1z file to sync with"), WithPersistent(true), WithExportTarget(ExportTargetNone)) grantEntitlementField = StringField("grant-entitlement", WithHidden(true), WithDescription("The id of the entitlement to grant to the supplied principal"), WithPersistent(true), WithExportTarget(ExportTargetNone)) @@ -54,7 +65,52 @@ var ( WithPersistent(true), WithExportTarget(ExportTargetNone)) logLevelField = StringField("log-level", WithDefaultValue("info"), WithDescription("The log level: debug, info, warn, error"), WithPersistent(true), WithExportTarget(ExportTargetOps)) - skipFullSync = BoolField("skip-full-sync", WithDescription("This must be set to skip a full sync"), WithPersistent(true), WithExportTarget(ExportTargetNone)) + 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( + "diff-syncs", + WithDescription("Create a new partial SyncID from a base and applied sync."), + WithHidden(true), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) + diffSyncsBaseSyncField = StringField("base-sync-id", + WithDescription("The base sync to diff from."), + WithHidden(true), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) + diffSyncsAppliedSyncField = StringField("applied-sync-id", + WithDescription("The sync to show diffs when applied to the base sync."), + WithHidden(true), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) + + compactSyncsField = BoolField("compact-syncs", + WithDescription("Provide a list of sync files to compact into a single c1z file and sync ID."), + WithHidden(true), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) + compactOutputDirectoryField = StringField("compact-output-path", + WithDescription("The directory to store the results in"), + WithHidden(true), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) + compactFilePathsField = StringSliceField("compact-file-paths", + WithDescription("A comma-separated list of file paths to sync from."), + WithHidden(true), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) + compactSyncIDsField = StringSliceField("compact-sync-ids", + WithDescription("A comma-separated list of file ids to sync from. Must match sync IDs from each file provided. Order matters."), + WithHidden(true), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) otelCollectorEndpoint = StringField(OtelCollectorEndpointFieldName, WithDescription("The endpoint of the OpenTelemetry collector to send observability data to (used for both tracing and logging if specific endpoints are not provided)"), @@ -148,6 +204,8 @@ var DefaultFields = []SchemaField{ deleteResourceField, deleteResourceTypeField, eventFeedField, + eventFeedIdField, + eventFeedStartAtField, fileField, grantEntitlementField, grantPrincipalField, @@ -160,8 +218,16 @@ var DefaultFields = []SchemaField{ ticketTemplatePathField, logLevelField, skipFullSync, + targetedSyncResourceIDs, externalResourceC1ZField, externalResourceEntitlementIdFilter, + diffSyncsField, + diffSyncsBaseSyncField, + diffSyncsAppliedSyncField, + compactSyncIDsField, + compactFilePathsField, + compactOutputDirectoryField, + compactSyncsField, otelCollectorEndpoint, otelCollectorEndpointTLSCertPath, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go index 01ba1652..cb235a57 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go @@ -72,6 +72,8 @@ type SchemaField struct { // Config acutally ingested on the connector side - auth, regions, etc ConnectorConfig connectorConfig + + WasReExported bool } type SchemaTypes interface { @@ -109,6 +111,13 @@ func (s SchemaField) GetDescription() string { return line } +func (s SchemaField) ExportAs(et ExportTarget) SchemaField { + c := s + c.ExportTarget = et + c.WasReExported = true + return c +} + // Go doesn't allow generic methods on a non-generic struct. func ValidateField[T SchemaTypes](s *SchemaField, value T) (bool, error) { return s.validate(value) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/marshal.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/marshal.go index 4d6e8186..a143d98a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/marshal.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/marshal.go @@ -36,7 +36,15 @@ func (c *Configuration) Marshal() ([]byte, error) { } func (c Configuration) marshal() (*v1_conf.Configuration, error) { - conf := &v1_conf.Configuration{} + conf := &v1_conf.Configuration{ + DisplayName: c.DisplayName, + HelpUrl: c.HelpUrl, + IconUrl: c.IconUrl, + CatalogId: c.CatalogId, + IsDirectory: c.IsDirectory, + SupportsExternalResources: c.SupportsExternalResources, + RequiresExternalConnector: c.RequiresExternalConnector, + } ignore := make(map[string]struct{}) for _, f := range c.Fields { @@ -177,5 +185,6 @@ func (c Configuration) marshal() (*v1_conf.Configuration, error) { conf.Constraints = append(conf.Constraints, &constraint) } + return conf, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/struct.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/struct.go index 12ecf64d..6e614e0d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/struct.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/struct.go @@ -1,13 +1,91 @@ package field type Configuration struct { - Fields []SchemaField - Constraints []SchemaFieldRelationship + Fields []SchemaField + Constraints []SchemaFieldRelationship + DisplayName string + HelpUrl string + IconUrl string + CatalogId string + IsDirectory bool + SupportsExternalResources bool + RequiresExternalConnector bool } -func NewConfiguration(fields []SchemaField, constraints ...SchemaFieldRelationship) Configuration { - return Configuration{ - Fields: fields, - Constraints: constraints, +type configOption func(Configuration) Configuration + +func WithConnectorDisplayName(value string) configOption { + return func(c Configuration) Configuration { + c.DisplayName = value + + return c + } +} + +func WithHelpUrl(value string) configOption { + return func(c Configuration) Configuration { + c.HelpUrl = value + + return c + } +} + +func WithIconUrl(value string) configOption { + return func(c Configuration) Configuration { + c.IconUrl = value + + return c + } +} + +func WithCatalogId(value string) configOption { + return func(c Configuration) Configuration { + c.CatalogId = value + + return c + } +} + +func WithIsDirectory(value bool) configOption { + return func(c Configuration) Configuration { + c.IsDirectory = value + + return c } } + +func WithSupportsExternalResources(value bool) configOption { + return func(c Configuration) Configuration { + c.SupportsExternalResources = value + + return c + } +} + +func WithRequiresExternalConnector(value bool) configOption { + return func(c Configuration) Configuration { + c.RequiresExternalConnector = value + + return c + } +} + +func WithConstraints(constraints ...SchemaFieldRelationship) configOption { + return func(c Configuration) Configuration { + c.Constraints = constraints + + return c + } +} + +func NewConfiguration(fields []SchemaField, opts ...configOption) Configuration { + configuration := Configuration{ + Fields: fields, + } + + for _, opt := range opts { + configuration = opt(configuration) + } + + return configuration +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/retry/retry.go b/vendor/github.com/conductorone/baton-sdk/pkg/retry/retry.go new file mode 100644 index 00000000..ed9fea89 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/retry/retry.go @@ -0,0 +1,113 @@ +package retry + +import ( + "context" + "math" + "time" + + v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.opentelemetry.io/otel" + "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var tracer = otel.Tracer("baton-sdk/retry") + +type Retryer struct { + attempts uint + maxAttempts uint + initialDelay time.Duration + maxDelay time.Duration +} + +type RetryConfig struct { + MaxAttempts uint // 0 means no limit (which is also the default). + InitialDelay time.Duration // Default is 1 second. + MaxDelay time.Duration // Default is 60 seconds. 0 means no limit. +} + +func NewRetryer(ctx context.Context, config RetryConfig) *Retryer { + r := &Retryer{ + attempts: 0, + maxAttempts: config.MaxAttempts, + initialDelay: config.InitialDelay, + maxDelay: config.MaxDelay, + } + if r.initialDelay == 0 { + r.initialDelay = time.Second + } + if r.maxDelay == 0 { + r.maxDelay = 60 * time.Second + } + return r +} + +func (r *Retryer) ShouldWaitAndRetry(ctx context.Context, err error) bool { + ctx, span := tracer.Start(ctx, "retry.ShouldWaitAndRetry") + defer span.End() + + if err == nil { + r.attempts = 0 + return true + } + if status.Code(err) != codes.Unavailable && status.Code(err) != codes.DeadlineExceeded { + return false + } + + r.attempts++ + l := ctxzap.Extract(ctx) + + if r.maxAttempts > 0 && r.attempts > r.maxAttempts { + l.Warn("max attempts reached", zap.Error(err), zap.Uint("max_attempts", r.maxAttempts)) + return false + } + + // use linear backoff by default + var wait time.Duration + if r.attempts > math.MaxInt64 { + wait = r.maxDelay + } else { + wait = time.Duration(int64(r.attempts)) * r.initialDelay + } + + // If error contains rate limit data, use that instead + if st, ok := status.FromError(err); ok { + details := st.Details() + for _, detail := range details { + if rlData, ok := detail.(*v2.RateLimitDescription); ok { + waitResetAt := time.Until(rlData.ResetAt.AsTime()) + if waitResetAt <= 0 { + continue + } + duration := time.Duration(rlData.Limit) + if duration <= 0 { + continue + } + waitResetAt /= duration + // Round up to the nearest second to make sure we don't hit the rate limit again + waitResetAt = time.Duration(math.Ceil(waitResetAt.Seconds())) * time.Second + if waitResetAt > 0 { + wait = waitResetAt + break + } + } + } + } + + if wait > r.maxDelay { + wait = r.maxDelay + } + + l.Warn("retrying operation", zap.Error(err), zap.Duration("wait", wait)) + + for { + select { + case <-time.After(wait): + return true + case <-ctx.Done(): + return false + } + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/empty_connector.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/empty_connector.go index 19b7dd35..2667bbab 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/empty_connector.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/empty_connector.go @@ -4,71 +4,162 @@ import ( "context" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) type emptyConnector struct{} // GetAsset gets an asset. -func (n *emptyConnector) GetAsset(request *v2.AssetServiceGetAssetRequest, server v2.AssetService_GetAssetServer) error { - err := server.Send(&v2.AssetServiceGetAssetResponse{ - Msg: &v2.AssetServiceGetAssetResponse_Metadata_{ - Metadata: &v2.AssetServiceGetAssetResponse_Metadata{ContentType: "application/example"}, - }, - }) - if err != nil { - return err - } - - err = server.Send(&v2.AssetServiceGetAssetResponse{ - Msg: &v2.AssetServiceGetAssetResponse_Data_{ - Data: &v2.AssetServiceGetAssetResponse_Data{Data: nil}, - }, - }) - if err != nil { - return err - } - - return nil +func (n *emptyConnector) GetAsset(_ context.Context, request *v2.AssetServiceGetAssetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[v2.AssetServiceGetAssetResponse], error) { + return nil, status.Errorf(codes.NotFound, "empty connector") } // ListResourceTypes returns a list of resource types. -func (n *emptyConnector) ListResourceTypes(ctx context.Context, request *v2.ResourceTypesServiceListResourceTypesRequest) (*v2.ResourceTypesServiceListResourceTypesResponse, error) { +func (n *emptyConnector) ListResourceTypes( + ctx context.Context, + request *v2.ResourceTypesServiceListResourceTypesRequest, + opts ...grpc.CallOption, +) (*v2.ResourceTypesServiceListResourceTypesResponse, error) { return &v2.ResourceTypesServiceListResourceTypesResponse{ List: []*v2.ResourceType{}, }, nil } // ListResources returns a list of resources. -func (n *emptyConnector) ListResources(ctx context.Context, request *v2.ResourcesServiceListResourcesRequest) (*v2.ResourcesServiceListResourcesResponse, error) { +func (n *emptyConnector) ListResources(ctx context.Context, request *v2.ResourcesServiceListResourcesRequest, opts ...grpc.CallOption) (*v2.ResourcesServiceListResourcesResponse, error) { return &v2.ResourcesServiceListResourcesResponse{ List: []*v2.Resource{}, }, nil } +func (n *emptyConnector) GetResource( + ctx context.Context, + request *v2.ResourceGetterServiceGetResourceRequest, + opts ...grpc.CallOption, +) (*v2.ResourceGetterServiceGetResourceResponse, error) { + return nil, status.Errorf(codes.NotFound, "empty connector") +} + // ListEntitlements returns a list of entitlements. -func (n *emptyConnector) ListEntitlements(ctx context.Context, request *v2.EntitlementsServiceListEntitlementsRequest) (*v2.EntitlementsServiceListEntitlementsResponse, error) { +func (n *emptyConnector) ListEntitlements( + ctx context.Context, + request *v2.EntitlementsServiceListEntitlementsRequest, + opts ...grpc.CallOption, +) (*v2.EntitlementsServiceListEntitlementsResponse, error) { return &v2.EntitlementsServiceListEntitlementsResponse{ List: []*v2.Entitlement{}, }, nil } // ListGrants returns a list of grants. -func (n *emptyConnector) ListGrants(ctx context.Context, request *v2.GrantsServiceListGrantsRequest) (*v2.GrantsServiceListGrantsResponse, error) { +func (n *emptyConnector) ListGrants(ctx context.Context, request *v2.GrantsServiceListGrantsRequest, opts ...grpc.CallOption) (*v2.GrantsServiceListGrantsResponse, error) { return &v2.GrantsServiceListGrantsResponse{ List: []*v2.Grant{}, }, nil } +func (n *emptyConnector) Grant(ctx context.Context, request *v2.GrantManagerServiceGrantRequest, opts ...grpc.CallOption) (*v2.GrantManagerServiceGrantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) Revoke(ctx context.Context, request *v2.GrantManagerServiceRevokeRequest, opts ...grpc.CallOption) (*v2.GrantManagerServiceRevokeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + // GetMetadata returns a connector metadata. -func (n *emptyConnector) GetMetadata(ctx context.Context, request *v2.ConnectorServiceGetMetadataRequest) (*v2.ConnectorServiceGetMetadataResponse, error) { +func (n *emptyConnector) GetMetadata(ctx context.Context, request *v2.ConnectorServiceGetMetadataRequest, opts ...grpc.CallOption) (*v2.ConnectorServiceGetMetadataResponse, error) { return &v2.ConnectorServiceGetMetadataResponse{Metadata: &v2.ConnectorMetadata{}}, nil } // Validate is called by the connector framework to validate the correct response. -func (n *emptyConnector) Validate(ctx context.Context, request *v2.ConnectorServiceValidateRequest) (*v2.ConnectorServiceValidateResponse, error) { +func (n *emptyConnector) Validate(ctx context.Context, request *v2.ConnectorServiceValidateRequest, opts ...grpc.CallOption) (*v2.ConnectorServiceValidateResponse, error) { return &v2.ConnectorServiceValidateResponse{}, nil } +func (n *emptyConnector) BulkCreateTickets(ctx context.Context, request *v2.TicketsServiceBulkCreateTicketsRequest, opts ...grpc.CallOption) (*v2.TicketsServiceBulkCreateTicketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) BulkGetTickets(ctx context.Context, request *v2.TicketsServiceBulkGetTicketsRequest, opts ...grpc.CallOption) (*v2.TicketsServiceBulkGetTicketsResponse, error) { + return &v2.TicketsServiceBulkGetTicketsResponse{ + Tickets: []*v2.TicketsServiceGetTicketResponse{}, + }, nil +} + +func (n *emptyConnector) CreateTicket(ctx context.Context, request *v2.TicketsServiceCreateTicketRequest, opts ...grpc.CallOption) (*v2.TicketsServiceCreateTicketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) GetTicket(ctx context.Context, request *v2.TicketsServiceGetTicketRequest, opts ...grpc.CallOption) (*v2.TicketsServiceGetTicketResponse, error) { + return nil, status.Errorf(codes.NotFound, "empty connector") +} + +func (n *emptyConnector) ListTicketSchemas(ctx context.Context, request *v2.TicketsServiceListTicketSchemasRequest, opts ...grpc.CallOption) (*v2.TicketsServiceListTicketSchemasResponse, error) { + return &v2.TicketsServiceListTicketSchemasResponse{ + List: []*v2.TicketSchema{}, + }, nil +} + +func (n *emptyConnector) GetTicketSchema(ctx context.Context, request *v2.TicketsServiceGetTicketSchemaRequest, opts ...grpc.CallOption) (*v2.TicketsServiceGetTicketSchemaResponse, error) { + return nil, status.Errorf(codes.NotFound, "empty connector") +} + +func (n *emptyConnector) Cleanup(ctx context.Context, request *v2.ConnectorServiceCleanupRequest, opts ...grpc.CallOption) (*v2.ConnectorServiceCleanupResponse, error) { + return &v2.ConnectorServiceCleanupResponse{}, nil +} + +func (n *emptyConnector) CreateAccount(ctx context.Context, request *v2.CreateAccountRequest, opts ...grpc.CallOption) (*v2.CreateAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) RotateCredential(ctx context.Context, request *v2.RotateCredentialRequest, opts ...grpc.CallOption) (*v2.RotateCredentialResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) CreateResource(ctx context.Context, request *v2.CreateResourceRequest, opts ...grpc.CallOption) (*v2.CreateResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) DeleteResource(ctx context.Context, request *v2.DeleteResourceRequest, opts ...grpc.CallOption) (*v2.DeleteResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) DeleteResourceV2(ctx context.Context, request *v2.DeleteResourceV2Request, opts ...grpc.CallOption) (*v2.DeleteResourceV2Response, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) GetActionSchema(ctx context.Context, request *v2.GetActionSchemaRequest, opts ...grpc.CallOption) (*v2.GetActionSchemaResponse, error) { + return nil, status.Errorf(codes.NotFound, "empty connector") +} + +func (n *emptyConnector) GetActionStatus(ctx context.Context, request *v2.GetActionStatusRequest, opts ...grpc.CallOption) (*v2.GetActionStatusResponse, error) { + return nil, status.Errorf(codes.NotFound, "empty connector") +} + +func (n *emptyConnector) InvokeAction(ctx context.Context, request *v2.InvokeActionRequest, opts ...grpc.CallOption) (*v2.InvokeActionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "empty connector") +} + +func (n *emptyConnector) ListActionSchemas(ctx context.Context, request *v2.ListActionSchemasRequest, opts ...grpc.CallOption) (*v2.ListActionSchemasResponse, error) { + return &v2.ListActionSchemasResponse{ + Schemas: []*v2.BatonActionSchema{}, + }, nil +} + +func (n *emptyConnector) ListEvents(ctx context.Context, request *v2.ListEventsRequest, opts ...grpc.CallOption) (*v2.ListEventsResponse, error) { + return &v2.ListEventsResponse{ + Events: []*v2.Event{}, + }, nil +} + +func (n *emptyConnector) ListEventFeeds(ctx context.Context, request *v2.ListEventFeedsRequest, opts ...grpc.CallOption) (*v2.ListEventFeedsResponse, error) { + return &v2.ListEventFeedsResponse{ + List: []*v2.EventFeedMetadata{}, + }, nil +} + // NewEmptyConnector returns a new emptyConnector. func NewEmptyConnector() (*emptyConnector, error) { return &emptyConnector{}, 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 38c11253..eb69c9b2 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.2.92" +const Version = "v0.3.9" 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 35336394..e8dc6fe6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go @@ -29,6 +29,8 @@ type State interface { SetNeedsExpansion() HasExternalResourcesGrants() bool SetHasExternalResourcesGrants() + ShouldFetchRelatedResources() bool + SetShouldFetchRelatedResources() } // ActionOp represents a sync operation. @@ -53,6 +55,8 @@ func (s ActionOp) String() string { return "fetch-assets" case SyncGrantExpansionOp: return "grant-expansion" + case SyncTargetedResourceOp: + return "targeted-resource-sync" default: return "unknown" } @@ -94,6 +98,8 @@ func newActionOp(str string) ActionOp { return SyncGrantExpansionOp case SyncExternalResourcesOp.String(): return SyncExternalResourcesOp + case SyncTargetedResourceOp.String(): + return SyncTargetedResourceOp default: return UnknownOp } @@ -110,6 +116,7 @@ const ( SyncExternalResourcesOp SyncAssetsOp SyncGrantExpansionOp + SyncTargetedResourceOp ) // Action stores the current operation, page token, and optional fields for which resource is being worked with. @@ -124,22 +131,24 @@ 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 + mtx sync.RWMutex + actions []Action + currentAction *Action + entitlementGraph *expand.EntitlementGraph + needsExpansion bool + hasExternalResourceGrants bool + shouldFetchRelatedResources 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"` + 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"` } // push adds a new action to the stack. If there is no current state, the action is directly set to current, else @@ -281,6 +290,14 @@ func (st *state) SetHasExternalResourcesGrants() { st.hasExternalResourceGrants = true } +func (st *state) ShouldFetchRelatedResources() bool { + return st.shouldFetchRelatedResources +} + +func (st *state) SetShouldFetchRelatedResources() { + st.shouldFetchRelatedResources = 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 2ed36fe0..c7c82247 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "io" - "math" "os" "slices" "strconv" @@ -16,6 +15,7 @@ import ( "github.com/conductorone/baton-sdk/pkg/bid" "github.com/conductorone/baton-sdk/pkg/dotc1z" + "github.com/conductorone/baton-sdk/pkg/retry" "github.com/conductorone/baton-sdk/pkg/sync/expand" "github.com/conductorone/baton-sdk/pkg/types/entitlement" batonGrant "github.com/conductorone/baton-sdk/pkg/types/grant" @@ -203,8 +203,10 @@ type syncer struct { skipFullSync bool lastCheckPointTime time.Time counts *ProgressCounts - - skipEGForResourceType map[string]bool + targetedSyncResourceIDs []string + onlyExpandGrants bool + syncID string + skipEGForResourceType map[string]bool } const minCheckpointInterval = 10 * time.Second @@ -244,72 +246,61 @@ func (s *syncer) handleProgress(ctx context.Context, a *Action, c int) { } } -var attempts = 0 - -func shouldWaitAndRetry(ctx context.Context, err error) bool { - ctx, span := tracer.Start(ctx, "syncer.shouldWaitAndRetry") - defer span.End() - +func isWarning(ctx context.Context, err error) bool { if err == nil { - attempts = 0 - return true - } - if status.Code(err) != codes.Unavailable && status.Code(err) != codes.DeadlineExceeded { return false } - attempts++ - l := ctxzap.Extract(ctx) + if status.Code(err) == codes.NotFound { + return true + } - // use linear time by default - var wait time.Duration = time.Duration(attempts) * time.Second + return false +} - // If error contains rate limit data, use that instead - if st, ok := status.FromError(err); ok { - details := st.Details() - for _, detail := range details { - if rlData, ok := detail.(*v2.RateLimitDescription); ok { - waitResetAt := time.Until(rlData.ResetAt.AsTime()) - if waitResetAt <= 0 { - continue - } - duration := time.Duration(rlData.Limit) - if duration <= 0 { - continue - } - waitResetAt /= duration - // Round up to the nearest second to make sure we don't hit the rate limit again - waitResetAt = time.Duration(math.Ceil(waitResetAt.Seconds())) * time.Second - if waitResetAt > 0 { - wait = waitResetAt - break - } - } +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 s.syncID != "" { + err := s.store.SetCurrentSync(ctx, s.syncID) + if err != nil { + return "", false, err } + return s.syncID, false, nil } - l.Warn("retrying operation", zap.Error(err), zap.Duration("wait", wait)) - - for { - select { - case <-time.After(wait): - return true - case <-ctx.Done(): - return false + var syncID string + var newSync bool + var err error + if len(s.targetedSyncResourceIDs) == 0 { + syncID, newSync, err = s.store.StartSync(ctx) + if err != nil { + return "", false, err } + return syncID, newSync, nil } -} -func isWarning(ctx context.Context, err error) bool { - if err == nil { - return false + // Get most recent completed full sync if it exists + latestFullSyncResponse, err := s.store.GetLatestFinishedSync(ctx, &reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest{ + SyncType: string(dotc1z.SyncTypeFull), + }) + if err != nil { + return "", false, err } - - if status.Code(err) == codes.NotFound { - return true + var latestFullSyncId string + latestFullSync := latestFullSyncResponse.Sync + if latestFullSync != nil { + latestFullSyncId = latestFullSync.Id + } + syncID, err = s.store.StartNewSyncV2(ctx, "partial", latestFullSyncId) + if err != nil { + return "", false, err } + newSync = true - return false + return syncID, newSync, nil } // Sync starts the syncing process. The sync process is driven by the action stack that is part of the state object. @@ -345,7 +336,17 @@ func (s *syncer) Sync(ctx context.Context) error { return err } - syncID, newSync, err := s.store.StartSync(ctx) + // Validate any targeted resource IDs before starting a sync. + targetedResources := []*v2.Resource{} + for _, resourceID := range s.targetedSyncResourceIDs { + r, err := bid.ParseResourceBid(resourceID) + if err != nil { + return fmt.Errorf("error parsing resource id %s: %w", resourceID, err) + } + targetedResources = append(targetedResources, r) + } + + syncID, newSync, err := s.startOrResumeSync(ctx) if err != nil { return err } @@ -370,6 +371,12 @@ func (s *syncer) Sync(ctx context.Context) error { } s.state = state + retryer := retry.NewRetryer(ctx, retry.RetryConfig{ + MaxAttempts: 0, + InitialDelay: 1 * time.Second, + MaxDelay: 0, + }) + var warnings []error for s.state.Current() != nil { err = s.Checkpoint(ctx, false) @@ -401,12 +408,40 @@ func (s *syncer) Sync(ctx context.Context) error { case InitOp: s.state.FinishAction(ctx) + if len(targetedResources) > 0 { + for _, r := range targetedResources { + s.state.PushAction(ctx, Action{ + Op: SyncTargetedResourceOp, + ResourceID: r.GetId().GetResource(), + ResourceTypeID: r.GetId().GetResourceType(), + ParentResourceID: r.GetParentResourceId().GetResource(), + ParentResourceTypeID: r.GetParentResourceId().GetResourceType(), + }) + } + s.state.SetShouldFetchRelatedResources() + s.state.PushAction(ctx, Action{Op: SyncResourceTypesOp}) + err = s.Checkpoint(ctx, true) + if err != nil { + return err + } + // Don't do grant expansion or external resources in partial syncs, as we likely lack related resources/entitlements/grants + continue + } + // FIXME(jirwin): Disabling syncing assets for now // s.state.PushAction(ctx, Action{Op: SyncAssetsOp}) s.state.PushAction(ctx, Action{Op: SyncGrantExpansionOp}) if s.externalResourceReader != nil { s.state.PushAction(ctx, Action{Op: SyncExternalResourcesOp}) } + if s.onlyExpandGrants { + s.state.SetNeedsExpansion() + err = s.Checkpoint(ctx, true) + if err != nil { + return err + } + continue + } s.state.PushAction(ctx, Action{Op: SyncGrantsOp}) s.state.PushAction(ctx, Action{Op: SyncEntitlementsOp}) s.state.PushAction(ctx, Action{Op: SyncResourcesOp}) @@ -420,14 +455,27 @@ func (s *syncer) Sync(ctx context.Context) error { case SyncResourceTypesOp: err = s.SyncResourceTypes(ctx) - if !shouldWaitAndRetry(ctx, err) { + if !retryer.ShouldWaitAndRetry(ctx, err) { return err } continue case SyncResourcesOp: err = s.SyncResources(ctx) - if !shouldWaitAndRetry(ctx, err) { + if !retryer.ShouldWaitAndRetry(ctx, err) { + return err + } + continue + + case SyncTargetedResourceOp: + err = s.SyncTargetedResource(ctx) + if isWarning(ctx, err) { + l.Warn("skipping sync targeted resource action", zap.Any("stateAction", stateAction), zap.Error(err)) + warnings = append(warnings, err) + s.state.FinishAction(ctx) + continue + } + if !retryer.ShouldWaitAndRetry(ctx, err) { return err } continue @@ -440,7 +488,7 @@ func (s *syncer) Sync(ctx context.Context) error { s.state.FinishAction(ctx) continue } - if !shouldWaitAndRetry(ctx, err) { + if !retryer.ShouldWaitAndRetry(ctx, err) { return err } continue @@ -453,20 +501,20 @@ func (s *syncer) Sync(ctx context.Context) error { s.state.FinishAction(ctx) continue } - if !shouldWaitAndRetry(ctx, err) { + if !retryer.ShouldWaitAndRetry(ctx, err) { return err } continue case SyncExternalResourcesOp: err = s.SyncExternalResources(ctx) - if !shouldWaitAndRetry(ctx, err) { + if !retryer.ShouldWaitAndRetry(ctx, err) { return err } continue case SyncAssetsOp: err = s.SyncAssets(ctx) - if !shouldWaitAndRetry(ctx, err) { + if !retryer.ShouldWaitAndRetry(ctx, err) { return err } continue @@ -479,7 +527,7 @@ func (s *syncer) Sync(ctx context.Context) error { } err = s.SyncGrantExpansion(ctx) - if !shouldWaitAndRetry(ctx, err) { + if !retryer.ShouldWaitAndRetry(ctx, err) { return err } continue @@ -630,6 +678,94 @@ func (s *syncer) getSubResources(ctx context.Context, parent *v2.Resource) error return nil } +func (s *syncer) getResourceFromConnector(ctx context.Context, resourceID *v2.ResourceId, parentResourceID *v2.ResourceId) (*v2.Resource, error) { + ctx, span := tracer.Start(ctx, "syncer.getResource") + defer span.End() + + resourceResp, err := s.connector.GetResource(ctx, + &v2.ResourceGetterServiceGetResourceRequest{ + ResourceId: resourceID, + ParentResourceId: parentResourceID, + }, + ) + if err == nil { + return resourceResp.Resource, nil + } + l := ctxzap.Extract(ctx) + if status.Code(err) == codes.NotFound { + l.Warn("skipping resource due to not found", zap.String("resource_id", resourceID.GetResource()), zap.String("resource_type_id", resourceID.GetResourceType())) + return nil, nil + } + if status.Code(err) == codes.Unimplemented { + l.Warn("skipping resource due to unimplemented connector", zap.String("resource_id", resourceID.GetResource()), zap.String("resource_type_id", resourceID.GetResourceType())) + return nil, nil + } + return nil, err +} + +func (s *syncer) SyncTargetedResource(ctx context.Context) error { + ctx, span := tracer.Start(ctx, "syncer.SyncTargetedResource") + defer span.End() + + resourceID := s.state.ResourceID(ctx) + resourceTypeID := s.state.ResourceTypeID(ctx) + if resourceID == "" || resourceTypeID == "" { + return errors.New("cannot get resource without a resource target") + } + + parentResourceID := s.state.ParentResourceID(ctx) + parentResourceTypeID := s.state.ParentResourceTypeID(ctx) + var prID *v2.ResourceId + if parentResourceID != "" && parentResourceTypeID != "" { + prID = &v2.ResourceId{ + ResourceType: parentResourceTypeID, + Resource: parentResourceID, + } + } + + resource, err := s.getResourceFromConnector(ctx, &v2.ResourceId{ + ResourceType: resourceTypeID, + Resource: resourceID, + }, prID) + if err != nil { + return err + } + + // If getResource encounters not found or unimplemented, it returns a nil resource and nil error. + if resource == nil { + s.state.FinishAction(ctx) + return nil + } + + // Save our resource in the DB + if err := s.store.PutResources(ctx, resource); err != nil { + return err + } + + s.state.FinishAction(ctx) + + // 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, + }) + + s.state.PushAction(ctx, Action{ + Op: SyncEntitlementsOp, + ResourceTypeID: resourceTypeID, + ResourceID: resourceID, + }) + + err = s.getSubResources(ctx, resource) + if err != nil { + return err + } + + return nil +} + // SyncResources handles fetching all of the resources from the connector given the provided resource types. For each // resource, we gather any child resource types it may emit, and traverse the resource tree. func (s *syncer) SyncResources(ctx context.Context) error { @@ -659,7 +795,14 @@ func (s *syncer) SyncResources(ctx context.Context) error { } for _, rt := range resp.List { - s.state.PushAction(ctx, Action{Op: SyncResourcesOp, ResourceTypeID: rt.Id}) + 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 != "" { + action.ParentResourceID = s.state.Current().ParentResourceID + action.ParentResourceTypeID = s.state.Current().ParentResourceTypeID + } + + s.state.PushAction(ctx, action) } return nil @@ -1416,6 +1559,7 @@ func (s *syncer) syncGrantsForResource(ctx context.Context, resourceID *v2.Resou // We want to process any grants from the previous sync first so that if there is a conflict, the newer data takes precedence grants = append(grants, resp.List...) + l := ctxzap.Extract(ctx) for _, grant := range grants { grantAnnos := annotations.Annotations(grant.GetAnnotations()) if grantAnnos.Contains(&v2.GrantExpandable{}) { @@ -1424,6 +1568,57 @@ func (s *syncer) syncGrantsForResource(ctx context.Context, resourceID *v2.Resou if grantAnnos.ContainsAny(&v2.ExternalResourceMatchAll{}, &v2.ExternalResourceMatch{}, &v2.ExternalResourceMatchID{}) { s.state.SetHasExternalResourcesGrants() } + + if !s.state.ShouldFetchRelatedResources() { + continue + } + // Some connectors emit grants for other resources. If we're doing a partial sync, check if it exists and queue a fetch if not. + entitlementResource := grant.GetEntitlement().GetResource() + _, err := s.store.GetResource(ctx, &reader_v2.ResourcesReaderServiceGetResourceRequest{ + ResourceId: entitlementResource.GetId(), + }) + if err != nil { + if !errors.Is(err, sql.ErrNoRows) { + return err + } + + erId := entitlementResource.GetId() + prId := entitlementResource.GetParentResourceId() + resource, err := s.getResourceFromConnector(ctx, erId, prId) + if err != nil { + l.Error("error fetching entitlement resource", zap.Error(err)) + return err + } + if resource == nil { + continue + } + if err := s.store.PutResources(ctx, resource); err != nil { + 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 { @@ -1543,6 +1738,14 @@ func (s *syncer) SyncExternalResourcesWithGrantToEntitlement(ctx context.Context for _, resourceId := range resourceIDs { resourceResp, err := s.externalResourceReader.GetResource(ctx, &reader_v2.ResourcesReaderServiceGetResourceRequest{ResourceId: resourceId}) if err != nil { + if errors.Is(err, sql.ErrNoRows) { + l.Debug( + "resource was not found in external sync", + zap.String("resource_id", resourceId.Resource), + zap.String("resource_type_id", resourceId.ResourceType), + ) + continue + } return err } resourceVal := resourceResp.GetResource() @@ -1983,7 +2186,7 @@ func (s *syncer) processGrantsWithExternalPrincipals(ctx context.Context, princi } } profileVal, ok := resource.GetProfileStringValue(userTrait.Profile, matchExternalResource.Key) - if ok && profileVal == matchExternalResource.Value { + if ok && strings.EqualFold(profileVal, matchExternalResource.Value) { newGrant := newGrantForExternalPrincipal(grant, userPrincipal) expandedGrants = append(expandedGrants, newGrant) } @@ -1996,7 +2199,7 @@ func (s *syncer) processGrantsWithExternalPrincipals(ctx context.Context, princi continue } profileVal, ok := resource.GetProfileStringValue(groupTrait.Profile, matchExternalResource.Key) - if ok && profileVal == matchExternalResource.Value { + if ok && strings.EqualFold(profileVal, matchExternalResource.Value) { newGrant := newGrantForExternalPrincipal(grant, groupPrincipal) newGrantAnnos := annotations.Annotations(newGrant.Annotations) @@ -2510,6 +2713,24 @@ func WithExternalResourceEntitlementIdFilter(entitlementId string) SyncOpt { } } +func WithTargetedSyncResourceIDs(resourceIDs []string) SyncOpt { + return func(s *syncer) { + s.targetedSyncResourceIDs = resourceIDs + } +} + +func WithOnlyExpandGrants() SyncOpt { + return func(s *syncer) { + s.onlyExpandGrants = true + } +} + +func WithSyncID(syncID string) SyncOpt { + return func(s *syncer) { + s.syncID = syncID + } +} + // NewSyncer returns a new syncer object. func NewSyncer(ctx context.Context, c types.ConnectorClient, opts ...SyncOpt) (Syncer, error) { s := &syncer{ diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go new file mode 100644 index 00000000..535c8ffe --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go @@ -0,0 +1,254 @@ +package synccompactor + +import ( + "context" + "errors" + "fmt" + "io" + "os" + "path" + "path/filepath" + + reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" + "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/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" +) + +type Compactor struct { + entries []*CompactableSync + + tmpDir string + destDir string +} + +type CompactableSync struct { + FilePath string + SyncID string +} + +var ErrNotEnoughFilesToCompact = errors.New("must provide two or more files to compact") + +type Option func(*Compactor) + +// WithTmpDir sets the working directory where files will be created and edited during compaction. +// If not provided, the temporary directory will be used. +func WithTmpDir(tempDir string) Option { + return func(c *Compactor) { + c.tmpDir = tempDir + } +} + +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} + for _, opt := range opts { + opt(c) + } + + // If no tmpDir is provided, use the tmpDir + if c.tmpDir == "" { + c.tmpDir = os.TempDir() + } + tmpDir, err := os.MkdirTemp(c.tmpDir, "baton-sync-compactor-") + if err != nil { + return nil, nil, err + } + c.tmpDir = tmpDir + + cleanup := func() error { + if err := os.RemoveAll(c.tmpDir); err != nil { + return err + } + return nil + } + + return c, cleanup, nil +} + +func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { + 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) + if err != nil { + return nil, err + } + + base = compactable + } + + l := ctxzap.Extract(ctx) + // Grant expansion doesn't use the connector interface at all, so giving syncer an empty connector is safe... for now. + // If that ever changes, we should implement a file connector that is a wrapper around the reader. + emptyConnector, err := sdk.NewEmptyConnector() + if err != nil { + l.Error("error creating empty connector", zap.Error(err)) + return nil, err + } + + // Use syncer to expand grants. + // TODO: Handle external resources. + syncer, err := sync.NewSyncer( + ctx, + emptyConnector, + sync.WithC1ZPath(base.FilePath), + sync.WithSyncID(base.SyncID), + sync.WithOnlyExpandGrants(), + ) + if err != nil { + l.Error("error creating syncer", zap.Error(err)) + return nil, err + } + + if err := syncer.Sync(ctx); err != nil { + l.Error("error syncing with grant expansion", zap.Error(err)) + return nil, err + } + if err := syncer.Close(ctx); err != nil { + l.Error("error closing syncer", zap.Error(err)) + return nil, err + } + + // 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 { + return nil, err + } + + if !filepath.IsAbs(finalPath) { + abs, err := filepath.Abs(finalPath) + if err != nil { + return nil, err + } + finalPath = abs + } + return &CompactableSync{FilePath: finalPath, SyncID: base.SyncID}, nil +} + +func cpFile(sourcePath string, destPath string) error { + source, err := os.Open(sourcePath) + if err != nil { + return fmt.Errorf("failed to open source file: %w", err) + } + defer source.Close() + + destination, err := os.Create(destPath) + if err != nil { + return fmt.Errorf("failed to create destination file: %w", err) + } + defer destination.Close() + + _, err = io.Copy(destination, source) + if err != nil { + return fmt.Errorf("failed to copy file: %w", err) + } + + 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) + if err != nil { + return nil, nil, nil, nil, err + } + + cleanup := func() { + _ = baseC1Z.Close(ctx) + } + + baseFile, err := baseC1Z.LoadC1Z(ctx) + if err != nil { + return nil, nil, nil, cleanup, err + } + + cleanup = func() { + _ = baseFile.Close() + _ = baseC1Z.Close(ctx) + } + + latestAppliedSync, err := baseFile.GetSync(ctx, &reader_v2.SyncsReaderServiceGetSyncRequest{ + SyncId: info.SyncID, + Annotations: nil, + }) + if err != nil { + return nil, nil, nil, cleanup, err + } + + return latestAppliedSync.Sync, baseFile, baseC1Z, cleanup, nil +} + +func (c *Compactor) doOneCompaction(ctx context.Context, base *CompactableSync, applied *CompactableSync) (*CompactableSync, error) { + l := ctxzap.Extract(ctx) + l.Info( + "running compaction", + zap.String("base_file", base.FilePath), + zap.String("base_sync", base.SyncID), + zap.String("applied_file", applied.FilePath), + zap.String("applied_sync", applied.SyncID), + zap.String("tmp_dir", c.tmpDir), + ) + + opts := []dotc1z.C1ZOption{ + dotc1z.WithPragma("journal_mode", "WAL"), + dotc1z.WithTmpDir(c.tmpDir), + } + + fileName := fmt.Sprintf("compacted-%s-%s.c1z", base.SyncID, applied.SyncID) + newFile, err := dotc1z.NewC1ZFile(ctx, path.Join(c.tmpDir, fileName), opts...) + if err != nil { + l.Error("doOneCompaction failed: could not create c1z file", zap.Error(err)) + return nil, err + } + defer func() { _ = newFile.Close() }() + + newSync, err := newFile.StartNewSyncV2(ctx, string(dotc1z.SyncTypeFull), "") + if err != nil { + return nil, err + } + + _, baseFile, _, cleanupBase, err := getLatestObjects(ctx, base) + defer cleanupBase() + if err != nil { + return nil, err + } + + _, appliedFile, _, cleanupApplied, err := getLatestObjects(ctx, applied) + defer cleanupApplied() + if err != nil { + return nil, err + } + + runner := sync_compactor.NewNaiveCompactor(baseFile, appliedFile, newFile) + + if err := runner.Compact(ctx); err != nil { + l.Error("error running compaction", zap.Error(err)) + return nil, err + } + + if err := newFile.EndSync(ctx); err != nil { + return nil, err + } + + outputFilepath, err := newFile.OutputFilepath() + if err != nil { + return nil, err + } + + return &CompactableSync{ + FilePath: outputFilepath, + SyncID: newSync, + }, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/naive/naive.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/naive/naive.go new file mode 100644 index 00000000..7e4ae6e9 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/naive/naive.go @@ -0,0 +1,88 @@ +package naive + +import ( + "context" + + "github.com/conductorone/baton-sdk/pkg/dotc1z" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" + "google.golang.org/protobuf/proto" +) + +func NewNaiveCompactor(base *dotc1z.C1File, applied *dotc1z.C1File, dest *dotc1z.C1File) *Compactor { + return &Compactor{ + base: base, + applied: applied, + dest: dest, + } +} + +type Compactor struct { + base *dotc1z.C1File + applied *dotc1z.C1File + dest *dotc1z.C1File +} + +func (n *Compactor) Compact(ctx context.Context) error { + if err := n.processResourceTypes(ctx); err != nil { + return err + } + if err := n.processResources(ctx); err != nil { + return err + } + if err := n.processEntitlements(ctx); err != nil { + return err + } + if err := n.processGrants(ctx); err != nil { + return err + } + return nil +} + +func naiveCompact[T proto.Message, REQ listRequest, RESP listResponse[T]]( + ctx context.Context, + base listFunc[T, REQ, RESP], + applied listFunc[T, REQ, RESP], + save func(context.Context, ...T) error, +) error { + var t T + l := ctxzap.Extract(ctx) + l.Info("naive compaction: compacting objects", zap.String("object_type", string(t.ProtoReflect().Descriptor().FullName()))) + // List all objects from the base file and save them in the destination file + if err := listAllObjects(ctx, base, func(items []T) (bool, error) { + if err := save(ctx, items...); err != nil { + return false, err + } + return true, nil + }); err != nil { + return err + } + + // Then list all objects from the applied file and save them in the destination file, overwriting ones with the same external_id + if err := listAllObjects(ctx, applied, func(items []T) (bool, error) { + if err := save(ctx, items...); err != nil { + return false, err + } + return true, nil + }); err != nil { + return err + } + + return nil +} + +func (n *Compactor) processResourceTypes(ctx context.Context) error { + return naiveCompact(ctx, n.base.ListResourceTypes, n.applied.ListResourceTypes, n.dest.PutResourceTypesIfNewer) +} + +func (n *Compactor) processResources(ctx context.Context) error { + return naiveCompact(ctx, n.base.ListResources, n.applied.ListResources, n.dest.PutResourcesIfNewer) +} + +func (n *Compactor) processGrants(ctx context.Context) error { + return naiveCompact(ctx, n.base.ListGrants, n.applied.ListGrants, n.dest.PutGrantsIfNewer) +} + +func (n *Compactor) processEntitlements(ctx context.Context) error { + return naiveCompact(ctx, n.base.ListEntitlements, n.applied.ListEntitlements, n.dest.PutEntitlementsIfNewer) +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/naive/naive_unroll.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/naive/naive_unroll.go new file mode 100644 index 00000000..cc4f8064 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/naive/naive_unroll.go @@ -0,0 +1,98 @@ +package naive + +import ( + "context" + "reflect" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" +) + +type listRequest interface { + proto.Message + GetPageSize() uint32 + GetPageToken() string + GetAnnotations() []*anypb.Any +} + +type listResponse[T proto.Message] interface { + GetNextPageToken() string + GetAnnotations() []*anypb.Any + GetList() []T +} + +// createRequest creates a new request object of type REQ using reflection. +func createRequest[REQ listRequest]() REQ { + var r REQ + baseType := reflect.TypeOf(r).Elem() + pointerToInitializedVal := reflect.New(baseType) + return pointerToInitializedVal.Interface().(REQ) +} + +// setFieldIfValid sets a field in a struct if it exists and can be set. +func setFieldIfValid(obj interface{}, fieldName string, setValue func(reflect.Value)) { + val := reflect.ValueOf(obj) + if val.Kind() != reflect.Ptr || val.IsNil() { + return + } + + field := val.Elem().FieldByName(fieldName) + if field.IsValid() && field.CanSet() { + setValue(field) + } +} + +// setPageSize sets the PageSize field in a request to the specified value. +func setPageSize(req listRequest, size uint64) { + setFieldIfValid(req, "PageSize", func(field reflect.Value) { + field.SetUint(size) + }) +} + +// setPageToken sets the PageToken field in a request to the specified token. +func setPageToken(req listRequest, token string) { + setFieldIfValid(req, "PageToken", func(field reflect.Value) { + field.SetString(token) + }) +} + +type listFunc[T proto.Message, REQ listRequest, RESP listResponse[T]] func(context.Context, REQ) (RESP, error) + +func listAllObjects[T proto.Message, REQ listRequest, RESP listResponse[T]](ctx context.Context, list listFunc[T, REQ, RESP], cb func(items []T) (bool, error)) error { + // Create a new request using reflection + req := createRequest[REQ]() + + // Set initial page size + setPageSize(req, 100) // Set a reasonable default page size + + var nextPageToken string + for { + // Set the page token for the current request if needed + if nextPageToken != "" { + setPageToken(req, nextPageToken) + } + + // Call the list function with the current request + resp, err := list(ctx, req) + if err != nil { + return err + } + + // Collect the results + shouldContinue, err := cb(resp.GetList()) + if err != nil { + return err + } + if !shouldContinue { + return nil + } + + // Check if there are more pages + nextPageToken = resp.GetNextPageToken() + if nextPageToken == "" || len(resp.GetList()) == 0 { + break // No more pages + } + } + + return nil +} 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 c9690ae1..0bec6a27 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 @@ -32,6 +32,7 @@ type fullSyncTaskHandler struct { skipFullSync bool externalResourceC1ZPath string externalResourceEntitlementIdFilter string + targetedSyncResourceIDs []string } func (c *fullSyncTaskHandler) sync(ctx context.Context, c1zPath string) error { @@ -57,6 +58,10 @@ func (c *fullSyncTaskHandler) sync(ctx context.Context, c1zPath string) error { syncOpts = append(syncOpts, sdkSync.WithSkipFullSync()) } + if len(c.targetedSyncResourceIDs) > 0 { + syncOpts = append(syncOpts, sdkSync.WithTargetedSyncResourceIDs(c.targetedSyncResourceIDs)) + } + syncer, err := sdkSync.NewSyncer(ctx, c.helpers.ConnectorClient(), syncOpts...) if err != nil { l.Error("failed to create syncer", zap.Error(err)) @@ -156,13 +161,21 @@ func (c *fullSyncTaskHandler) HandleTask(ctx context.Context) error { return c.helpers.FinishTask(ctx, nil, nil, nil) } -func newFullSyncTaskHandler(task *v1.Task, helpers fullSyncHelpers, skipFullSync bool, externalResourceC1ZPath string, externalResourceEntitlementIdFilter string) tasks.TaskHandler { +func newFullSyncTaskHandler( + task *v1.Task, + helpers fullSyncHelpers, + skipFullSync bool, + externalResourceC1ZPath string, + externalResourceEntitlementIdFilter string, + targetedSyncResourceIDs []string, +) tasks.TaskHandler { return &fullSyncTaskHandler{ task: task, helpers: helpers, skipFullSync: skipFullSync, externalResourceC1ZPath: externalResourceC1ZPath, externalResourceEntitlementIdFilter: externalResourceEntitlementIdFilter, + targetedSyncResourceIDs: targetedSyncResourceIDs, } } @@ -172,15 +185,33 @@ func uploadDebugLogs(ctx context.Context, helper fullSyncHelpers) error { l := ctxzap.Extract(ctx) - debugfilelocation := filepath.Join(helper.TempDir(), "debug.log") + tempDir := helper.TempDir() + if tempDir == "" { + wd, err := os.Getwd() + if err != nil { + 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,"+ + " 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") + } + } + debugfilelocation := filepath.Join(tempDir, "debug.log") _, err := os.Stat(debugfilelocation) if err != nil { - if errors.Is(err, os.ErrNotExist) { + switch { + case errors.Is(err, os.ErrNotExist): l.Warn("debug log file does not exists", zap.Error(err)) - return nil + 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 err + return nil } else { debugfile, err := os.Open(debugfilelocation) if err != nil { @@ -190,7 +221,6 @@ func uploadDebugLogs(ctx context.Context, helper fullSyncHelpers) error { l.Info("uploading debug logs", zap.String("file", debugfilelocation)) err = helper.Upload(ctx, debugfile) - if err != nil { return err } 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 216d1320..ad3867e3 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 @@ -52,6 +52,7 @@ type c1ApiTaskManager struct { runnerShouldDebug bool externalResourceC1Z string externalResourceEntitlementIdFilter string + targetedSyncResourceIDs []string } // getHeartbeatInterval returns an appropriate heartbeat interval. If the interval is 0, it will return the default heartbeat interval. @@ -246,7 +247,14 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. var handler tasks.TaskHandler switch tasks.GetType(task) { case taskTypes.FullSyncType: - handler = newFullSyncTaskHandler(task, tHelpers, c.skipFullSync, c.externalResourceC1Z, c.externalResourceEntitlementIdFilter) + handler = newFullSyncTaskHandler( + task, + tHelpers, + c.skipFullSync, + c.externalResourceC1Z, + c.externalResourceEntitlementIdFilter, + c.targetedSyncResourceIDs, + ) case taskTypes.HelloType: handler = newHelloTaskHandler(task, tHelpers) case taskTypes.GrantType: @@ -296,7 +304,8 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. func NewC1TaskManager( ctx context.Context, clientID string, clientSecret string, tempDir string, skipFullSync bool, - externalC1Z string, externalResourceEntitlementIdFilter string) (tasks.Manager, error) { + externalC1Z string, externalResourceEntitlementIdFilter string, targetedSyncResourceIDs []string, +) (tasks.Manager, error) { serviceClient, err := newServiceClient(ctx, clientID, clientSecret) if err != nil { return nil, err @@ -308,5 +317,6 @@ func NewC1TaskManager( skipFullSync: skipFullSync, externalResourceC1Z: externalC1Z, externalResourceEntitlementIdFilter: externalResourceEntitlementIdFilter, + targetedSyncResourceIDs: targetedSyncResourceIDs, }, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/compactor.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/compactor.go new file mode 100644 index 00000000..1153134f --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/compactor.go @@ -0,0 +1,71 @@ +package local + +import ( + "context" + "sync" + "time" + + v1 "github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1" + "github.com/conductorone/baton-sdk/pkg/synccompactor" + "github.com/conductorone/baton-sdk/pkg/tasks" + "github.com/conductorone/baton-sdk/pkg/types" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" +) + +type localCompactor struct { + o sync.Once + + compactableSyncs []*synccompactor.CompactableSync + outputPath string +} + +func (m *localCompactor) GetTempDir() string { + return "" +} + +func (m *localCompactor) ShouldDebug() bool { + return false +} + +func (m *localCompactor) Next(ctx context.Context) (*v1.Task, time.Duration, error) { + var task *v1.Task + m.o.Do(func() { + task = &v1.Task{ + TaskType: &v1.Task_CompactSyncs_{}, + } + }) + return task, 0, nil +} + +func (m *localCompactor) Process(ctx context.Context, task *v1.Task, cc types.ConnectorClient) error { + ctx, span := tracer.Start(ctx, "localCompactor.Process", trace.WithNewRoot()) + defer span.End() + log := ctxzap.Extract(ctx) + + compactor, cleanup, err := synccompactor.NewCompactor(ctx, m.outputPath, m.compactableSyncs) + if err != nil { + return err + } + defer func() { + _ = cleanup() + }() + + compacted, err := compactor.Compact(ctx) + if err != nil { + return err + } + + log.Info("compacted file", zap.String("file_path", compacted.FilePath), zap.String("sync_id", compacted.SyncID)) + + return nil +} + +// NewLocalCompactor returns a task manager that queues a revoke task. +func NewLocalCompactor(ctx context.Context, outputPath string, compactableSyncs []*synccompactor.CompactableSync) tasks.Manager { + return &localCompactor{ + compactableSyncs: compactableSyncs, + outputPath: outputPath, + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/differ.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/differ.go new file mode 100644 index 00000000..75212f8c --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/differ.go @@ -0,0 +1,92 @@ +package local + +import ( + "context" + "errors" + "sync" + "time" + + v1 "github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1" + c1zmanager "github.com/conductorone/baton-sdk/pkg/dotc1z/manager" + "github.com/conductorone/baton-sdk/pkg/tasks" + "github.com/conductorone/baton-sdk/pkg/types" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" +) + +type localDiffer struct { + dbPath string + o sync.Once + + baseSyncID string + appliedSyncID string +} + +func (m *localDiffer) GetTempDir() string { + return "" +} + +func (m *localDiffer) ShouldDebug() bool { + return false +} + +func (m *localDiffer) Next(ctx context.Context) (*v1.Task, time.Duration, error) { + var task *v1.Task + m.o.Do(func() { + task = &v1.Task{ + TaskType: &v1.Task_CreateSyncDiff{}, + } + }) + return task, 0, nil +} + +func (m *localDiffer) Process(ctx context.Context, task *v1.Task, cc types.ConnectorClient) error { + ctx, span := tracer.Start(ctx, "localDiffer.Process", trace.WithNewRoot()) + defer span.End() + log := ctxzap.Extract(ctx) + + if m.baseSyncID == "" || m.appliedSyncID == "" { + return errors.New("missing base sync ID or applied sync ID") + } + + store, err := c1zmanager.New(ctx, m.dbPath) + if err != nil { + return err + } + file, err := store.LoadC1Z(ctx) + if err != nil { + return err + } + + newSyncID, err := file.GenerateSyncDiff(ctx, m.baseSyncID, m.appliedSyncID) + if err != nil { + return err + } + + if err := file.Close(); err != nil { + return err + } + + if err := store.SaveC1Z(ctx); err != nil { + log.Error("failed to save diff", zap.Error(err)) + return err + } + if err := store.Close(ctx); err != nil { + log.Error("failed to close store", zap.Error(err)) + return err + } + + log.Info("generated diff of syncs", zap.String("new_sync_id", newSyncID)) + + return nil +} + +// NewDiffer returns a task manager that queues a revoke task. +func NewDiffer(ctx context.Context, dbPath string, baseSyncID string, appliedSyncID string) tasks.Manager { + return &localDiffer{ + dbPath: dbPath, + baseSyncID: baseSyncID, + appliedSyncID: appliedSyncID, + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go index 0415b4e6..18e04a4b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go @@ -6,17 +6,19 @@ import ( "sync" "time" - "go.opentelemetry.io/otel/trace" - "google.golang.org/protobuf/encoding/protojson" - v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" v1 "github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1" "github.com/conductorone/baton-sdk/pkg/tasks" "github.com/conductorone/baton-sdk/pkg/types" + "go.opentelemetry.io/otel/trace" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/types/known/timestamppb" ) type localEventFeed struct { - o sync.Once + o sync.Once + feedId string + startAt time.Time } const EventsPerPageLocally = 100 @@ -33,7 +35,11 @@ func (m *localEventFeed) Next(ctx context.Context) (*v1.Task, time.Duration, err var task *v1.Task m.o.Do(func() { task = &v1.Task{ - TaskType: &v1.Task_EventFeed{}, + TaskType: &v1.Task_EventFeed{ + EventFeed: &v1.Task_EventFeedTask{ + StartAt: timestamppb.New(m.startAt), + }, + }, } }) return task, 0, nil @@ -46,9 +52,10 @@ func (m *localEventFeed) Process(ctx context.Context, task *v1.Task, cc types.Co var pageToken string for { resp, err := cc.ListEvents(ctx, &v2.ListEventsRequest{ - PageSize: EventsPerPageLocally, - Cursor: pageToken, - StartAt: task.GetEventFeed().GetStartAt(), + PageSize: EventsPerPageLocally, + Cursor: pageToken, + StartAt: task.GetEventFeed().GetStartAt(), + EventFeedId: m.feedId, }) if err != nil { return err @@ -71,6 +78,9 @@ func (m *localEventFeed) Process(ctx context.Context, task *v1.Task, cc types.Co } // NewEventFeed returns a task manager that queues an event feed task. -func NewEventFeed(ctx context.Context) tasks.Manager { - return &localEventFeed{} +func NewEventFeed(ctx context.Context, feedId string, startAt time.Time) tasks.Manager { + return &localEventFeed{ + feedId: feedId, + startAt: startAt, + } } 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 d6675f2b..d02a6d9a 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 @@ -20,6 +20,7 @@ type localSyncer struct { tmpDir string externalResourceC1Z string externalResourceEntitlementIdFilter string + targetedSyncResourceIDs []string } type Option func(*localSyncer) @@ -42,6 +43,12 @@ func WithExternalResourceEntitlementIdFilter(entitlementId string) Option { } } +func WithTargetedSyncResourceIDs(resourceIDs []string) Option { + return func(m *localSyncer) { + m.targetedSyncResourceIDs = resourceIDs + } +} + func (m *localSyncer) GetTempDir() string { return "" } @@ -68,7 +75,9 @@ func (m *localSyncer) Process(ctx context.Context, task *v1.Task, cc types.Conne sdkSync.WithC1ZPath(m.dbPath), sdkSync.WithTmpDir(m.tmpDir), sdkSync.WithExternalResourceC1ZPath(m.externalResourceC1Z), - sdkSync.WithExternalResourceEntitlementIdFilter(m.externalResourceEntitlementIdFilter)) + sdkSync.WithExternalResourceEntitlementIdFilter(m.externalResourceEntitlementIdFilter), + sdkSync.WithTargetedSyncResourceIDs(m.targetedSyncResourceIDs), + ) if err != nil { return err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go index c4ca3f67..d90dd35b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go @@ -66,6 +66,8 @@ func Is(task *v1.Task, target taskTypes.TaskType) bool { _, ok = task.GetTaskType().(*v1.Task_ActionInvoke) case taskTypes.ActionStatusType: _, ok = task.GetTaskType().(*v1.Task_ActionStatus) + case taskTypes.CreateSyncDiff: + _, ok = task.GetTaskType().(*v1.Task_CreateSyncDiff) default: return false } @@ -117,6 +119,8 @@ func GetType(task *v1.Task) taskTypes.TaskType { return taskTypes.ActionInvokeType case *v1.Task_ActionStatus: return taskTypes.ActionStatusType + case *v1.Task_CreateSyncDiff: + return taskTypes.CreateSyncDiff default: return taskTypes.UnknownType } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go index 69699b79..5be4e840 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go @@ -71,3 +71,28 @@ func NewAssignmentEntitlement(resource *v2.Resource, name string, entitlementOpt } return entitlement } + +func NewEntitlement(resource *v2.Resource, name, purposeStr string, entitlementOptions ...EntitlementOption) *v2.Entitlement { + var purpose v2.Entitlement_PurposeValue + switch purposeStr { + case "permission": + purpose = v2.Entitlement_PURPOSE_VALUE_PERMISSION + case "assignment": + purpose = v2.Entitlement_PURPOSE_VALUE_ASSIGNMENT + default: + purpose = v2.Entitlement_PURPOSE_VALUE_UNSPECIFIED + } + + entitlement := &v2.Entitlement{ + Id: NewEntitlementID(resource, name), + DisplayName: name, + Slug: name, + Purpose: purpose, + Resource: resource, + } + + for _, entitlementOption := range entitlementOptions { + entitlementOption(entitlement) + } + return entitlement +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go index 71dd5dee..73071aa4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go @@ -36,6 +36,8 @@ func (tt TaskType) String() string { return "list_resource_types" case ListResourcesType: return "list_resources" + case GetResourceType: + return "get_resource" case ListEntitlementsType: return "list_entitlements" case ListGrantsType: @@ -81,10 +83,12 @@ const ( GetTicketSchemaType ListResourceTypesType ListResourcesType + GetResourceType ListEntitlementsType ListGrantsType GetMetadataType ListEventsType + ListEventFeedsType StartDebugging BulkCreateTicketsType BulkGetTicketsType @@ -92,4 +96,5 @@ const ( ActionGetSchemaType ActionInvokeType ActionStatusType + CreateSyncDiff ) 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 b82cd451..191c0a9b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/types.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/types.go @@ -23,6 +23,7 @@ type ConnectorServer interface { connectorV2.EventServiceServer connectorV2.TicketsServiceServer connectorV2.ActionServiceServer + connectorV2.ResourceGetterServiceServer } // ConnectorClient is an interface for a type that implements all ConnectorV2 services. @@ -41,6 +42,7 @@ type ConnectorClient interface { connectorV2.EventServiceClient connectorV2.TicketsServiceClient connectorV2.ActionServiceClient + connectorV2.ResourceGetterServiceClient } // ClientWrapper is an interface that returns a connector client. diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/pagination.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/pagination.go new file mode 100644 index 00000000..397eb4b9 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/pagination.go @@ -0,0 +1,99 @@ +package uhttp + +import ( + "strings" + + "github.com/conductorone/baton-sdk/pkg/pagination" +) + +/* + * Uhttp pagination handling. + * There are three common types of pagination: + * 1. NextLink: http header containing a url to fetch the next page + * 2. Cursor: http body containing a token to fetch the next page + * 3. Offset: offset + limit to fetch the next page + * - Subset of offset: incremental page numbers + * + * All of these helper functions take a bag and push the next page state on (if there is a next page). + */ + +type NextLinkConfig struct { + Header string `json:"header,omitempty"` // HTTP header containing the next link. Defaults to "link". + Rel string `json:"rel,omitempty"` // The rel value to look for in the link header. Defaults to "next". + ResourceTypeID string `json:"resource_type_id,omitempty"` + ResourceID string `json:"resource_id,omitempty"` +} + +// Parses the link header and returns a map of rel values to URLs. +func parseLinkHeader(header string) (map[string]string, error) { + if header == "" { + // Empty header is fine, it just means there are no more pages. + return nil, nil + } + + links := make(map[string]string) + headerLinks := strings.Split(header, ",") + for _, headerLink := range headerLinks { + linkParts := strings.Split(headerLink, ";") + if len(linkParts) < 2 { + continue + } + linkUrl := strings.TrimSpace(linkParts[0]) + linkUrl = strings.Trim(linkUrl, "<>") + var relValue string + for _, rel := range linkParts[1:] { + rel = strings.TrimSpace(rel) + relParts := strings.Split(rel, "=") + if len(relParts) < 2 { + continue + } + if relParts[0] == "rel" { + relValue = strings.Trim(relParts[1], "\"") + break + } + } + if relValue == "" { + continue + } + links[relValue] = linkUrl + } + + return links, nil +} + +// WithNextLinkPagination handles nextlink pagination. +// The config is optional, and if not provided, the default config will be used. +func WithNextLinkPagination(bag *pagination.Bag, config *NextLinkConfig) DoOption { + return func(resp *WrapperResponse) error { + if config == nil { + config = &NextLinkConfig{ + Header: "link", + Rel: "next", + } + } + if config.Header == "" { + config.Header = "link" + } + if config.Rel == "" { + config.Rel = "next" + } + nextLinkVal := resp.Header.Get(config.Header) + if nextLinkVal == "" { + return nil + } + links, err := parseLinkHeader(nextLinkVal) + if err != nil { + return err + } + nextLink := links[config.Rel] + if nextLink == "" { + return nil + } + bag.Push(pagination.PageState{ + Token: nextLink, + ResourceTypeID: config.ResourceTypeID, + ResourceID: config.ResourceID, + }) + return nil + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go index 4fd56e47..d4e42176 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go @@ -15,6 +15,27 @@ import ( "golang.org/x/net/http2" ) +var loggedResponseHeaders = []string{ + // Limit headers + "X-Ratelimit-Limit", + "Ratelimit-Limit", + "X-RateLimit-Requests-Limit", // Linear uses a non-standard header + "X-Rate-Limit-Limit", // Okta uses a non-standard header + + // Remaining headers + "X-Ratelimit-Remaining", + "Ratelimit-Remaining", + "X-RateLimit-Requests-Remaining", // Linear uses a non-standard header + "X-Rate-Limit-Remaining", // Okta uses a non-standard header + + // Reset headers + "X-Ratelimit-Reset", + "Ratelimit-Reset", + "X-RateLimit-Requests-Reset", // Linear uses a non-standard header + "X-Rate-Limit-Reset", // Okta uses a non-standard header + "Retry-After", // Often returned with 429 +} + // NewTransport creates a new Transport, applies the options, and then cycles the transport. func NewTransport(ctx context.Context, options ...Option) (*Transport, error) { t := newTransport() @@ -136,6 +157,15 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { if resp != nil { fields = append(fields, zap.Int("http.status_code", resp.StatusCode)) + + headers := make(map[string][]string, len(resp.Header)) + for _, header := range loggedResponseHeaders { + if v := resp.Header.Values(header); len(v) > 0 { + headers[header] = v + } + } + + fields = append(fields, zap.Any("http.headers", headers)) } t.l(ctx).Debug("Request complete", fields...) 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 57ca6b37..bb7337b2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go @@ -249,6 +249,50 @@ func WithResponse(response interface{}) DoOption { } } +// Handle anything that can be marshaled into JSON or XML. +// If the response is a list, its values will be put into the "items" field. +func WithGenericResponse(response *map[string]any) DoOption { + return func(resp *WrapperResponse) error { + if response == nil { + return status.Error(codes.InvalidArgument, "response is nil") + } + var v any + var err error + + if IsJSONContentType(resp.Header.Get(ContentType)) { + err = WithJSONResponse(&v)(resp) + if err != nil { + return err + } + if list, ok := v.([]any); ok { + (*response)["items"] = list + } else if vMap, ok := v.(map[string]any); ok { + *response = vMap + } else { + return status.Errorf(codes.Internal, "unsupported content type: %T", v) + } + return nil + } + + if IsXMLContentType(resp.Header.Get(ContentType)) { + err = WithXMLResponse(response)(resp) + if err != nil { + return err + } + if list, ok := v.([]any); ok { + (*response)["items"] = list + } else if vMap, ok := v.(map[string]any); ok { + *response = vMap + } else { + return status.Errorf(codes.Internal, "unsupported content type: %T", v) + } + return nil + } + + return status.Error(codes.Unknown, "unsupported content type") + } +} + func WrapErrors(preferredCode codes.Code, statusMsg string, errs ...error) error { st := status.New(preferredCode, statusMsg) @@ -402,6 +446,12 @@ func WithHeader(key, value string) RequestOption { } } +func WithBody(body []byte) RequestOption { + return func() (io.ReadWriter, map[string]string, error) { + return bytes.NewBuffer(body), nil, nil + } +} + func WithJSONBody(body interface{}) RequestOption { return func() (io.ReadWriter, map[string]string, error) { buffer := new(bytes.Buffer) diff --git a/vendor/modules.txt b/vendor/modules.txt index add5443b..a55860d7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -156,7 +156,7 @@ 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.2.93 +# github.com/conductorone/baton-sdk v0.3.10 ## explicit; go 1.23.4 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 @@ -192,9 +192,12 @@ github.com/conductorone/baton-sdk/pkg/metrics github.com/conductorone/baton-sdk/pkg/pagination 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/sync github.com/conductorone/baton-sdk/pkg/sync/expand +github.com/conductorone/baton-sdk/pkg/synccompactor +github.com/conductorone/baton-sdk/pkg/synccompactor/naive github.com/conductorone/baton-sdk/pkg/tasks github.com/conductorone/baton-sdk/pkg/tasks/c1api github.com/conductorone/baton-sdk/pkg/tasks/local