From 125457a3918fa30a56ed57fd124ed33fa32c2b70 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sat, 21 Nov 2026 21:29:49 +1100 Subject: [PATCH] feat(connector): declare privileged effects on every lookup and action (#2071) Regenerate the connector SDK from the host contract, which adds the effects_declared, privilege_change and secret_access fields. Every lookup and action in this repository now states them, and a Semaphore template states them in its effect settings or is unavailable in chat. --- connectors/host/actions.go | 8 +- connectors/host/actions_test.go | 11 + connectors/host/host.go | 3 + connectors/incus/incus.go | 12 +- connectors/incus/incus_test.go | 11 + connectors/semaphore/semaphore.go | 14 +- connectors/semaphore/semaphore_test.go | 28 + connectors/servicenow/calendar.go | 2 + connectors/servicenow/cmdb.go | 4 + connectors/servicenow/servicenow_test.go | 10 + sdk/connector/connector.go | 24 + sdk/connector/v1/connector.pb.go | 674 ++++++++++++++++++----- sdk/connector/v1/connector_grpc.pb.go | 68 ++- 13 files changed, 710 insertions(+), 159 deletions(-) diff --git a/connectors/host/actions.go b/connectors/host/actions.go index a8efe6c..263489c 100644 --- a/connectors/host/actions.go +++ b/connectors/host/actions.go @@ -94,16 +94,16 @@ func (h *host) actionTypes() []*connectorv1.ActionType { Description: "Delete the regular files directly or deeply under a directory on a host whose name matches a glob and that were not modified for at least a number of hours. The directory must be under the host's configured roots.", InputSchema: []byte(`{"type":"object","required":["host","directory","pattern","older_than_hours"],"additionalProperties":false,"properties":{` + hostProp + `,"directory":{"type":"string","description":"An absolute directory."},"pattern":{"type":"string","description":"A file name glob such as *.log; no path separators."},"older_than_hours":{"type":"integer","minimum":1}}}`), - Effect: &connectorv1.Effect{Reversibility: connectorv1.Reversibility_REVERSIBILITY_IRREVERSIBLE, Summary: "Deletes files; irreversible unless the directory is one the host declares disposable."}, + Effect: &connectorv1.Effect{EffectsDeclared: true, Reversibility: connectorv1.Reversibility_REVERSIBILITY_IRREVERSIBLE, Summary: "Deletes files; irreversible unless the directory is one the host declares disposable."}, Idempotent: true, }} if timers { schema := []byte(`{"type":"object","required":["host","timer"],"additionalProperties":false,"properties":{` + hostProp + `,"timer":{"type":"string","description":"A systemd timer unit name from the host's allow-list."}}}`) types = append(types, &connectorv1.ActionType{Name: actionDisableTimer, Description: "Disable and stop a systemd timer on a host.", InputSchema: schema, Idempotent: true, - Effect: &connectorv1.Effect{Reversibility: connectorv1.Reversibility_REVERSIBILITY_UNDONE_AUTOMATICALLY, Summary: "Disables and stops a timer; enabling it again undoes this."}}, + Effect: &connectorv1.Effect{EffectsDeclared: true, Reversibility: connectorv1.Reversibility_REVERSIBILITY_UNDONE_AUTOMATICALLY, Summary: "Disables and stops a timer; enabling it again undoes this."}}, &connectorv1.ActionType{Name: actionEnableTimer, Description: "Enable and start a systemd timer on a host.", InputSchema: schema, Idempotent: true, - Effect: &connectorv1.Effect{Reversibility: connectorv1.Reversibility_REVERSIBILITY_UNDONE_AUTOMATICALLY, Summary: "Enables and starts a timer; disabling it again undoes this."}}, + Effect: &connectorv1.Effect{EffectsDeclared: true, Reversibility: connectorv1.Reversibility_REVERSIBILITY_UNDONE_AUTOMATICALLY, Summary: "Enables and starts a timer; disabling it again undoes this."}}, ) } if configs { @@ -112,7 +112,7 @@ func (h *host) actionTypes() []*connectorv1.ActionType { Description: "Set one KEY=VALUE line in a config file the host allows, keeping a backup of the file as it was.", InputSchema: []byte(`{"type":"object","required":["host","file","key","value"],"additionalProperties":false,"properties":{` + hostProp + `,"file":{"type":"string","description":"An absolute path from the host's allow-list."},"key":{"type":"string"},"value":{"type":"string","description":"A single line."}}}`), - Effect: &connectorv1.Effect{Reversibility: connectorv1.Reversibility_REVERSIBILITY_RECOVERABLE, Summary: "Changes one setting in a config file; the previous file is kept beside it."}, + Effect: &connectorv1.Effect{EffectsDeclared: true, Reversibility: connectorv1.Reversibility_REVERSIBILITY_RECOVERABLE, Summary: "Changes one setting in a config file; the previous file is kept beside it."}, Idempotent: true, }) } diff --git a/connectors/host/actions_test.go b/connectors/host/actions_test.go index 3bc7608..669ffc7 100644 --- a/connectors/host/actions_test.go +++ b/connectors/host/actions_test.go @@ -11,6 +11,7 @@ import ( "testing" "time" + "github.com/samcharles93/archipelago/sdk/connector" connectorv1 "github.com/samcharles93/archipelago/sdk/connector/v1" ) @@ -351,3 +352,13 @@ func TestCommandsDoWhatTheyReport(t *testing.T) { t.Fatalf("appended config = %q", body) } } + +// TestEveryToolDeclaresItsEffects guards the chat prohibition: chat offers only +// lookups and actions that state whether they change privileges or access +// secrets. +func TestEveryToolDeclaresItsEffects(t *testing.T) { + h, _ := fakeHost(t, execResult{}) + if names := connector.UndeclaredEffects(h.Describe()); len(names) > 0 { + t.Fatalf("no declared effects for %v", names) + } +} diff --git a/connectors/host/host.go b/connectors/host/host.go index a5e54bc..ee5baf1 100644 --- a/connectors/host/host.go +++ b/connectors/host/host.go @@ -100,16 +100,19 @@ func (h *host) Describe() connector.Description { Name: "filesystem_usage", Description: "Size, used and available bytes and inode use of the filesystem holding a path on a host.", InputSchema: []byte(`{"type":"object","required":["host","path"],"additionalProperties":false,"properties":{"host":{"type":"string"},"path":{"type":"string","description":"An absolute path."}}}`), + Effect: connector.NoPrivilegedEffects(), }, { Name: "directory_sizes", Description: "The largest entries directly under a directory on a host, by total size, staying on its filesystem.", InputSchema: []byte(`{"type":"object","required":["host","path"],"additionalProperties":false,"properties":{"host":{"type":"string"},"path":{"type":"string","description":"An absolute path."},"limit":{"type":"integer","minimum":1,"maximum":50}}}`), + Effect: connector.NoPrivilegedEffects(), }, { Name: "old_files", Description: "The largest files under a directory on a host not modified for at least a number of hours, staying on its filesystem.", InputSchema: []byte(`{"type":"object","required":["host","path"],"additionalProperties":false,"properties":{"host":{"type":"string"},"path":{"type":"string","description":"An absolute path."},"older_than_hours":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":50}}}`), + Effect: connector.NoPrivilegedEffects(), }, }} } diff --git a/connectors/incus/incus.go b/connectors/incus/incus.go index 5e8bb62..510e0a8 100644 --- a/connectors/incus/incus.go +++ b/connectors/incus/incus.go @@ -143,10 +143,12 @@ func (c *incusConnector) Describe() connector.Description { { Name: lookupList, Description: "Containers in a project with their state.", InputSchema: []byte(`{"type":"object","required":["project"],"additionalProperties":false,"properties":{"project":{"type":"string"}}}`), + Effect: connector.NoPrivilegedEffects(), }, { Name: lookupCommand, Description: "Run an allowed read-only command inside a container and return its exit code and output.", InputSchema: cmdSchema, + Effect: connector.NoPrivilegedEffects(), }, }, Actions: []*connectorv1.ActionType{ @@ -154,8 +156,9 @@ func (c *incusConnector) Describe() connector.Description { Name: actionSnapshot, Description: "Take a snapshot of a container.", InputSchema: []byte(`{"type":"object","required":["project","container"],"additionalProperties":false,"properties":{"project":{"type":"string"},"container":{"type":"string"}}}`), Effect: &connectorv1.Effect{ - Reversibility: connectorv1.Reversibility_REVERSIBILITY_UNDONE_AUTOMATICALLY, - Summary: "Takes a snapshot of the container; the snapshot can be deleted to undo it.", + EffectsDeclared: true, + Reversibility: connectorv1.Reversibility_REVERSIBILITY_UNDONE_AUTOMATICALLY, + Summary: "Takes a snapshot of the container; the snapshot can be deleted to undo it.", }, Idempotent: true, }, @@ -163,8 +166,9 @@ func (c *incusConnector) Describe() connector.Description { Name: actionDeleteCache, Description: "Delete a cache directory or file inside a container, under one of the container's allowed cache paths.", InputSchema: []byte(`{"type":"object","required":["project","container","path"],"additionalProperties":false,"properties":{"project":{"type":"string"},"container":{"type":"string"},"path":{"type":"string","description":"An absolute path under an allowed cache path."}}}`), Effect: &connectorv1.Effect{ - Reversibility: connectorv1.Reversibility_REVERSIBILITY_IRREVERSIBLE, - Summary: "Deletes the path and everything under it inside the container; recoverable only from a recent snapshot.", + EffectsDeclared: true, + Reversibility: connectorv1.Reversibility_REVERSIBILITY_IRREVERSIBLE, + Summary: "Deletes the path and everything under it inside the container; recoverable only from a recent snapshot.", }, Idempotent: true, }, diff --git a/connectors/incus/incus_test.go b/connectors/incus/incus_test.go index ae8ce2c..3e88817 100644 --- a/connectors/incus/incus_test.go +++ b/connectors/incus/incus_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + "github.com/samcharles93/archipelago/sdk/connector" connectorv1 "github.com/samcharles93/archipelago/sdk/connector/v1" ) @@ -194,3 +195,13 @@ func TestResolve(t *testing.T) { }) } } + +// TestEveryToolDeclaresItsEffects guards the chat prohibition: chat offers only +// lookups and actions that state whether they change privileges or access +// secrets. +func TestEveryToolDeclaresItsEffects(t *testing.T) { + + if names := connector.UndeclaredEffects((&incusConnector{}).Describe()); len(names) > 0 { + t.Fatalf("no declared effects for %v", names) + } +} diff --git a/connectors/semaphore/semaphore.go b/connectors/semaphore/semaphore.go index 7949132..c8e3515 100644 --- a/connectors/semaphore/semaphore.go +++ b/connectors/semaphore/semaphore.go @@ -40,6 +40,12 @@ type Template struct { // "irreversible". Reversibility string `json:"reversibility"` Summary string `json:"summary"` + // PrivilegeChange and SecretAccess say whether the template grants + // access, changes identities or policies, or reads or exports secrets. + // A template that sets both states its effects; one that omits either + // is unavailable in chat. + PrivilegeChange *bool `json:"privilege_change"` + SecretAccess *bool `json:"secret_access"` } `json:"effect"` Target struct { Kind string `json:"kind"` @@ -146,7 +152,13 @@ func reversibility(name string, readOnly bool) (connectorv1.Reversibility, error func (s *semaphore) effect(t Template) *connectorv1.Effect { r, _ := reversibility(t.Effect.Reversibility, t.Effect.ReadOnly) - return &connectorv1.Effect{ReadOnly: t.Effect.ReadOnly, Reversibility: r, Summary: t.Effect.Summary} + e := &connectorv1.Effect{ReadOnly: t.Effect.ReadOnly, Reversibility: r, Summary: t.Effect.Summary} + if t.Effect.PrivilegeChange != nil && t.Effect.SecretAccess != nil { + e.EffectsDeclared = true + e.PrivilegeChange = *t.Effect.PrivilegeChange + e.SecretAccess = *t.Effect.SecretAccess + } + return e } func (s *semaphore) Describe() connector.Description { diff --git a/connectors/semaphore/semaphore_test.go b/connectors/semaphore/semaphore_test.go index bf5a76a..f6841ea 100644 --- a/connectors/semaphore/semaphore_test.go +++ b/connectors/semaphore/semaphore_test.go @@ -197,3 +197,31 @@ func TestALaunchRunsOnlyOnItsHost(t *testing.T) { }) } } + +// TestTemplatesDeclareEffectsExplicitly guards the chat prohibition: a template +// is offered in chat only when the operator states both whether it changes +// privileges and whether it accesses secrets. +func TestTemplatesDeclareEffectsExplicitly(t *testing.T) { + tests := []struct { + name string + effect string + want [3]bool + }{ + {name: "neither stated", effect: `{"reversibility":"irreversible"}`}, + {name: "only one stated", effect: `{"reversibility":"irreversible","privilege_change":false}`}, + {name: "both false", effect: `{"reversibility":"irreversible","privilege_change":false,"secret_access":false}`, want: [3]bool{true, false, false}}, + {name: "secret access", effect: `{"reversibility":"irreversible","privilege_change":false,"secret_access":true}`, want: [3]bool{true, false, true}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var tpl Template + if err := json.Unmarshal([]byte(`{"action":"run","template_id":7,"effect":`+tt.effect+`}`), &tpl); err != nil { + t.Fatal(err) + } + e := (&semaphore{}).effect(tpl) + if got := [3]bool{e.GetEffectsDeclared(), e.GetPrivilegeChange(), e.GetSecretAccess()}; got != tt.want { + t.Fatalf("declared, privilege change, secret access = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/connectors/servicenow/calendar.go b/connectors/servicenow/calendar.go index 1696758..2ef6e05 100644 --- a/connectors/servicenow/calendar.go +++ b/connectors/servicenow/calendar.go @@ -8,6 +8,7 @@ import ( "net/url" "time" + "github.com/samcharles93/archipelago/sdk/connector" connectorv1 "github.com/samcharles93/archipelago/sdk/connector/v1" ) @@ -29,6 +30,7 @@ func calendarLookups() []*connectorv1.LookupType { Name: blackoutsLookup, Description: "Active change-calendar blackouts, which the Timing guard reads as a freeze.", InputSchema: blackoutsInputSchema, + Effect: connector.NoPrivilegedEffects(), }} } diff --git a/connectors/servicenow/cmdb.go b/connectors/servicenow/cmdb.go index 3eb0ba6..e69dd06 100644 --- a/connectors/servicenow/cmdb.go +++ b/connectors/servicenow/cmdb.go @@ -7,6 +7,7 @@ import ( "fmt" "net/url" + "github.com/samcharles93/archipelago/sdk/connector" connectorv1 "github.com/samcharles93/archipelago/sdk/connector/v1" ) @@ -34,16 +35,19 @@ func cmdbLookups() []*connectorv1.LookupType { Name: ownerLookup, Description: "Resolve a target to its CMDB owner, delegate and support group: server CI, then application CI, then any CI.", InputSchema: cmdbInputSchema, + Effect: connector.NoPrivilegedEffects(), }, { Name: environmentLookup, Description: "The target's environment from the CMDB, for example production.", InputSchema: cmdbInputSchema, + Effect: connector.NoPrivilegedEffects(), }, { Name: dataClassLookup, Description: "The target's data class from the CMDB.", InputSchema: cmdbInputSchema, + Effect: connector.NoPrivilegedEffects(), }, } } diff --git a/connectors/servicenow/servicenow_test.go b/connectors/servicenow/servicenow_test.go index c616022..ce573db 100644 --- a/connectors/servicenow/servicenow_test.go +++ b/connectors/servicenow/servicenow_test.go @@ -229,3 +229,13 @@ func TestDescribeDeclaresEveryArea(t *testing.T) { t.Fatalf("actions = %d, want 0: ServiceNow records, it doesn't change targets", len(d.Actions)) } } + +// TestEveryToolDeclaresItsEffects guards the chat prohibition: chat offers only +// lookups and actions that state whether they change privileges or access +// secrets. +func TestEveryToolDeclaresItsEffects(t *testing.T) { + s, _ := newTestConnector(t) + if names := connector.UndeclaredEffects(s.Describe()); len(names) > 0 { + t.Fatalf("no declared effects for %v", names) + } +} diff --git a/sdk/connector/connector.go b/sdk/connector/connector.go index 3d497ea..898734c 100644 --- a/sdk/connector/connector.go +++ b/sdk/connector/connector.go @@ -30,6 +30,30 @@ type Description struct { Deliveries []*connectorv1.DeliveryType } +// NoPrivilegedEffects declares a lookup or action that changes no privileges +// and accesses no secrets. Chat offers only tools that declare their effects, +// so a tool that never states them is unavailable there. +func NoPrivilegedEffects() *connectorv1.Effect { + return &connectorv1.Effect{EffectsDeclared: true} +} + +// UndeclaredEffects names every action and lookup in d that doesn't state +// whether it changes privileges or accesses secrets. +func UndeclaredEffects(d Description) []string { + var names []string + for _, a := range d.Actions { + if !a.GetEffect().GetEffectsDeclared() { + names = append(names, "action "+a.GetName()) + } + } + for _, l := range d.Lookups { + if !l.GetEffect().GetEffectsDeclared() { + names = append(names, "lookup "+l.GetName()) + } + } + return names +} + // Event is one typed event parsed from a verified payload. type Event struct { Type string diff --git a/sdk/connector/v1/connector.pb.go b/sdk/connector/v1/connector.pb.go index b660c0b..c1ad1ec 100644 --- a/sdk/connector/v1/connector.pb.go +++ b/sdk/connector/v1/connector.pb.go @@ -22,6 +22,70 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type SettingType int32 + +const ( + SettingType_SETTING_TYPE_UNSPECIFIED SettingType = 0 + SettingType_SETTING_TYPE_STRING SettingType = 1 + SettingType_SETTING_TYPE_NUMBER SettingType = 2 + SettingType_SETTING_TYPE_BOOLEAN SettingType = 3 + SettingType_SETTING_TYPE_DURATION SettingType = 4 + SettingType_SETTING_TYPE_LIST SettingType = 5 + SettingType_SETTING_TYPE_SELECT SettingType = 6 + SettingType_SETTING_TYPE_TEXT SettingType = 7 +) + +// Enum value maps for SettingType. +var ( + SettingType_name = map[int32]string{ + 0: "SETTING_TYPE_UNSPECIFIED", + 1: "SETTING_TYPE_STRING", + 2: "SETTING_TYPE_NUMBER", + 3: "SETTING_TYPE_BOOLEAN", + 4: "SETTING_TYPE_DURATION", + 5: "SETTING_TYPE_LIST", + 6: "SETTING_TYPE_SELECT", + 7: "SETTING_TYPE_TEXT", + } + SettingType_value = map[string]int32{ + "SETTING_TYPE_UNSPECIFIED": 0, + "SETTING_TYPE_STRING": 1, + "SETTING_TYPE_NUMBER": 2, + "SETTING_TYPE_BOOLEAN": 3, + "SETTING_TYPE_DURATION": 4, + "SETTING_TYPE_LIST": 5, + "SETTING_TYPE_SELECT": 6, + "SETTING_TYPE_TEXT": 7, + } +) + +func (x SettingType) Enum() *SettingType { + p := new(SettingType) + *p = x + return p +} + +func (x SettingType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SettingType) Descriptor() protoreflect.EnumDescriptor { + return file_connector_v1_connector_proto_enumTypes[0].Descriptor() +} + +func (SettingType) Type() protoreflect.EnumType { + return &file_connector_v1_connector_proto_enumTypes[0] +} + +func (x SettingType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SettingType.Descriptor instead. +func (SettingType) EnumDescriptor() ([]byte, []int) { + return file_connector_v1_connector_proto_rawDescGZIP(), []int{0} +} + type Reversibility int32 const ( @@ -61,11 +125,11 @@ func (x Reversibility) String() string { } func (Reversibility) Descriptor() protoreflect.EnumDescriptor { - return file_connector_v1_connector_proto_enumTypes[0].Descriptor() + return file_connector_v1_connector_proto_enumTypes[1].Descriptor() } func (Reversibility) Type() protoreflect.EnumType { - return &file_connector_v1_connector_proto_enumTypes[0] + return &file_connector_v1_connector_proto_enumTypes[1] } func (x Reversibility) Number() protoreflect.EnumNumber { @@ -74,7 +138,7 @@ func (x Reversibility) Number() protoreflect.EnumNumber { // Deprecated: Use Reversibility.Descriptor instead. func (Reversibility) EnumDescriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{0} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{1} } type ConfigureRequest struct { @@ -210,7 +274,14 @@ type DescribeResponse struct { Lookups []*LookupType `protobuf:"bytes,4,rep,name=lookups,proto3" json:"lookups,omitempty"` Deliveries []*DeliveryType `protobuf:"bytes,5,rep,name=deliveries,proto3" json:"deliveries,omitempty"` // listens says the connector serves Listen. - Listens bool `protobuf:"varint,6,opt,name=listens,proto3" json:"listens,omitempty"` + Listens bool `protobuf:"varint,6,opt,name=listens,proto3" json:"listens,omitempty"` + // target_facts says the connector serves TargetFacts. + TargetFacts bool `protobuf:"varint,7,opt,name=target_facts,json=targetFacts,proto3" json:"target_facts,omitempty"` + // settings are the values an operator enters for the connector to run, + // which the dashboard renders as a form. + Settings []*Setting `protobuf:"bytes,8,rep,name=settings,proto3" json:"settings,omitempty"` + // version is the connector's own release. + Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -287,6 +358,124 @@ func (x *DescribeResponse) GetListens() bool { return false } +func (x *DescribeResponse) GetTargetFacts() bool { + if x != nil { + return x.TargetFacts + } + return false +} + +func (x *DescribeResponse) GetSettings() []*Setting { + if x != nil { + return x.Settings + } + return nil +} + +func (x *DescribeResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// Setting is one value an operator enters for an extension to run. +type Setting struct { + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // secret says the value is a secret reference, never the secret. + Secret bool `protobuf:"varint,4,opt,name=secret,proto3" json:"secret,omitempty"` + Required bool `protobuf:"varint,5,opt,name=required,proto3" json:"required,omitempty"` + // type decides how the value is entered and checked; unspecified is a + // string. + Type SettingType `protobuf:"varint,6,opt,name=type,proto3,enum=connector.v1.SettingType" json:"type,omitempty"` + // options are the allowed values of a select setting. + Options []string `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Setting) Reset() { + *x = Setting{} + mi := &file_connector_v1_connector_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Setting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Setting) ProtoMessage() {} + +func (x *Setting) ProtoReflect() protoreflect.Message { + mi := &file_connector_v1_connector_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Setting.ProtoReflect.Descriptor instead. +func (*Setting) Descriptor() ([]byte, []int) { + return file_connector_v1_connector_proto_rawDescGZIP(), []int{4} +} + +func (x *Setting) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Setting) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *Setting) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Setting) GetSecret() bool { + if x != nil { + return x.Secret + } + return false +} + +func (x *Setting) GetRequired() bool { + if x != nil { + return x.Required + } + return false +} + +func (x *Setting) GetType() SettingType { + if x != nil { + return x.Type + } + return SettingType_SETTING_TYPE_UNSPECIFIED +} + +func (x *Setting) GetOptions() []string { + if x != nil { + return x.Options + } + return nil +} + type EventType struct { state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` @@ -299,7 +488,7 @@ type EventType struct { func (x *EventType) Reset() { *x = EventType{} - mi := &file_connector_v1_connector_proto_msgTypes[4] + mi := &file_connector_v1_connector_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -311,7 +500,7 @@ func (x *EventType) String() string { func (*EventType) ProtoMessage() {} func (x *EventType) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[4] + mi := &file_connector_v1_connector_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -324,7 +513,7 @@ func (x *EventType) ProtoReflect() protoreflect.Message { // Deprecated: Use EventType.ProtoReflect.Descriptor instead. func (*EventType) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{4} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{5} } func (x *EventType) GetName() string { @@ -366,7 +555,7 @@ type ActionType struct { func (x *ActionType) Reset() { *x = ActionType{} - mi := &file_connector_v1_connector_proto_msgTypes[5] + mi := &file_connector_v1_connector_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -378,7 +567,7 @@ func (x *ActionType) String() string { func (*ActionType) ProtoMessage() {} func (x *ActionType) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[5] + mi := &file_connector_v1_connector_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -391,7 +580,7 @@ func (x *ActionType) ProtoReflect() protoreflect.Message { // Deprecated: Use ActionType.ProtoReflect.Descriptor instead. func (*ActionType) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{5} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{6} } func (x *ActionType) GetName() string { @@ -440,7 +629,7 @@ type DeliveryType struct { func (x *DeliveryType) Reset() { *x = DeliveryType{} - mi := &file_connector_v1_connector_proto_msgTypes[6] + mi := &file_connector_v1_connector_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -452,7 +641,7 @@ func (x *DeliveryType) String() string { func (*DeliveryType) ProtoMessage() {} func (x *DeliveryType) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[6] + mi := &file_connector_v1_connector_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -465,7 +654,7 @@ func (x *DeliveryType) ProtoReflect() protoreflect.Message { // Deprecated: Use DeliveryType.ProtoReflect.Descriptor instead. func (*DeliveryType) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{6} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{7} } func (x *DeliveryType) GetName() string { @@ -490,17 +679,20 @@ func (x *DeliveryType) GetInputSchema() []byte { } type LookupType struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - InputSchema []byte `protobuf:"bytes,3,opt,name=input_schema,json=inputSchema,proto3" json:"input_schema,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + InputSchema []byte `protobuf:"bytes,3,opt,name=input_schema,json=inputSchema,proto3" json:"input_schema,omitempty"` + // effect declares the lookup's effects. Only the effects_declared, + // privilege_change and secret_access fields apply to a lookup. + Effect *Effect `protobuf:"bytes,4,opt,name=effect,proto3" json:"effect,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *LookupType) Reset() { *x = LookupType{} - mi := &file_connector_v1_connector_proto_msgTypes[7] + mi := &file_connector_v1_connector_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -512,7 +704,7 @@ func (x *LookupType) String() string { func (*LookupType) ProtoMessage() {} func (x *LookupType) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[7] + mi := &file_connector_v1_connector_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -525,7 +717,7 @@ func (x *LookupType) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupType.ProtoReflect.Descriptor instead. func (*LookupType) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{7} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{8} } func (x *LookupType) GetName() string { @@ -549,20 +741,37 @@ func (x *LookupType) GetInputSchema() []byte { return nil } +func (x *LookupType) GetEffect() *Effect { + if x != nil { + return x.Effect + } + return nil +} + type Effect struct { state protoimpl.MessageState `protogen:"open.v1"` ReadOnly bool `protobuf:"varint,1,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` Reversibility Reversibility `protobuf:"varint,2,opt,name=reversibility,proto3,enum=connector.v1.Reversibility" json:"reversibility,omitempty"` // summary says in plain words what the action does, for example "delete // files older than 24h under /tmp/runner". - Summary string `protobuf:"bytes,3,opt,name=summary,proto3" json:"summary,omitempty"` + Summary string `protobuf:"bytes,3,opt,name=summary,proto3" json:"summary,omitempty"` + // effects_declared says the connector stated this action's privilege_change + // and secret_access explicitly. With it false the two flags mean nothing: an + // action that never stated its effects is prohibited in chat, which is not + // the same as an action that stated it has none. + EffectsDeclared bool `protobuf:"varint,4,opt,name=effects_declared,json=effectsDeclared,proto3" json:"effects_declared,omitempty"` + // privilege_change says the action changes who may do what: it grants + // roles, changes identities or policies, or changes control-plane settings. + PrivilegeChange bool `protobuf:"varint,5,opt,name=privilege_change,json=privilegeChange,proto3" json:"privilege_change,omitempty"` + // secret_access says the action reads, exports or reveals a secret. + SecretAccess bool `protobuf:"varint,6,opt,name=secret_access,json=secretAccess,proto3" json:"secret_access,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Effect) Reset() { *x = Effect{} - mi := &file_connector_v1_connector_proto_msgTypes[8] + mi := &file_connector_v1_connector_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -574,7 +783,7 @@ func (x *Effect) String() string { func (*Effect) ProtoMessage() {} func (x *Effect) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[8] + mi := &file_connector_v1_connector_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -587,7 +796,7 @@ func (x *Effect) ProtoReflect() protoreflect.Message { // Deprecated: Use Effect.ProtoReflect.Descriptor instead. func (*Effect) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{8} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{9} } func (x *Effect) GetReadOnly() bool { @@ -611,6 +820,27 @@ func (x *Effect) GetSummary() string { return "" } +func (x *Effect) GetEffectsDeclared() bool { + if x != nil { + return x.EffectsDeclared + } + return false +} + +func (x *Effect) GetPrivilegeChange() bool { + if x != nil { + return x.PrivilegeChange + } + return false +} + +func (x *Effect) GetSecretAccess() bool { + if x != nil { + return x.SecretAccess + } + return false +} + // Target is what an action acts on. Connector, action, kind and environment // together are the action class. type Target struct { @@ -625,7 +855,7 @@ type Target struct { func (x *Target) Reset() { *x = Target{} - mi := &file_connector_v1_connector_proto_msgTypes[9] + mi := &file_connector_v1_connector_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -637,7 +867,7 @@ func (x *Target) String() string { func (*Target) ProtoMessage() {} func (x *Target) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[9] + mi := &file_connector_v1_connector_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -650,7 +880,7 @@ func (x *Target) ProtoReflect() protoreflect.Message { // Deprecated: Use Target.ProtoReflect.Descriptor instead. func (*Target) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{9} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{10} } func (x *Target) GetKind() string { @@ -691,7 +921,7 @@ type ParseRequest struct { func (x *ParseRequest) Reset() { *x = ParseRequest{} - mi := &file_connector_v1_connector_proto_msgTypes[10] + mi := &file_connector_v1_connector_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -703,7 +933,7 @@ func (x *ParseRequest) String() string { func (*ParseRequest) ProtoMessage() {} func (x *ParseRequest) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[10] + mi := &file_connector_v1_connector_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -716,7 +946,7 @@ func (x *ParseRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseRequest.ProtoReflect.Descriptor instead. func (*ParseRequest) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{10} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{11} } func (x *ParseRequest) GetBody() []byte { @@ -742,7 +972,7 @@ type ParseResponse struct { func (x *ParseResponse) Reset() { *x = ParseResponse{} - mi := &file_connector_v1_connector_proto_msgTypes[11] + mi := &file_connector_v1_connector_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -754,7 +984,7 @@ func (x *ParseResponse) String() string { func (*ParseResponse) ProtoMessage() {} func (x *ParseResponse) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[11] + mi := &file_connector_v1_connector_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -767,7 +997,7 @@ func (x *ParseResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseResponse.ProtoReflect.Descriptor instead. func (*ParseResponse) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{11} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{12} } func (x *ParseResponse) GetEvents() []*Event { @@ -794,7 +1024,7 @@ type Event struct { func (x *Event) Reset() { *x = Event{} - mi := &file_connector_v1_connector_proto_msgTypes[12] + mi := &file_connector_v1_connector_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -806,7 +1036,7 @@ func (x *Event) String() string { func (*Event) ProtoMessage() {} func (x *Event) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[12] + mi := &file_connector_v1_connector_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -819,7 +1049,7 @@ func (x *Event) ProtoReflect() protoreflect.Message { // Deprecated: Use Event.ProtoReflect.Descriptor instead. func (*Event) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{12} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{13} } func (x *Event) GetType() string { @@ -867,7 +1097,7 @@ type ResolveRequest struct { func (x *ResolveRequest) Reset() { *x = ResolveRequest{} - mi := &file_connector_v1_connector_proto_msgTypes[13] + mi := &file_connector_v1_connector_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -879,7 +1109,7 @@ func (x *ResolveRequest) String() string { func (*ResolveRequest) ProtoMessage() {} func (x *ResolveRequest) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[13] + mi := &file_connector_v1_connector_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -892,7 +1122,7 @@ func (x *ResolveRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveRequest.ProtoReflect.Descriptor instead. func (*ResolveRequest) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{13} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{14} } func (x *ResolveRequest) GetAction() string { @@ -919,7 +1149,7 @@ type ResolveResponse struct { func (x *ResolveResponse) Reset() { *x = ResolveResponse{} - mi := &file_connector_v1_connector_proto_msgTypes[14] + mi := &file_connector_v1_connector_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -931,7 +1161,7 @@ func (x *ResolveResponse) String() string { func (*ResolveResponse) ProtoMessage() {} func (x *ResolveResponse) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[14] + mi := &file_connector_v1_connector_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -944,7 +1174,7 @@ func (x *ResolveResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveResponse.ProtoReflect.Descriptor instead. func (*ResolveResponse) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{14} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{15} } func (x *ResolveResponse) GetTarget() *Target { @@ -974,7 +1204,7 @@ type InvokeRequest struct { func (x *InvokeRequest) Reset() { *x = InvokeRequest{} - mi := &file_connector_v1_connector_proto_msgTypes[15] + mi := &file_connector_v1_connector_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -986,7 +1216,7 @@ func (x *InvokeRequest) String() string { func (*InvokeRequest) ProtoMessage() {} func (x *InvokeRequest) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[15] + mi := &file_connector_v1_connector_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -999,7 +1229,7 @@ func (x *InvokeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InvokeRequest.ProtoReflect.Descriptor instead. func (*InvokeRequest) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{15} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{16} } func (x *InvokeRequest) GetAction() string { @@ -1044,7 +1274,7 @@ type InvokeResponse struct { func (x *InvokeResponse) Reset() { *x = InvokeResponse{} - mi := &file_connector_v1_connector_proto_msgTypes[16] + mi := &file_connector_v1_connector_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1056,7 +1286,7 @@ func (x *InvokeResponse) String() string { func (*InvokeResponse) ProtoMessage() {} func (x *InvokeResponse) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[16] + mi := &file_connector_v1_connector_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1069,7 +1299,7 @@ func (x *InvokeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InvokeResponse.ProtoReflect.Descriptor instead. func (*InvokeResponse) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{16} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{17} } func (x *InvokeResponse) GetOutput() []byte { @@ -1103,7 +1333,7 @@ type LookupRequest struct { func (x *LookupRequest) Reset() { *x = LookupRequest{} - mi := &file_connector_v1_connector_proto_msgTypes[17] + mi := &file_connector_v1_connector_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1115,7 +1345,7 @@ func (x *LookupRequest) String() string { func (*LookupRequest) ProtoMessage() {} func (x *LookupRequest) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[17] + mi := &file_connector_v1_connector_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1128,7 +1358,7 @@ func (x *LookupRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupRequest.ProtoReflect.Descriptor instead. func (*LookupRequest) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{17} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{18} } func (x *LookupRequest) GetLookup() string { @@ -1155,7 +1385,7 @@ type LookupResponse struct { func (x *LookupResponse) Reset() { *x = LookupResponse{} - mi := &file_connector_v1_connector_proto_msgTypes[18] + mi := &file_connector_v1_connector_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1167,7 +1397,7 @@ func (x *LookupResponse) String() string { func (*LookupResponse) ProtoMessage() {} func (x *LookupResponse) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[18] + mi := &file_connector_v1_connector_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1180,7 +1410,7 @@ func (x *LookupResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupResponse.ProtoReflect.Descriptor instead. func (*LookupResponse) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{18} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{19} } func (x *LookupResponse) GetOutput() []byte { @@ -1208,7 +1438,7 @@ type DeliverRequest struct { func (x *DeliverRequest) Reset() { *x = DeliverRequest{} - mi := &file_connector_v1_connector_proto_msgTypes[19] + mi := &file_connector_v1_connector_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1220,7 +1450,7 @@ func (x *DeliverRequest) String() string { func (*DeliverRequest) ProtoMessage() {} func (x *DeliverRequest) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[19] + mi := &file_connector_v1_connector_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1233,7 +1463,7 @@ func (x *DeliverRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeliverRequest.ProtoReflect.Descriptor instead. func (*DeliverRequest) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{19} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{20} } func (x *DeliverRequest) GetDelivery() string { @@ -1267,7 +1497,7 @@ type DeliverResponse struct { func (x *DeliverResponse) Reset() { *x = DeliverResponse{} - mi := &file_connector_v1_connector_proto_msgTypes[20] + mi := &file_connector_v1_connector_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1279,7 +1509,7 @@ func (x *DeliverResponse) String() string { func (*DeliverResponse) ProtoMessage() {} func (x *DeliverResponse) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[20] + mi := &file_connector_v1_connector_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1292,7 +1522,7 @@ func (x *DeliverResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeliverResponse.ProtoReflect.Descriptor instead. func (*DeliverResponse) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{20} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{21} } func (x *DeliverResponse) GetExternalId() string { @@ -1302,6 +1532,123 @@ func (x *DeliverResponse) GetExternalId() string { return "" } +type TargetFactsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TargetFactsRequest) Reset() { + *x = TargetFactsRequest{} + mi := &file_connector_v1_connector_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TargetFactsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetFactsRequest) ProtoMessage() {} + +func (x *TargetFactsRequest) ProtoReflect() protoreflect.Message { + mi := &file_connector_v1_connector_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 TargetFactsRequest.ProtoReflect.Descriptor instead. +func (*TargetFactsRequest) Descriptor() ([]byte, []int) { + return file_connector_v1_connector_proto_rawDescGZIP(), []int{22} +} + +func (x *TargetFactsRequest) GetTarget() *Target { + if x != nil { + return x.Target + } + return nil +} + +type TargetFactsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // found is false when the connector has no record of the target. + Found bool `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"` + // owner_identity is who answers for the target, as an identity on a channel + // or system, such as "servicenow:jdoe" or "email:jo@example.com". + OwnerIdentity string `protobuf:"bytes,2,opt,name=owner_identity,json=ownerIdentity,proto3" json:"owner_identity,omitempty"` + // data_class names what the target holds, such as "customer" or "temp". + DataClass string `protobuf:"bytes,3,opt,name=data_class,json=dataClass,proto3" json:"data_class,omitempty"` + // count is how many things the target stands for, zero when unknown. + Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TargetFactsResponse) Reset() { + *x = TargetFactsResponse{} + mi := &file_connector_v1_connector_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TargetFactsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetFactsResponse) ProtoMessage() {} + +func (x *TargetFactsResponse) ProtoReflect() protoreflect.Message { + mi := &file_connector_v1_connector_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 TargetFactsResponse.ProtoReflect.Descriptor instead. +func (*TargetFactsResponse) Descriptor() ([]byte, []int) { + return file_connector_v1_connector_proto_rawDescGZIP(), []int{23} +} + +func (x *TargetFactsResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +func (x *TargetFactsResponse) GetOwnerIdentity() string { + if x != nil { + return x.OwnerIdentity + } + return "" +} + +func (x *TargetFactsResponse) GetDataClass() string { + if x != nil { + return x.DataClass + } + return "" +} + +func (x *TargetFactsResponse) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + type ListenRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // cursor is the last cursor the host stored, empty from the start. @@ -1312,7 +1659,7 @@ type ListenRequest struct { func (x *ListenRequest) Reset() { *x = ListenRequest{} - mi := &file_connector_v1_connector_proto_msgTypes[21] + mi := &file_connector_v1_connector_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1324,7 +1671,7 @@ func (x *ListenRequest) String() string { func (*ListenRequest) ProtoMessage() {} func (x *ListenRequest) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[21] + mi := &file_connector_v1_connector_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1337,7 +1684,7 @@ func (x *ListenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListenRequest.ProtoReflect.Descriptor instead. func (*ListenRequest) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{21} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{24} } func (x *ListenRequest) GetCursor() string { @@ -1357,7 +1704,7 @@ type ListenResponse struct { func (x *ListenResponse) Reset() { *x = ListenResponse{} - mi := &file_connector_v1_connector_proto_msgTypes[22] + mi := &file_connector_v1_connector_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1369,7 +1716,7 @@ func (x *ListenResponse) String() string { func (*ListenResponse) ProtoMessage() {} func (x *ListenResponse) ProtoReflect() protoreflect.Message { - mi := &file_connector_v1_connector_proto_msgTypes[22] + mi := &file_connector_v1_connector_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1382,7 +1729,7 @@ func (x *ListenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListenResponse.ProtoReflect.Descriptor instead. func (*ListenResponse) Descriptor() ([]byte, []int) { - return file_connector_v1_connector_proto_rawDescGZIP(), []int{22} + return file_connector_v1_connector_proto_rawDescGZIP(), []int{25} } func (x *ListenResponse) GetEvents() []*Event { @@ -1414,7 +1761,7 @@ const file_connector_v1_connector_proto_rawDesc = "" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x13\n" + "\x11ConfigureResponse\"\x11\n" + - "\x0fDescribeRequest\"\x9d\x02\n" + + "\x0fDescribeRequest\"\x8d\x03\n" + "\x10DescribeResponse\x12\x1a\n" + "\bcontract\x18\x01 \x01(\tR\bcontract\x12/\n" + "\x06events\x18\x02 \x03(\v2\x17.connector.v1.EventTypeR\x06events\x122\n" + @@ -1423,7 +1770,18 @@ const file_connector_v1_connector_proto_rawDesc = "" + "\n" + "deliveries\x18\x05 \x03(\v2\x1a.connector.v1.DeliveryTypeR\n" + "deliveries\x12\x18\n" + - "\alistens\x18\x06 \x01(\bR\alistens\"Y\n" + + "\alistens\x18\x06 \x01(\bR\alistens\x12!\n" + + "\ftarget_facts\x18\a \x01(\bR\vtargetFacts\x121\n" + + "\bsettings\x18\b \x03(\v2\x15.connector.v1.SettingR\bsettings\x12\x18\n" + + "\aversion\x18\t \x01(\tR\aversion\"\xd0\x01\n" + + "\aSetting\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05label\x18\x02 \x01(\tR\x05label\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x16\n" + + "\x06secret\x18\x04 \x01(\bR\x06secret\x12\x1a\n" + + "\brequired\x18\x05 \x01(\bR\brequired\x12-\n" + + "\x04type\x18\x06 \x01(\x0e2\x19.connector.v1.SettingTypeR\x04type\x12\x18\n" + + "\aoptions\x18\a \x03(\tR\aoptions\"Y\n" + "\tEventType\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" + @@ -1440,16 +1798,20 @@ const file_connector_v1_connector_proto_rawDesc = "" + "\fDeliveryType\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + "\vdescription\x18\x02 \x01(\tR\vdescription\x12!\n" + - "\finput_schema\x18\x03 \x01(\fR\vinputSchema\"e\n" + + "\finput_schema\x18\x03 \x01(\fR\vinputSchema\"\x93\x01\n" + "\n" + "LookupType\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + "\vdescription\x18\x02 \x01(\tR\vdescription\x12!\n" + - "\finput_schema\x18\x03 \x01(\fR\vinputSchema\"\x82\x01\n" + + "\finput_schema\x18\x03 \x01(\fR\vinputSchema\x12,\n" + + "\x06effect\x18\x04 \x01(\v2\x14.connector.v1.EffectR\x06effect\"\xfd\x01\n" + "\x06Effect\x12\x1b\n" + "\tread_only\x18\x01 \x01(\bR\breadOnly\x12A\n" + "\rreversibility\x18\x02 \x01(\x0e2\x1b.connector.v1.ReversibilityR\rreversibility\x12\x18\n" + - "\asummary\x18\x03 \x01(\tR\asummary\"n\n" + + "\asummary\x18\x03 \x01(\tR\asummary\x12)\n" + + "\x10effects_declared\x18\x04 \x01(\bR\x0feffectsDeclared\x12)\n" + + "\x10privilege_change\x18\x05 \x01(\bR\x0fprivilegeChange\x12#\n" + + "\rsecret_access\x18\x06 \x01(\bR\fsecretAccess\"n\n" + "\x06Target\x12\x12\n" + "\x04kind\x18\x01 \x01(\tR\x04kind\x12\x0e\n" + "\x02id\x18\x02 \x01(\tR\x02id\x12 \n" + @@ -1499,17 +1861,34 @@ const file_connector_v1_connector_proto_rawDesc = "" + "\x0fidempotency_key\x18\x03 \x01(\tR\x0eidempotencyKey\"2\n" + "\x0fDeliverResponse\x12\x1f\n" + "\vexternal_id\x18\x01 \x01(\tR\n" + - "externalId\"'\n" + + "externalId\"B\n" + + "\x12TargetFactsRequest\x12,\n" + + "\x06target\x18\x01 \x01(\v2\x14.connector.v1.TargetR\x06target\"\x87\x01\n" + + "\x13TargetFactsResponse\x12\x14\n" + + "\x05found\x18\x01 \x01(\bR\x05found\x12%\n" + + "\x0eowner_identity\x18\x02 \x01(\tR\rownerIdentity\x12\x1d\n" + + "\n" + + "data_class\x18\x03 \x01(\tR\tdataClass\x12\x14\n" + + "\x05count\x18\x04 \x01(\x05R\x05count\"'\n" + "\rListenRequest\x12\x16\n" + "\x06cursor\x18\x01 \x01(\tR\x06cursor\"U\n" + "\x0eListenResponse\x12+\n" + "\x06events\x18\x01 \x03(\v2\x13.connector.v1.EventR\x06events\x12\x16\n" + - "\x06cursor\x18\x02 \x01(\tR\x06cursor*\x95\x01\n" + + "\x06cursor\x18\x02 \x01(\tR\x06cursor*\xd9\x01\n" + + "\vSettingType\x12\x1c\n" + + "\x18SETTING_TYPE_UNSPECIFIED\x10\x00\x12\x17\n" + + "\x13SETTING_TYPE_STRING\x10\x01\x12\x17\n" + + "\x13SETTING_TYPE_NUMBER\x10\x02\x12\x18\n" + + "\x14SETTING_TYPE_BOOLEAN\x10\x03\x12\x19\n" + + "\x15SETTING_TYPE_DURATION\x10\x04\x12\x15\n" + + "\x11SETTING_TYPE_LIST\x10\x05\x12\x17\n" + + "\x13SETTING_TYPE_SELECT\x10\x06\x12\x15\n" + + "\x11SETTING_TYPE_TEXT\x10\a*\x95\x01\n" + "\rReversibility\x12\x1d\n" + "\x19REVERSIBILITY_UNSPECIFIED\x10\x00\x12&\n" + "\"REVERSIBILITY_UNDONE_AUTOMATICALLY\x10\x01\x12\x1d\n" + "\x19REVERSIBILITY_RECOVERABLE\x10\x02\x12\x1e\n" + - "\x1aREVERSIBILITY_IRREVERSIBLE\x10\x032\xce\x04\n" + + "\x1aREVERSIBILITY_IRREVERSIBLE\x10\x032\xa2\x05\n" + "\x10ConnectorService\x12L\n" + "\tConfigure\x12\x1e.connector.v1.ConfigureRequest\x1a\x1f.connector.v1.ConfigureResponse\x12I\n" + "\bDescribe\x12\x1d.connector.v1.DescribeRequest\x1a\x1e.connector.v1.DescribeResponse\x12@\n" + @@ -1518,7 +1897,8 @@ const file_connector_v1_connector_proto_rawDesc = "" + "\x06Invoke\x12\x1b.connector.v1.InvokeRequest\x1a\x1c.connector.v1.InvokeResponse\x12C\n" + "\x06Lookup\x12\x1b.connector.v1.LookupRequest\x1a\x1c.connector.v1.LookupResponse\x12F\n" + "\aDeliver\x12\x1c.connector.v1.DeliverRequest\x1a\x1d.connector.v1.DeliverResponse\x12E\n" + - "\x06Listen\x12\x1b.connector.v1.ListenRequest\x1a\x1c.connector.v1.ListenResponse0\x01B\xb5\x01\n" + + "\x06Listen\x12\x1b.connector.v1.ListenRequest\x1a\x1c.connector.v1.ListenResponse0\x01\x12R\n" + + "\vTargetFacts\x12 .connector.v1.TargetFactsRequest\x1a!.connector.v1.TargetFactsResponseB\xb5\x01\n" + "\x10com.connector.v1B\x0eConnectorProtoP\x01Z@github.com/samcharles93/archipelago/sdk/connector/v1;connectorv1\xa2\x02\x03CXX\xaa\x02\fConnector.V1\xca\x02\fConnector\\V1\xe2\x02\x18Connector\\V1\\GPBMetadata\xea\x02\rConnector::V1b\x06proto3" var ( @@ -1533,74 +1913,84 @@ func file_connector_v1_connector_proto_rawDescGZIP() []byte { return file_connector_v1_connector_proto_rawDescData } -var file_connector_v1_connector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_connector_v1_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_connector_v1_connector_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_connector_v1_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_connector_v1_connector_proto_goTypes = []any{ - (Reversibility)(0), // 0: connector.v1.Reversibility - (*ConfigureRequest)(nil), // 1: connector.v1.ConfigureRequest - (*ConfigureResponse)(nil), // 2: connector.v1.ConfigureResponse - (*DescribeRequest)(nil), // 3: connector.v1.DescribeRequest - (*DescribeResponse)(nil), // 4: connector.v1.DescribeResponse - (*EventType)(nil), // 5: connector.v1.EventType - (*ActionType)(nil), // 6: connector.v1.ActionType - (*DeliveryType)(nil), // 7: connector.v1.DeliveryType - (*LookupType)(nil), // 8: connector.v1.LookupType - (*Effect)(nil), // 9: connector.v1.Effect - (*Target)(nil), // 10: connector.v1.Target - (*ParseRequest)(nil), // 11: connector.v1.ParseRequest - (*ParseResponse)(nil), // 12: connector.v1.ParseResponse - (*Event)(nil), // 13: connector.v1.Event - (*ResolveRequest)(nil), // 14: connector.v1.ResolveRequest - (*ResolveResponse)(nil), // 15: connector.v1.ResolveResponse - (*InvokeRequest)(nil), // 16: connector.v1.InvokeRequest - (*InvokeResponse)(nil), // 17: connector.v1.InvokeResponse - (*LookupRequest)(nil), // 18: connector.v1.LookupRequest - (*LookupResponse)(nil), // 19: connector.v1.LookupResponse - (*DeliverRequest)(nil), // 20: connector.v1.DeliverRequest - (*DeliverResponse)(nil), // 21: connector.v1.DeliverResponse - (*ListenRequest)(nil), // 22: connector.v1.ListenRequest - (*ListenResponse)(nil), // 23: connector.v1.ListenResponse - nil, // 24: connector.v1.ConfigureRequest.SettingsEntry - nil, // 25: connector.v1.ConfigureRequest.SecretsEntry - nil, // 26: connector.v1.ParseRequest.HeadersEntry - (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (SettingType)(0), // 0: connector.v1.SettingType + (Reversibility)(0), // 1: connector.v1.Reversibility + (*ConfigureRequest)(nil), // 2: connector.v1.ConfigureRequest + (*ConfigureResponse)(nil), // 3: connector.v1.ConfigureResponse + (*DescribeRequest)(nil), // 4: connector.v1.DescribeRequest + (*DescribeResponse)(nil), // 5: connector.v1.DescribeResponse + (*Setting)(nil), // 6: connector.v1.Setting + (*EventType)(nil), // 7: connector.v1.EventType + (*ActionType)(nil), // 8: connector.v1.ActionType + (*DeliveryType)(nil), // 9: connector.v1.DeliveryType + (*LookupType)(nil), // 10: connector.v1.LookupType + (*Effect)(nil), // 11: connector.v1.Effect + (*Target)(nil), // 12: connector.v1.Target + (*ParseRequest)(nil), // 13: connector.v1.ParseRequest + (*ParseResponse)(nil), // 14: connector.v1.ParseResponse + (*Event)(nil), // 15: connector.v1.Event + (*ResolveRequest)(nil), // 16: connector.v1.ResolveRequest + (*ResolveResponse)(nil), // 17: connector.v1.ResolveResponse + (*InvokeRequest)(nil), // 18: connector.v1.InvokeRequest + (*InvokeResponse)(nil), // 19: connector.v1.InvokeResponse + (*LookupRequest)(nil), // 20: connector.v1.LookupRequest + (*LookupResponse)(nil), // 21: connector.v1.LookupResponse + (*DeliverRequest)(nil), // 22: connector.v1.DeliverRequest + (*DeliverResponse)(nil), // 23: connector.v1.DeliverResponse + (*TargetFactsRequest)(nil), // 24: connector.v1.TargetFactsRequest + (*TargetFactsResponse)(nil), // 25: connector.v1.TargetFactsResponse + (*ListenRequest)(nil), // 26: connector.v1.ListenRequest + (*ListenResponse)(nil), // 27: connector.v1.ListenResponse + nil, // 28: connector.v1.ConfigureRequest.SettingsEntry + nil, // 29: connector.v1.ConfigureRequest.SecretsEntry + nil, // 30: connector.v1.ParseRequest.HeadersEntry + (*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp } var file_connector_v1_connector_proto_depIdxs = []int32{ - 24, // 0: connector.v1.ConfigureRequest.settings:type_name -> connector.v1.ConfigureRequest.SettingsEntry - 25, // 1: connector.v1.ConfigureRequest.secrets:type_name -> connector.v1.ConfigureRequest.SecretsEntry - 5, // 2: connector.v1.DescribeResponse.events:type_name -> connector.v1.EventType - 6, // 3: connector.v1.DescribeResponse.actions:type_name -> connector.v1.ActionType - 8, // 4: connector.v1.DescribeResponse.lookups:type_name -> connector.v1.LookupType - 7, // 5: connector.v1.DescribeResponse.deliveries:type_name -> connector.v1.DeliveryType - 9, // 6: connector.v1.ActionType.effect:type_name -> connector.v1.Effect - 0, // 7: connector.v1.Effect.reversibility:type_name -> connector.v1.Reversibility - 26, // 8: connector.v1.ParseRequest.headers:type_name -> connector.v1.ParseRequest.HeadersEntry - 13, // 9: connector.v1.ParseResponse.events:type_name -> connector.v1.Event - 27, // 10: connector.v1.Event.occurred_at:type_name -> google.protobuf.Timestamp - 10, // 11: connector.v1.ResolveResponse.target:type_name -> connector.v1.Target - 9, // 12: connector.v1.ResolveResponse.effect:type_name -> connector.v1.Effect - 13, // 13: connector.v1.ListenResponse.events:type_name -> connector.v1.Event - 1, // 14: connector.v1.ConnectorService.Configure:input_type -> connector.v1.ConfigureRequest - 3, // 15: connector.v1.ConnectorService.Describe:input_type -> connector.v1.DescribeRequest - 11, // 16: connector.v1.ConnectorService.Parse:input_type -> connector.v1.ParseRequest - 14, // 17: connector.v1.ConnectorService.Resolve:input_type -> connector.v1.ResolveRequest - 16, // 18: connector.v1.ConnectorService.Invoke:input_type -> connector.v1.InvokeRequest - 18, // 19: connector.v1.ConnectorService.Lookup:input_type -> connector.v1.LookupRequest - 20, // 20: connector.v1.ConnectorService.Deliver:input_type -> connector.v1.DeliverRequest - 22, // 21: connector.v1.ConnectorService.Listen:input_type -> connector.v1.ListenRequest - 2, // 22: connector.v1.ConnectorService.Configure:output_type -> connector.v1.ConfigureResponse - 4, // 23: connector.v1.ConnectorService.Describe:output_type -> connector.v1.DescribeResponse - 12, // 24: connector.v1.ConnectorService.Parse:output_type -> connector.v1.ParseResponse - 15, // 25: connector.v1.ConnectorService.Resolve:output_type -> connector.v1.ResolveResponse - 17, // 26: connector.v1.ConnectorService.Invoke:output_type -> connector.v1.InvokeResponse - 19, // 27: connector.v1.ConnectorService.Lookup:output_type -> connector.v1.LookupResponse - 21, // 28: connector.v1.ConnectorService.Deliver:output_type -> connector.v1.DeliverResponse - 23, // 29: connector.v1.ConnectorService.Listen:output_type -> connector.v1.ListenResponse - 22, // [22:30] is the sub-list for method output_type - 14, // [14:22] 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 + 28, // 0: connector.v1.ConfigureRequest.settings:type_name -> connector.v1.ConfigureRequest.SettingsEntry + 29, // 1: connector.v1.ConfigureRequest.secrets:type_name -> connector.v1.ConfigureRequest.SecretsEntry + 7, // 2: connector.v1.DescribeResponse.events:type_name -> connector.v1.EventType + 8, // 3: connector.v1.DescribeResponse.actions:type_name -> connector.v1.ActionType + 10, // 4: connector.v1.DescribeResponse.lookups:type_name -> connector.v1.LookupType + 9, // 5: connector.v1.DescribeResponse.deliveries:type_name -> connector.v1.DeliveryType + 6, // 6: connector.v1.DescribeResponse.settings:type_name -> connector.v1.Setting + 0, // 7: connector.v1.Setting.type:type_name -> connector.v1.SettingType + 11, // 8: connector.v1.ActionType.effect:type_name -> connector.v1.Effect + 11, // 9: connector.v1.LookupType.effect:type_name -> connector.v1.Effect + 1, // 10: connector.v1.Effect.reversibility:type_name -> connector.v1.Reversibility + 30, // 11: connector.v1.ParseRequest.headers:type_name -> connector.v1.ParseRequest.HeadersEntry + 15, // 12: connector.v1.ParseResponse.events:type_name -> connector.v1.Event + 31, // 13: connector.v1.Event.occurred_at:type_name -> google.protobuf.Timestamp + 12, // 14: connector.v1.ResolveResponse.target:type_name -> connector.v1.Target + 11, // 15: connector.v1.ResolveResponse.effect:type_name -> connector.v1.Effect + 12, // 16: connector.v1.TargetFactsRequest.target:type_name -> connector.v1.Target + 15, // 17: connector.v1.ListenResponse.events:type_name -> connector.v1.Event + 2, // 18: connector.v1.ConnectorService.Configure:input_type -> connector.v1.ConfigureRequest + 4, // 19: connector.v1.ConnectorService.Describe:input_type -> connector.v1.DescribeRequest + 13, // 20: connector.v1.ConnectorService.Parse:input_type -> connector.v1.ParseRequest + 16, // 21: connector.v1.ConnectorService.Resolve:input_type -> connector.v1.ResolveRequest + 18, // 22: connector.v1.ConnectorService.Invoke:input_type -> connector.v1.InvokeRequest + 20, // 23: connector.v1.ConnectorService.Lookup:input_type -> connector.v1.LookupRequest + 22, // 24: connector.v1.ConnectorService.Deliver:input_type -> connector.v1.DeliverRequest + 26, // 25: connector.v1.ConnectorService.Listen:input_type -> connector.v1.ListenRequest + 24, // 26: connector.v1.ConnectorService.TargetFacts:input_type -> connector.v1.TargetFactsRequest + 3, // 27: connector.v1.ConnectorService.Configure:output_type -> connector.v1.ConfigureResponse + 5, // 28: connector.v1.ConnectorService.Describe:output_type -> connector.v1.DescribeResponse + 14, // 29: connector.v1.ConnectorService.Parse:output_type -> connector.v1.ParseResponse + 17, // 30: connector.v1.ConnectorService.Resolve:output_type -> connector.v1.ResolveResponse + 19, // 31: connector.v1.ConnectorService.Invoke:output_type -> connector.v1.InvokeResponse + 21, // 32: connector.v1.ConnectorService.Lookup:output_type -> connector.v1.LookupResponse + 23, // 33: connector.v1.ConnectorService.Deliver:output_type -> connector.v1.DeliverResponse + 27, // 34: connector.v1.ConnectorService.Listen:output_type -> connector.v1.ListenResponse + 25, // 35: connector.v1.ConnectorService.TargetFacts:output_type -> connector.v1.TargetFactsResponse + 27, // [27:36] is the sub-list for method output_type + 18, // [18:27] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_connector_v1_connector_proto_init() } @@ -1613,8 +2003,8 @@ func file_connector_v1_connector_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_connector_v1_connector_proto_rawDesc), len(file_connector_v1_connector_proto_rawDesc)), - NumEnums: 1, - NumMessages: 26, + NumEnums: 2, + NumMessages: 29, NumExtensions: 0, NumServices: 1, }, diff --git a/sdk/connector/v1/connector_grpc.pb.go b/sdk/connector/v1/connector_grpc.pb.go index fc347be..84a3a3e 100644 --- a/sdk/connector/v1/connector_grpc.pb.go +++ b/sdk/connector/v1/connector_grpc.pb.go @@ -19,14 +19,15 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - ConnectorService_Configure_FullMethodName = "/connector.v1.ConnectorService/Configure" - ConnectorService_Describe_FullMethodName = "/connector.v1.ConnectorService/Describe" - ConnectorService_Parse_FullMethodName = "/connector.v1.ConnectorService/Parse" - ConnectorService_Resolve_FullMethodName = "/connector.v1.ConnectorService/Resolve" - ConnectorService_Invoke_FullMethodName = "/connector.v1.ConnectorService/Invoke" - ConnectorService_Lookup_FullMethodName = "/connector.v1.ConnectorService/Lookup" - ConnectorService_Deliver_FullMethodName = "/connector.v1.ConnectorService/Deliver" - ConnectorService_Listen_FullMethodName = "/connector.v1.ConnectorService/Listen" + ConnectorService_Configure_FullMethodName = "/connector.v1.ConnectorService/Configure" + ConnectorService_Describe_FullMethodName = "/connector.v1.ConnectorService/Describe" + ConnectorService_Parse_FullMethodName = "/connector.v1.ConnectorService/Parse" + ConnectorService_Resolve_FullMethodName = "/connector.v1.ConnectorService/Resolve" + ConnectorService_Invoke_FullMethodName = "/connector.v1.ConnectorService/Invoke" + ConnectorService_Lookup_FullMethodName = "/connector.v1.ConnectorService/Lookup" + ConnectorService_Deliver_FullMethodName = "/connector.v1.ConnectorService/Deliver" + ConnectorService_Listen_FullMethodName = "/connector.v1.ConnectorService/Listen" + ConnectorService_TargetFacts_FullMethodName = "/connector.v1.ConnectorService/TargetFacts" ) // ConnectorServiceClient is the client API for ConnectorService service. @@ -59,12 +60,20 @@ type ConnectorServiceClient interface { // delivery is never offered to an agent: hard rules apply to it, guards // don't. The host retries a failed delivery, so a connector should make a // repeat with the same idempotency key harmless where its service allows. + // A connector returns InvalidArgument, FailedPrecondition, PermissionDenied + // or NotFound when the service rejects the delivery permanently: the host + // records the reason and stops retrying. Any other status is retried. Deliver(ctx context.Context, in *DeliverRequest, opts ...grpc.CallOption) (*DeliverResponse, error) // Listen streams the events of a source the connector holds its own // connection to, such as a chat long poll, from cursor on. Each response // carries the cursor to resume after its events, which the host keeps only // once those events are stored. Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenResponse], error) + // TargetFacts answers what the connector's system of record knows about a + // target, such as who owns it, at the moment an action on it is judged. The + // host asks only connectors that declare target_facts, and never stores the + // answer. + TargetFacts(ctx context.Context, in *TargetFactsRequest, opts ...grpc.CallOption) (*TargetFactsResponse, error) } type connectorServiceClient struct { @@ -164,6 +173,16 @@ func (c *connectorServiceClient) Listen(ctx context.Context, in *ListenRequest, // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type ConnectorService_ListenClient = grpc.ServerStreamingClient[ListenResponse] +func (c *connectorServiceClient) TargetFacts(ctx context.Context, in *TargetFactsRequest, opts ...grpc.CallOption) (*TargetFactsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TargetFactsResponse) + err := c.cc.Invoke(ctx, ConnectorService_TargetFacts_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // ConnectorServiceServer is the server API for ConnectorService service. // All implementations must embed UnimplementedConnectorServiceServer // for forward compatibility. @@ -194,12 +213,20 @@ type ConnectorServiceServer interface { // delivery is never offered to an agent: hard rules apply to it, guards // don't. The host retries a failed delivery, so a connector should make a // repeat with the same idempotency key harmless where its service allows. + // A connector returns InvalidArgument, FailedPrecondition, PermissionDenied + // or NotFound when the service rejects the delivery permanently: the host + // records the reason and stops retrying. Any other status is retried. Deliver(context.Context, *DeliverRequest) (*DeliverResponse, error) // Listen streams the events of a source the connector holds its own // connection to, such as a chat long poll, from cursor on. Each response // carries the cursor to resume after its events, which the host keeps only // once those events are stored. Listen(*ListenRequest, grpc.ServerStreamingServer[ListenResponse]) error + // TargetFacts answers what the connector's system of record knows about a + // target, such as who owns it, at the moment an action on it is judged. The + // host asks only connectors that declare target_facts, and never stores the + // answer. + TargetFacts(context.Context, *TargetFactsRequest) (*TargetFactsResponse, error) mustEmbedUnimplementedConnectorServiceServer() } @@ -234,6 +261,9 @@ func (UnimplementedConnectorServiceServer) Deliver(context.Context, *DeliverRequ func (UnimplementedConnectorServiceServer) Listen(*ListenRequest, grpc.ServerStreamingServer[ListenResponse]) error { return status.Error(codes.Unimplemented, "method Listen not implemented") } +func (UnimplementedConnectorServiceServer) TargetFacts(context.Context, *TargetFactsRequest) (*TargetFactsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method TargetFacts not implemented") +} func (UnimplementedConnectorServiceServer) mustEmbedUnimplementedConnectorServiceServer() {} func (UnimplementedConnectorServiceServer) testEmbeddedByValue() {} @@ -392,6 +422,24 @@ func _ConnectorService_Listen_Handler(srv interface{}, stream grpc.ServerStream) // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type ConnectorService_ListenServer = grpc.ServerStreamingServer[ListenResponse] +func _ConnectorService_TargetFacts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetFactsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConnectorServiceServer).TargetFacts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ConnectorService_TargetFacts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConnectorServiceServer).TargetFacts(ctx, req.(*TargetFactsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ConnectorService_ServiceDesc is the grpc.ServiceDesc for ConnectorService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -427,6 +475,10 @@ var ConnectorService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Deliver", Handler: _ConnectorService_Deliver_Handler, }, + { + MethodName: "TargetFacts", + Handler: _ConnectorService_TargetFacts_Handler, + }, }, Streams: []grpc.StreamDesc{ {