From 1f1707534f9a79363407be8cb723df5a028c668a Mon Sep 17 00:00:00 2001 From: John Allers Date: Thu, 23 Jul 2026 13:20:35 +0000 Subject: [PATCH 1/2] fix(config): regenerate schema with distinct suggested_value for noun/verb Bumps baton-sdk to the build that emits WithSuggestedValue into a separate suggested_value schema field instead of folding it into default_value. noun/verb now export suggestedValue (GUI pre-population) with an empty defaultValue, so c1 no longer injects the narrow set into deployed connectors' resolved config -- they fall back to the full runtime default noun/verb set. Fixes the "fewer resources synced" regression. Co-authored-by: c1-squire-dev[bot] --- config_schema.json | 12 +- go.mod | 2 +- go.sum | 4 +- .../baton-sdk/pb/c1/config/v1/config.pb.go | 205 ++- .../pb/c1/config/v1/config.pb.validate.go | 52 + .../pb/c1/config/v1/config_protoopaque.pb.go | 198 ++- .../pkg/dotc1z/engine/pebble/adapter.go | 5 + .../pkg/dotc1z/engine/pebble/grants.go | 15 + .../pkg/dotc1z/engine/pebble/ingest_facts.go | 323 +++++ .../pkg/dotc1z/engine/pebble/ingest_repair.go | 325 +++++ .../engine/pebble/internal/rawdb/records.go | 23 + .../pkg/dotc1z/engine/pebble/test_seams.go | 18 + .../pkg/dotc1z/ingest_invariant_store.go | 94 ++ .../baton-sdk/pkg/field/fields.go | 15 + .../baton-sdk/pkg/field/marshal.go | 81 +- .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../baton-sdk/pkg/sync/expand/drop_stats.go | 102 ++ .../baton-sdk/pkg/sync/expand/expander.go | 21 +- .../pkg/sync/expand/topological_merge.go | 11 +- .../expand/topological_merge_projection.go | 10 +- .../baton-sdk/pkg/sync/ingest_invariants.go | 1135 +++++++++++++++++ .../conductorone/baton-sdk/pkg/sync/state.go | 156 +-- .../conductorone/baton-sdk/pkg/sync/syncer.go | 278 ++-- .../baton-sdk/pkg/synccompactor/compactor.go | 5 + .../baton-sdk/pkg/tasks/c1api/full_sync.go | 16 +- vendor/modules.txt | 2 +- 26 files changed, 2717 insertions(+), 393 deletions(-) create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_facts.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_repair.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/ingest_invariant_store.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/drop_stats.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go diff --git a/config_schema.json b/config_schema.json index 617b2a11..bd4f1409 100644 --- a/config_schema.json +++ b/config_schema.json @@ -139,10 +139,10 @@ "displayName": "Nouns", "description": "The nouns for your Confluence Space sync", "stringSliceField": { - "defaultValue": [ + "rules": {}, + "suggestedValue": [ "space" - ], - "rules": {} + ] } }, { @@ -150,15 +150,15 @@ "displayName": "Verbs", "description": "The verbs for your Confluence Space sync", "stringSliceField": { - "defaultValue": [ + "rules": {}, + "suggestedValue": [ "administer", "create", "delete", "export", "read", "restrict_content" - ], - "rules": {} + ] } }, { diff --git a/go.mod b/go.mod index bb0c125c..fd3fe28b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-confluence go 1.25.2 require ( - github.com/conductorone/baton-sdk v0.20.1 + github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231 github.com/deckarep/golang-set/v2 v2.9.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 diff --git a/go.sum b/go.sum index b99b6066..99540002 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b h1:VXvSNzmr8hMj8 github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b/go.mod h1:yBRu/cnL4ks9bgy4vAASdjIW+/xMlFwuHKqtmh3GZQg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/conductorone/baton-sdk v0.20.1 h1:UOwvSsJwhSWjX/939bbK12qHPtUo33IpP5qGgC181zs= -github.com/conductorone/baton-sdk v0.20.1/go.mod h1:sOlgVNTcl6XhbCVRhEnGX79uXz8Vh4V3T03daVPzm+g= +github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231 h1:Y5zaGFKCRsqGhWK8fjuFZ8fGZsnTNrvW3gUmcwkk0fk= +github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231/go.mod h1:sOlgVNTcl6XhbCVRhEnGX79uXz8Vh4V3T03daVPzm+g= github.com/conductorone/dpop v0.2.6 h1:fakwai/Xm2b/fcDUwJN41WtcSI/2UhQOyRIVvnnrrNA= github.com/conductorone/dpop v0.2.6/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.4 h1:lYxYi9/WTSL9sE96CO0QF2BY3kehs8dTTApI134TGCA= 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 d563d18f..c4664ed7 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 @@ -2180,10 +2180,12 @@ func (b0 ResourceIdSliceField_builder) Build() *ResourceIdSliceField { type IntField struct { state protoimpl.MessageState `protogen:"hybrid.v1"` // rules - DefaultValue int64 `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - Rules *Int64Rules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + DefaultValue int64 `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + Rules *Int64Rules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue int64 `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *IntField) Reset() { @@ -2225,6 +2227,13 @@ func (x *IntField) GetRules() *Int64Rules { return nil } +func (x *IntField) GetSuggestedValue() int64 { + if x != nil { + return x.SuggestedValue + } + return 0 +} + func (x *IntField) SetDefaultValue(v int64) { x.DefaultValue = v } @@ -2233,6 +2242,10 @@ func (x *IntField) SetRules(v *Int64Rules) { x.Rules = v } +func (x *IntField) SetSuggestedValue(v int64) { + x.SuggestedValue = v +} + func (x *IntField) HasRules() bool { if x == nil { return false @@ -2250,6 +2263,8 @@ type IntField_builder struct { // rules DefaultValue int64 Rules *Int64Rules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue int64 } func (b0 IntField_builder) Build() *IntField { @@ -2258,15 +2273,18 @@ func (b0 IntField_builder) Build() *IntField { _, _ = b, x x.DefaultValue = b.DefaultValue x.Rules = b.Rules + x.SuggestedValue = b.SuggestedValue return m0 } type BoolField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue bool `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - Rules *BoolRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue bool `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + Rules *BoolRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue bool `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BoolField) Reset() { @@ -2308,6 +2326,13 @@ func (x *BoolField) GetRules() *BoolRules { return nil } +func (x *BoolField) GetSuggestedValue() bool { + if x != nil { + return x.SuggestedValue + } + return false +} + func (x *BoolField) SetDefaultValue(v bool) { x.DefaultValue = v } @@ -2316,6 +2341,10 @@ func (x *BoolField) SetRules(v *BoolRules) { x.Rules = v } +func (x *BoolField) SetSuggestedValue(v bool) { + x.SuggestedValue = v +} + func (x *BoolField) HasRules() bool { if x == nil { return false @@ -2332,6 +2361,8 @@ type BoolField_builder struct { DefaultValue bool Rules *BoolRules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue bool } func (b0 BoolField_builder) Build() *BoolField { @@ -2340,15 +2371,18 @@ func (b0 BoolField_builder) Build() *BoolField { _, _ = b, x x.DefaultValue = b.DefaultValue x.Rules = b.Rules + x.SuggestedValue = b.SuggestedValue return m0 } type StringSliceField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue []string `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - Rules *RepeatedStringRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue []string `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + Rules *RepeatedStringRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue []string `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StringSliceField) Reset() { @@ -2390,6 +2424,13 @@ func (x *StringSliceField) GetRules() *RepeatedStringRules { return nil } +func (x *StringSliceField) GetSuggestedValue() []string { + if x != nil { + return x.SuggestedValue + } + return nil +} + func (x *StringSliceField) SetDefaultValue(v []string) { x.DefaultValue = v } @@ -2398,6 +2439,10 @@ func (x *StringSliceField) SetRules(v *RepeatedStringRules) { x.Rules = v } +func (x *StringSliceField) SetSuggestedValue(v []string) { + x.SuggestedValue = v +} + func (x *StringSliceField) HasRules() bool { if x == nil { return false @@ -2414,6 +2459,8 @@ type StringSliceField_builder struct { DefaultValue []string Rules *RepeatedStringRules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue []string } func (b0 StringSliceField_builder) Build() *StringSliceField { @@ -2422,15 +2469,18 @@ func (b0 StringSliceField_builder) Build() *StringSliceField { _, _ = b, x x.DefaultValue = b.DefaultValue x.Rules = b.Rules + x.SuggestedValue = b.SuggestedValue return m0 } type StringMapField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue map[string]*anypb.Any `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Rules *StringMapRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue map[string]*anypb.Any `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Rules *StringMapRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue map[string]*anypb.Any `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StringMapField) Reset() { @@ -2472,6 +2522,13 @@ func (x *StringMapField) GetRules() *StringMapRules { return nil } +func (x *StringMapField) GetSuggestedValue() map[string]*anypb.Any { + if x != nil { + return x.SuggestedValue + } + return nil +} + func (x *StringMapField) SetDefaultValue(v map[string]*anypb.Any) { x.DefaultValue = v } @@ -2480,6 +2537,10 @@ func (x *StringMapField) SetRules(v *StringMapRules) { x.Rules = v } +func (x *StringMapField) SetSuggestedValue(v map[string]*anypb.Any) { + x.SuggestedValue = v +} + func (x *StringMapField) HasRules() bool { if x == nil { return false @@ -2496,6 +2557,8 @@ type StringMapField_builder struct { DefaultValue map[string]*anypb.Any Rules *StringMapRules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue map[string]*anypb.Any } func (b0 StringMapField_builder) Build() *StringMapField { @@ -2504,6 +2567,7 @@ func (b0 StringMapField_builder) Build() *StringMapField { _, _ = b, x x.DefaultValue = b.DefaultValue x.Rules = b.Rules + x.SuggestedValue = b.SuggestedValue return m0 } @@ -2600,8 +2664,10 @@ type StringField struct { // only used for FileUpload atm, oneofs are evil AllowedExtensions []string `protobuf:"bytes,4,rep,name=allowed_extensions,json=allowedExtensions,proto3" json:"allowed_extensions,omitempty"` Options []*StringFieldOption `protobuf:"bytes,5,rep,name=options,proto3" json:"options,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue string `protobuf:"bytes,6,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StringField) Reset() { @@ -2664,6 +2730,13 @@ func (x *StringField) GetOptions() []*StringFieldOption { return nil } +func (x *StringField) GetSuggestedValue() string { + if x != nil { + return x.SuggestedValue + } + return "" +} + func (x *StringField) SetDefaultValue(v string) { x.DefaultValue = v } @@ -2684,6 +2757,10 @@ func (x *StringField) SetOptions(v []*StringFieldOption) { x.Options = v } +func (x *StringField) SetSuggestedValue(v string) { + x.SuggestedValue = v +} + func (x *StringField) HasRules() bool { if x == nil { return false @@ -2704,6 +2781,8 @@ type StringField_builder struct { // only used for FileUpload atm, oneofs are evil AllowedExtensions []string Options []*StringFieldOption + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue string } func (b0 StringField_builder) Build() *StringField { @@ -2715,6 +2794,7 @@ func (b0 StringField_builder) Build() *StringField { x.Type = b.Type x.AllowedExtensions = b.AllowedExtensions x.Options = b.Options + x.SuggestedValue = b.SuggestedValue return m0 } @@ -2817,36 +2897,44 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x14ResourceIdSliceField\x12B\n" + "\rdefault_value\x18\x01 \x03(\v2\x1d.c1.config.v1.ResourceIdFieldR\fdefaultValue\x12@\n" + "\x05rules\x18\x02 \x01(\v2%.c1.config.v1.RepeatedResourceIdRulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"n\n" + + "\x06_rules\"\x97\x01\n" + "\bIntField\x12#\n" + "\rdefault_value\x18\x01 \x01(\x03R\fdefaultValue\x123\n" + - "\x05rules\x18\x02 \x01(\v2\x18.c1.config.v1.Int64RulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"n\n" + + "\x05rules\x18\x02 \x01(\v2\x18.c1.config.v1.Int64RulesH\x00R\x05rules\x88\x01\x01\x12'\n" + + "\x0fsuggested_value\x18\x03 \x01(\x03R\x0esuggestedValueB\b\n" + + "\x06_rules\"\x97\x01\n" + "\tBoolField\x12#\n" + "\rdefault_value\x18\x01 \x01(\bR\fdefaultValue\x122\n" + - "\x05rules\x18\x02 \x01(\v2\x17.c1.config.v1.BoolRulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"\x7f\n" + + "\x05rules\x18\x02 \x01(\v2\x17.c1.config.v1.BoolRulesH\x00R\x05rules\x88\x01\x01\x12'\n" + + "\x0fsuggested_value\x18\x03 \x01(\bR\x0esuggestedValueB\b\n" + + "\x06_rules\"\xa8\x01\n" + "\x10StringSliceField\x12#\n" + "\rdefault_value\x18\x01 \x03(\tR\fdefaultValue\x12<\n" + - "\x05rules\x18\x02 \x01(\v2!.c1.config.v1.RepeatedStringRulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"\xff\x01\n" + + "\x05rules\x18\x02 \x01(\v2!.c1.config.v1.RepeatedStringRulesH\x00R\x05rules\x88\x01\x01\x12'\n" + + "\x0fsuggested_value\x18\x03 \x03(\tR\x0esuggestedValueB\b\n" + + "\x06_rules\"\xb3\x03\n" + "\x0eStringMapField\x12S\n" + "\rdefault_value\x18\x01 \x03(\v2..c1.config.v1.StringMapField.DefaultValueEntryR\fdefaultValue\x127\n" + - "\x05rules\x18\x02 \x01(\v2\x1c.c1.config.v1.StringMapRulesH\x00R\x05rules\x88\x01\x01\x1aU\n" + + "\x05rules\x18\x02 \x01(\v2\x1c.c1.config.v1.StringMapRulesH\x00R\x05rules\x88\x01\x01\x12Y\n" + + "\x0fsuggested_value\x18\x03 \x03(\v20.c1.config.v1.StringMapField.SuggestedValueEntryR\x0esuggestedValue\x1aU\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12*\n" + + "\x05value\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\x05value:\x028\x01\x1aW\n" + + "\x13SuggestedValueEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12*\n" + "\x05value\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\x05value:\x028\x01B\b\n" + "\x06_rules\"`\n" + "\x11StringFieldOption\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value\x12!\n" + - "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\"\x8f\x02\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\"\xb8\x02\n" + "\vStringField\x12#\n" + "\rdefault_value\x18\x01 \x01(\tR\fdefaultValue\x124\n" + "\x05rules\x18\x02 \x01(\v2\x19.c1.config.v1.StringRulesH\x00R\x05rules\x88\x01\x01\x121\n" + "\x04type\x18\x03 \x01(\x0e2\x1d.c1.config.v1.StringFieldTypeR\x04type\x12-\n" + "\x12allowed_extensions\x18\x04 \x03(\tR\x11allowedExtensions\x129\n" + - "\aoptions\x18\x05 \x03(\v2\x1f.c1.config.v1.StringFieldOptionR\aoptionsB\b\n" + + "\aoptions\x18\x05 \x03(\v2\x1f.c1.config.v1.StringFieldOptionR\aoptions\x12'\n" + + "\x0fsuggested_value\x18\x06 \x01(\tR\x0esuggestedValueB\b\n" + "\x06_rules*\xc4\x01\n" + "\x0eConstraintKind\x12\x1f\n" + "\x1bCONSTRAINT_KIND_UNSPECIFIED\x10\x00\x12%\n" + @@ -2862,7 +2950,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x1dSTRING_FIELD_TYPE_FILE_UPLOAD\x10\x04B3Z1github.com/conductorone/baton-sdk/pb/c1/config/v1b\x06proto3" var file_c1_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_c1_config_v1_config_proto_goTypes = []any{ (ConstraintKind)(0), // 0: c1.config.v1.ConstraintKind (StringFieldType)(0), // 1: c1.config.v1.StringFieldType @@ -2888,14 +2976,15 @@ var file_c1_config_v1_config_proto_goTypes = []any{ (*StringFieldOption)(nil), // 21: c1.config.v1.StringFieldOption (*StringField)(nil), // 22: c1.config.v1.StringField nil, // 23: c1.config.v1.StringMapField.DefaultValueEntry - (*anypb.Any)(nil), // 24: google.protobuf.Any - (*ResourceIDRules)(nil), // 25: c1.config.v1.ResourceIDRules - (*RepeatedResourceIdRules)(nil), // 26: c1.config.v1.RepeatedResourceIdRules - (*Int64Rules)(nil), // 27: c1.config.v1.Int64Rules - (*BoolRules)(nil), // 28: c1.config.v1.BoolRules - (*RepeatedStringRules)(nil), // 29: c1.config.v1.RepeatedStringRules - (*StringMapRules)(nil), // 30: c1.config.v1.StringMapRules - (*StringRules)(nil), // 31: c1.config.v1.StringRules + nil, // 24: c1.config.v1.StringMapField.SuggestedValueEntry + (*anypb.Any)(nil), // 25: google.protobuf.Any + (*ResourceIDRules)(nil), // 26: c1.config.v1.ResourceIDRules + (*RepeatedResourceIdRules)(nil), // 27: c1.config.v1.RepeatedResourceIdRules + (*Int64Rules)(nil), // 28: c1.config.v1.Int64Rules + (*BoolRules)(nil), // 29: c1.config.v1.BoolRules + (*RepeatedStringRules)(nil), // 30: c1.config.v1.RepeatedStringRules + (*StringMapRules)(nil), // 31: c1.config.v1.StringMapRules + (*StringRules)(nil), // 32: c1.config.v1.StringRules } var file_c1_config_v1_config_proto_depIdxs = []int32{ 5, // 0: c1.config.v1.Configuration.fields:type_name -> c1.config.v1.Field @@ -2915,7 +3004,7 @@ var file_c1_config_v1_config_proto_depIdxs = []int32{ 14, // 14: c1.config.v1.Field.grant_slice_field:type_name -> c1.config.v1.GrantSliceField 7, // 15: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId 7, // 16: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId - 24, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any + 25, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any 6, // 18: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource 6, // 19: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource 10, // 20: c1.config.v1.EntitlementSliceField.default_value:type_name -> c1.config.v1.Entitlement @@ -2923,23 +3012,25 @@ var file_c1_config_v1_config_proto_depIdxs = []int32{ 6, // 22: c1.config.v1.Grant.principal:type_name -> c1.config.v1.Resource 13, // 23: c1.config.v1.GrantSliceField.default_value:type_name -> c1.config.v1.Grant 7, // 24: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId - 25, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules + 26, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules 15, // 26: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField - 26, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules - 27, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules - 28, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules - 29, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules + 27, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules + 28, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules + 29, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules + 30, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules 23, // 31: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry - 30, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules - 31, // 33: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules - 1, // 34: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType - 21, // 35: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption - 24, // 36: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any - 37, // [37:37] is the sub-list for method output_type - 37, // [37:37] is the sub-list for method input_type - 37, // [37:37] is the sub-list for extension type_name - 37, // [37:37] is the sub-list for extension extendee - 0, // [0:37] is the sub-list for field type_name + 31, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules + 24, // 33: c1.config.v1.StringMapField.suggested_value:type_name -> c1.config.v1.StringMapField.SuggestedValueEntry + 32, // 34: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules + 1, // 35: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType + 21, // 36: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption + 25, // 37: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any + 25, // 38: c1.config.v1.StringMapField.SuggestedValueEntry.value:type_name -> google.protobuf.Any + 39, // [39:39] is the sub-list for method output_type + 39, // [39:39] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name } func init() { file_c1_config_v1_config_proto_init() } @@ -2974,7 +3065,7 @@ func file_c1_config_v1_config_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_config_v1_config_proto_rawDesc), len(file_c1_config_v1_config_proto_rawDesc)), NumEnums: 2, - NumMessages: 22, + NumMessages: 23, NumExtensions: 0, NumServices: 0, }, 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 3c99fe9b..6cacb683 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 @@ -2594,6 +2594,8 @@ func (m *IntField) validate(all bool) error { // no validation rules for DefaultValue + // no validation rules for SuggestedValue + if m.Rules != nil { if all { @@ -2728,6 +2730,8 @@ func (m *BoolField) validate(all bool) error { // no validation rules for DefaultValue + // no validation rules for SuggestedValue + if m.Rules != nil { if all { @@ -3039,6 +3043,52 @@ func (m *StringMapField) validate(all bool) error { } } + { + sorted_keys := make([]string, len(m.GetSuggestedValue())) + i := 0 + for key := range m.GetSuggestedValue() { + sorted_keys[i] = key + i++ + } + sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) + for _, key := range sorted_keys { + val := m.GetSuggestedValue()[key] + _ = val + + // no validation rules for SuggestedValue[key] + + if all { + switch v := interface{}(val).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StringMapFieldValidationError{ + field: fmt.Sprintf("SuggestedValue[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StringMapFieldValidationError{ + field: fmt.Sprintf("SuggestedValue[%v]", key), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StringMapFieldValidationError{ + field: fmt.Sprintf("SuggestedValue[%v]", key), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + } + if m.Rules != nil { if all { @@ -3318,6 +3368,8 @@ func (m *StringField) validate(all bool) error { } + // no validation rules for SuggestedValue + if m.Rules != nil { if all { diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go index a236f5f3..a16d293a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go @@ -2174,11 +2174,12 @@ func (b0 ResourceIdSliceField_builder) Build() *ResourceIdSliceField { } type IntField struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_DefaultValue int64 `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3"` - xxx_hidden_Rules *Int64Rules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_DefaultValue int64 `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3"` + xxx_hidden_Rules *Int64Rules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` + xxx_hidden_SuggestedValue int64 `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *IntField) Reset() { @@ -2220,6 +2221,13 @@ func (x *IntField) GetRules() *Int64Rules { return nil } +func (x *IntField) GetSuggestedValue() int64 { + if x != nil { + return x.xxx_hidden_SuggestedValue + } + return 0 +} + func (x *IntField) SetDefaultValue(v int64) { x.xxx_hidden_DefaultValue = v } @@ -2228,6 +2236,10 @@ func (x *IntField) SetRules(v *Int64Rules) { x.xxx_hidden_Rules = v } +func (x *IntField) SetSuggestedValue(v int64) { + x.xxx_hidden_SuggestedValue = v +} + func (x *IntField) HasRules() bool { if x == nil { return false @@ -2245,6 +2257,8 @@ type IntField_builder struct { // rules DefaultValue int64 Rules *Int64Rules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue int64 } func (b0 IntField_builder) Build() *IntField { @@ -2253,15 +2267,17 @@ func (b0 IntField_builder) Build() *IntField { _, _ = b, x x.xxx_hidden_DefaultValue = b.DefaultValue x.xxx_hidden_Rules = b.Rules + x.xxx_hidden_SuggestedValue = b.SuggestedValue return m0 } type BoolField struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_DefaultValue bool `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3"` - xxx_hidden_Rules *BoolRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_DefaultValue bool `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3"` + xxx_hidden_Rules *BoolRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` + xxx_hidden_SuggestedValue bool `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BoolField) Reset() { @@ -2303,6 +2319,13 @@ func (x *BoolField) GetRules() *BoolRules { return nil } +func (x *BoolField) GetSuggestedValue() bool { + if x != nil { + return x.xxx_hidden_SuggestedValue + } + return false +} + func (x *BoolField) SetDefaultValue(v bool) { x.xxx_hidden_DefaultValue = v } @@ -2311,6 +2334,10 @@ func (x *BoolField) SetRules(v *BoolRules) { x.xxx_hidden_Rules = v } +func (x *BoolField) SetSuggestedValue(v bool) { + x.xxx_hidden_SuggestedValue = v +} + func (x *BoolField) HasRules() bool { if x == nil { return false @@ -2327,6 +2354,8 @@ type BoolField_builder struct { DefaultValue bool Rules *BoolRules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue bool } func (b0 BoolField_builder) Build() *BoolField { @@ -2335,15 +2364,17 @@ func (b0 BoolField_builder) Build() *BoolField { _, _ = b, x x.xxx_hidden_DefaultValue = b.DefaultValue x.xxx_hidden_Rules = b.Rules + x.xxx_hidden_SuggestedValue = b.SuggestedValue return m0 } type StringSliceField struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_DefaultValue []string `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3"` - xxx_hidden_Rules *RepeatedStringRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_DefaultValue []string `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3"` + xxx_hidden_Rules *RepeatedStringRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` + xxx_hidden_SuggestedValue []string `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StringSliceField) Reset() { @@ -2385,6 +2416,13 @@ func (x *StringSliceField) GetRules() *RepeatedStringRules { return nil } +func (x *StringSliceField) GetSuggestedValue() []string { + if x != nil { + return x.xxx_hidden_SuggestedValue + } + return nil +} + func (x *StringSliceField) SetDefaultValue(v []string) { x.xxx_hidden_DefaultValue = v } @@ -2393,6 +2431,10 @@ func (x *StringSliceField) SetRules(v *RepeatedStringRules) { x.xxx_hidden_Rules = v } +func (x *StringSliceField) SetSuggestedValue(v []string) { + x.xxx_hidden_SuggestedValue = v +} + func (x *StringSliceField) HasRules() bool { if x == nil { return false @@ -2409,6 +2451,8 @@ type StringSliceField_builder struct { DefaultValue []string Rules *RepeatedStringRules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue []string } func (b0 StringSliceField_builder) Build() *StringSliceField { @@ -2417,15 +2461,17 @@ func (b0 StringSliceField_builder) Build() *StringSliceField { _, _ = b, x x.xxx_hidden_DefaultValue = b.DefaultValue x.xxx_hidden_Rules = b.Rules + x.xxx_hidden_SuggestedValue = b.SuggestedValue return m0 } type StringMapField struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_DefaultValue map[string]*anypb.Any `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - xxx_hidden_Rules *StringMapRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_DefaultValue map[string]*anypb.Any `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + xxx_hidden_Rules *StringMapRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof"` + xxx_hidden_SuggestedValue map[string]*anypb.Any `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StringMapField) Reset() { @@ -2467,6 +2513,13 @@ func (x *StringMapField) GetRules() *StringMapRules { return nil } +func (x *StringMapField) GetSuggestedValue() map[string]*anypb.Any { + if x != nil { + return x.xxx_hidden_SuggestedValue + } + return nil +} + func (x *StringMapField) SetDefaultValue(v map[string]*anypb.Any) { x.xxx_hidden_DefaultValue = v } @@ -2475,6 +2528,10 @@ func (x *StringMapField) SetRules(v *StringMapRules) { x.xxx_hidden_Rules = v } +func (x *StringMapField) SetSuggestedValue(v map[string]*anypb.Any) { + x.xxx_hidden_SuggestedValue = v +} + func (x *StringMapField) HasRules() bool { if x == nil { return false @@ -2491,6 +2548,8 @@ type StringMapField_builder struct { DefaultValue map[string]*anypb.Any Rules *StringMapRules + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue map[string]*anypb.Any } func (b0 StringMapField_builder) Build() *StringMapField { @@ -2499,6 +2558,7 @@ func (b0 StringMapField_builder) Build() *StringMapField { _, _ = b, x x.xxx_hidden_DefaultValue = b.DefaultValue x.xxx_hidden_Rules = b.Rules + x.xxx_hidden_SuggestedValue = b.SuggestedValue return m0 } @@ -2594,6 +2654,7 @@ type StringField struct { xxx_hidden_Type StringFieldType `protobuf:"varint,3,opt,name=type,proto3,enum=c1.config.v1.StringFieldType"` xxx_hidden_AllowedExtensions []string `protobuf:"bytes,4,rep,name=allowed_extensions,json=allowedExtensions,proto3"` xxx_hidden_Options *[]*StringFieldOption `protobuf:"bytes,5,rep,name=options,proto3"` + xxx_hidden_SuggestedValue string `protobuf:"bytes,6,opt,name=suggested_value,json=suggestedValue,proto3"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2660,6 +2721,13 @@ func (x *StringField) GetOptions() []*StringFieldOption { return nil } +func (x *StringField) GetSuggestedValue() string { + if x != nil { + return x.xxx_hidden_SuggestedValue + } + return "" +} + func (x *StringField) SetDefaultValue(v string) { x.xxx_hidden_DefaultValue = v } @@ -2680,6 +2748,10 @@ func (x *StringField) SetOptions(v []*StringFieldOption) { x.xxx_hidden_Options = &v } +func (x *StringField) SetSuggestedValue(v string) { + x.xxx_hidden_SuggestedValue = v +} + func (x *StringField) HasRules() bool { if x == nil { return false @@ -2700,6 +2772,8 @@ type StringField_builder struct { // only used for FileUpload atm, oneofs are evil AllowedExtensions []string Options []*StringFieldOption + // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + SuggestedValue string } func (b0 StringField_builder) Build() *StringField { @@ -2711,6 +2785,7 @@ func (b0 StringField_builder) Build() *StringField { x.xxx_hidden_Type = b.Type x.xxx_hidden_AllowedExtensions = b.AllowedExtensions x.xxx_hidden_Options = &b.Options + x.xxx_hidden_SuggestedValue = b.SuggestedValue return m0 } @@ -2813,36 +2888,44 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x14ResourceIdSliceField\x12B\n" + "\rdefault_value\x18\x01 \x03(\v2\x1d.c1.config.v1.ResourceIdFieldR\fdefaultValue\x12@\n" + "\x05rules\x18\x02 \x01(\v2%.c1.config.v1.RepeatedResourceIdRulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"n\n" + + "\x06_rules\"\x97\x01\n" + "\bIntField\x12#\n" + "\rdefault_value\x18\x01 \x01(\x03R\fdefaultValue\x123\n" + - "\x05rules\x18\x02 \x01(\v2\x18.c1.config.v1.Int64RulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"n\n" + + "\x05rules\x18\x02 \x01(\v2\x18.c1.config.v1.Int64RulesH\x00R\x05rules\x88\x01\x01\x12'\n" + + "\x0fsuggested_value\x18\x03 \x01(\x03R\x0esuggestedValueB\b\n" + + "\x06_rules\"\x97\x01\n" + "\tBoolField\x12#\n" + "\rdefault_value\x18\x01 \x01(\bR\fdefaultValue\x122\n" + - "\x05rules\x18\x02 \x01(\v2\x17.c1.config.v1.BoolRulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"\x7f\n" + + "\x05rules\x18\x02 \x01(\v2\x17.c1.config.v1.BoolRulesH\x00R\x05rules\x88\x01\x01\x12'\n" + + "\x0fsuggested_value\x18\x03 \x01(\bR\x0esuggestedValueB\b\n" + + "\x06_rules\"\xa8\x01\n" + "\x10StringSliceField\x12#\n" + "\rdefault_value\x18\x01 \x03(\tR\fdefaultValue\x12<\n" + - "\x05rules\x18\x02 \x01(\v2!.c1.config.v1.RepeatedStringRulesH\x00R\x05rules\x88\x01\x01B\b\n" + - "\x06_rules\"\xff\x01\n" + + "\x05rules\x18\x02 \x01(\v2!.c1.config.v1.RepeatedStringRulesH\x00R\x05rules\x88\x01\x01\x12'\n" + + "\x0fsuggested_value\x18\x03 \x03(\tR\x0esuggestedValueB\b\n" + + "\x06_rules\"\xb3\x03\n" + "\x0eStringMapField\x12S\n" + "\rdefault_value\x18\x01 \x03(\v2..c1.config.v1.StringMapField.DefaultValueEntryR\fdefaultValue\x127\n" + - "\x05rules\x18\x02 \x01(\v2\x1c.c1.config.v1.StringMapRulesH\x00R\x05rules\x88\x01\x01\x1aU\n" + + "\x05rules\x18\x02 \x01(\v2\x1c.c1.config.v1.StringMapRulesH\x00R\x05rules\x88\x01\x01\x12Y\n" + + "\x0fsuggested_value\x18\x03 \x03(\v20.c1.config.v1.StringMapField.SuggestedValueEntryR\x0esuggestedValue\x1aU\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12*\n" + + "\x05value\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\x05value:\x028\x01\x1aW\n" + + "\x13SuggestedValueEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12*\n" + "\x05value\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\x05value:\x028\x01B\b\n" + "\x06_rules\"`\n" + "\x11StringFieldOption\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value\x12!\n" + - "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\"\x8f\x02\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\"\xb8\x02\n" + "\vStringField\x12#\n" + "\rdefault_value\x18\x01 \x01(\tR\fdefaultValue\x124\n" + "\x05rules\x18\x02 \x01(\v2\x19.c1.config.v1.StringRulesH\x00R\x05rules\x88\x01\x01\x121\n" + "\x04type\x18\x03 \x01(\x0e2\x1d.c1.config.v1.StringFieldTypeR\x04type\x12-\n" + "\x12allowed_extensions\x18\x04 \x03(\tR\x11allowedExtensions\x129\n" + - "\aoptions\x18\x05 \x03(\v2\x1f.c1.config.v1.StringFieldOptionR\aoptionsB\b\n" + + "\aoptions\x18\x05 \x03(\v2\x1f.c1.config.v1.StringFieldOptionR\aoptions\x12'\n" + + "\x0fsuggested_value\x18\x06 \x01(\tR\x0esuggestedValueB\b\n" + "\x06_rules*\xc4\x01\n" + "\x0eConstraintKind\x12\x1f\n" + "\x1bCONSTRAINT_KIND_UNSPECIFIED\x10\x00\x12%\n" + @@ -2858,7 +2941,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x1dSTRING_FIELD_TYPE_FILE_UPLOAD\x10\x04B3Z1github.com/conductorone/baton-sdk/pb/c1/config/v1b\x06proto3" var file_c1_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_c1_config_v1_config_proto_goTypes = []any{ (ConstraintKind)(0), // 0: c1.config.v1.ConstraintKind (StringFieldType)(0), // 1: c1.config.v1.StringFieldType @@ -2884,14 +2967,15 @@ var file_c1_config_v1_config_proto_goTypes = []any{ (*StringFieldOption)(nil), // 21: c1.config.v1.StringFieldOption (*StringField)(nil), // 22: c1.config.v1.StringField nil, // 23: c1.config.v1.StringMapField.DefaultValueEntry - (*anypb.Any)(nil), // 24: google.protobuf.Any - (*ResourceIDRules)(nil), // 25: c1.config.v1.ResourceIDRules - (*RepeatedResourceIdRules)(nil), // 26: c1.config.v1.RepeatedResourceIdRules - (*Int64Rules)(nil), // 27: c1.config.v1.Int64Rules - (*BoolRules)(nil), // 28: c1.config.v1.BoolRules - (*RepeatedStringRules)(nil), // 29: c1.config.v1.RepeatedStringRules - (*StringMapRules)(nil), // 30: c1.config.v1.StringMapRules - (*StringRules)(nil), // 31: c1.config.v1.StringRules + nil, // 24: c1.config.v1.StringMapField.SuggestedValueEntry + (*anypb.Any)(nil), // 25: google.protobuf.Any + (*ResourceIDRules)(nil), // 26: c1.config.v1.ResourceIDRules + (*RepeatedResourceIdRules)(nil), // 27: c1.config.v1.RepeatedResourceIdRules + (*Int64Rules)(nil), // 28: c1.config.v1.Int64Rules + (*BoolRules)(nil), // 29: c1.config.v1.BoolRules + (*RepeatedStringRules)(nil), // 30: c1.config.v1.RepeatedStringRules + (*StringMapRules)(nil), // 31: c1.config.v1.StringMapRules + (*StringRules)(nil), // 32: c1.config.v1.StringRules } var file_c1_config_v1_config_proto_depIdxs = []int32{ 5, // 0: c1.config.v1.Configuration.fields:type_name -> c1.config.v1.Field @@ -2911,7 +2995,7 @@ var file_c1_config_v1_config_proto_depIdxs = []int32{ 14, // 14: c1.config.v1.Field.grant_slice_field:type_name -> c1.config.v1.GrantSliceField 7, // 15: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId 7, // 16: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId - 24, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any + 25, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any 6, // 18: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource 6, // 19: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource 10, // 20: c1.config.v1.EntitlementSliceField.default_value:type_name -> c1.config.v1.Entitlement @@ -2919,23 +3003,25 @@ var file_c1_config_v1_config_proto_depIdxs = []int32{ 6, // 22: c1.config.v1.Grant.principal:type_name -> c1.config.v1.Resource 13, // 23: c1.config.v1.GrantSliceField.default_value:type_name -> c1.config.v1.Grant 7, // 24: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId - 25, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules + 26, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules 15, // 26: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField - 26, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules - 27, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules - 28, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules - 29, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules + 27, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules + 28, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules + 29, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules + 30, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules 23, // 31: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry - 30, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules - 31, // 33: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules - 1, // 34: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType - 21, // 35: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption - 24, // 36: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any - 37, // [37:37] is the sub-list for method output_type - 37, // [37:37] is the sub-list for method input_type - 37, // [37:37] is the sub-list for extension type_name - 37, // [37:37] is the sub-list for extension extendee - 0, // [0:37] is the sub-list for field type_name + 31, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules + 24, // 33: c1.config.v1.StringMapField.suggested_value:type_name -> c1.config.v1.StringMapField.SuggestedValueEntry + 32, // 34: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules + 1, // 35: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType + 21, // 36: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption + 25, // 37: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any + 25, // 38: c1.config.v1.StringMapField.SuggestedValueEntry.value:type_name -> google.protobuf.Any + 39, // [39:39] is the sub-list for method output_type + 39, // [39:39] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name } func init() { file_c1_config_v1_config_proto_init() } @@ -2970,7 +3056,7 @@ func file_c1_config_v1_config_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_config_v1_config_proto_rawDesc), len(file_c1_config_v1_config_proto_rawDesc)), NumEnums: 2, - NumMessages: 22, + NumMessages: 23, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go index 60d23a34..5c98b14e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go @@ -344,6 +344,11 @@ func (e *Engine) endSyncFinalize(ctx context.Context, existing *v3.SyncRunRecord EndedAt: timestamppb.Now(), SyncToken: existing.GetSyncToken(), }.Build() + if e.test.endSyncStampHook != nil { + if err := e.test.endSyncStampHook(); err != nil { + return err + } + } if err := e.PutSyncRunRecord(ctx, updated); err != nil { return err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/grants.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/grants.go index 583b3b1f..a603dfca 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/grants.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/grants.go @@ -287,6 +287,11 @@ func (e *Engine) PutExpandedGrantRecords(ctx context.Context, records []*v3.Gran } } + if e.test.recordCommitHook != nil { + if err := e.test.recordCommitHook(); err != nil { + return err + } + } // One atomic commit: rows and their obligations ride the same // batch, so a primary commit landing without its index entries // is unexpressible. @@ -337,6 +342,11 @@ func (e *Engine) PutSynthesizedGrantRecords(ctx context.Context, records []*v3.G return err } } + if e.test.recordCommitHook != nil { + if err := e.test.recordCommitHook(); err != nil { + return err + } + } // One atomic commit: rows and their obligations ride the same // batch, so a primary commit landing without its index entries // is unexpressible. @@ -735,6 +745,11 @@ func (e *Engine) putSynthesizedGrantContributionsBatch(ctx context.Context, reco return err } } + if e.test.recordCommitHook != nil { + if err := e.test.recordCommitHook(); err != nil { + return err + } + } // One atomic commit: rows and their obligations ride the same // batch, so a primary commit landing without its index entries // is unexpressible. diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_facts.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_facts.go new file mode 100644 index 00000000..6cc7d85c --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_facts.go @@ -0,0 +1,323 @@ +package pebble + +// Ingestion-invariant scan primitives: the engine mechanics behind the +// syncer's referential invariants (I3/I7/I8 in +// pkg/sync/ingest_invariants.go). All read-only, all O(distinct +// referents) by prefix-skip over the ordered keyspaces — never +// O(rows). Value reads happen only for DANGLING referents (rare to +// zero on healthy syncs), never on the bulk path. + +import ( + "context" + "errors" + "fmt" + "strings" + + "github.com/cockroachdb/pebble/v2" + "google.golang.org/protobuf/types/known/anypb" + + v3 "github.com/conductorone/baton-sdk/pb/c1/storage/v3" + "github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/codec" +) + +// Annotation type names the invariant probes match against (the tail +// of the anypb type URL). Matched by name to avoid unmarshaling the +// annotation payloads — existence is the fact. +const ( + anyTypeInsertResourceGrants = "c1.connector.v2.InsertResourceGrants" + anyTypeExternalResourceMatch = "c1.connector.v2.ExternalResourceMatch" + anyTypeExternalResourceMatchAll = "c1.connector.v2.ExternalResourceMatchAll" + anyTypeExternalResourceMatchID = "c1.connector.v2.ExternalResourceMatchID" +) + +// annsContainType reports whether any annotation's type URL names typeName. +func annsContainType(anns []*anypb.Any, typeName string) bool { + for _, a := range anns { + url := a.GetTypeUrl() + name := url + if i := strings.LastIndexByte(url, '/'); i >= 0 { + name = url[i+1:] + } + if name == typeName { + return true + } + } + return false +} + +// grantRecordHasExternalMatch reports whether a GrantRecord's +// annotations carry any ExternalResourceMatch* type — I9's unprocessed +// match-carrier exemption. +func grantRecordHasExternalMatch(anns []*anypb.Any) bool { + return annsContainType(anns, anyTypeExternalResourceMatch) || + annsContainType(anns, anyTypeExternalResourceMatchAll) || + annsContainType(anns, anyTypeExternalResourceMatchID) +} + +// grantValueCarriesInsertFact reports whether a raw grant row value's +// annotations carry InsertResourceGrants. Unmarshals the record — +// acceptable because every caller probes DANGLING referents only. +func grantValueCarriesInsertFact(val []byte) (bool, error) { + rec := &v3.GrantRecord{} + if err := unmarshalRecord(val, rec); err != nil { + return false, fmt.Errorf("insert-fact probe: unmarshal grant record: %w", err) + } + return annsContainType(rec.GetAnnotations(), anyTypeInsertResourceGrants), nil +} + +// ForEachDistinctGrantEntitlementResource visits each distinct +// (entitlement resource_type_id, resource_id) pair present in the grant +// primary keyspace, in key order. The keyspace leads with +// ent_rt | ent_rid, so distinctness is a prefix-skip: one seek per +// distinct resource — O(distinct) seeks, never O(grants). Backs the +// syncer's grant→resource referential invariant (I3). +func (e *Engine) ForEachDistinctGrantEntitlementResource(ctx context.Context, visit func(resourceTypeID, resourceID string) error) error { + if e.db == nil { + return ErrEngineClosing + } + prefix := encodeGrantPrefix() + iter, err := e.db.NewIter(&pebble.IterOptions{ + LowerBound: prefix, + UpperBound: upperBoundOf(prefix), + }) + if err != nil { + return err + } + defer iter.Close() + + const headerLen = 3 // versionV3, typeGrant, separator + for valid := iter.First(); valid; { + if err := ctx.Err(); err != nil { + return err + } + key := iter.Key() + if len(key) <= headerLen { + return fmt.Errorf("distinct ent-resource scan: malformed grant key %x", key) + } + tail := key[headerLen:] + rtBytes, next, ok := codec.DecodeTupleStringAlias(tail, 0) + if !ok || next >= len(tail) { + return fmt.Errorf("distinct ent-resource scan: malformed grant key tail %x", key) + } + ridBytes, _, ok := codec.DecodeTupleStringAlias(tail, next+1) + if !ok { + return fmt.Errorf("distinct ent-resource scan: malformed grant key tail %x", key) + } + rt, rid := string(rtBytes), string(ridBytes) + if err := visit(rt, rid); err != nil { + return err + } + // Skip every remaining grant of this entitlement resource. + valid = iter.SeekGE(upperBoundOf(encodeGrantPrimaryEntitlementResourcePrefix(rt, rid))) + } + return iter.Error() +} + +// ForEachDistinctEntitlementResource visits each distinct +// (resource_type_id, resource_id) pair present in the entitlement +// primary keyspace, in key order. Same prefix-skip shape as the grant +// scan: one seek per distinct resource, never O(entitlements). Backs +// the syncer's entitlement→resource referential invariant (I7). +func (e *Engine) ForEachDistinctEntitlementResource(ctx context.Context, visit func(resourceTypeID, resourceID string) error) error { + if e.db == nil { + return ErrEngineClosing + } + prefix := encodeEntitlementPrefix() + iter, err := e.db.NewIter(&pebble.IterOptions{ + LowerBound: prefix, + UpperBound: upperBoundOf(prefix), + }) + if err != nil { + return err + } + defer iter.Close() + + const headerLen = 3 // versionV3, typeEntitlement, separator + for valid := iter.First(); valid; { + if err := ctx.Err(); err != nil { + return err + } + key := iter.Key() + if len(key) <= headerLen { + return fmt.Errorf("distinct entitlement-resource scan: malformed entitlement key %x", key) + } + tail := key[headerLen:] + rtBytes, next, ok := codec.DecodeTupleStringAlias(tail, 0) + if !ok || next >= len(tail) { + return fmt.Errorf("distinct entitlement-resource scan: malformed entitlement key tail %x", key) + } + ridBytes, _, ok := codec.DecodeTupleStringAlias(tail, next+1) + if !ok { + return fmt.Errorf("distinct entitlement-resource scan: malformed entitlement key tail %x", key) + } + rt, rid := string(rtBytes), string(ridBytes) + if err := visit(rt, rid); err != nil { + return err + } + valid = iter.SeekGE(upperBoundOf(encodeEntitlementPrimaryResourcePrefix(rt, rid))) + } + return iter.Error() +} + +// ForEachDanglingGrantEntitlement visits each distinct entitlement +// identity referenced by grants for which NO entitlement row exists. +// The grant primary key leads with the full entitlement identity tuple +// (which is byte-identical to the entitlement primary key's tuple), so +// the scan is one seek per distinct entitlement plus one point-Get +// probe each — O(distinct entitlements), never O(grants), and no value +// reads: the identity tuple reconstructs the external id byte-exactly +// (see identity.go). Backs the syncer's grant→entitlement referential +// invariant (I8). +func (e *Engine) ForEachDanglingGrantEntitlement(ctx context.Context, visit func(entitlementID, resourceTypeID, resourceID string) error) error { + if e.db == nil { + return ErrEngineClosing + } + prefix := encodeGrantPrefix() + iter, err := e.db.NewIter(&pebble.IterOptions{ + LowerBound: prefix, + UpperBound: upperBoundOf(prefix), + }) + if err != nil { + return err + } + defer iter.Close() + + const headerLen = 3 // versionV3, typeGrant, separator + for valid := iter.First(); valid; { + if err := ctx.Err(); err != nil { + return err + } + key := iter.Key() + if len(key) <= headerLen { + return fmt.Errorf("dangling grant-entitlement scan: malformed grant key %x", key) + } + tail := key[headerLen:] + var comps [4]string + off := 0 + for i := range comps { + b, next, ok := codec.DecodeTupleStringAlias(tail, off) + if !ok || (i < len(comps)-1 && next >= len(tail)) { + return fmt.Errorf("dangling grant-entitlement scan: malformed grant key tail %x", key) + } + comps[i] = string(b) + off = next + 1 + } + id := entitlementIdentity{ + resourceTypeID: comps[0], + resourceID: comps[1], + stripped: comps[2] == idFlagStripped, + tail: comps[3], + } + exists, err := e.hasEntitlementIdentity(id) + if err != nil { + return err + } + if !exists { + if err := visit(id.externalID(), id.resourceTypeID, id.resourceID); err != nil { + return err + } + } + // Skip every remaining grant of this entitlement. + valid = iter.SeekGE(upperBoundOf(encodeGrantPrimaryEntitlementPrefix(id))) + } + return iter.Error() +} + +func (e *Engine) hasEntitlementIdentity(id entitlementIdentity) (bool, error) { + _, closer, err := e.db.Get(encodeEntitlementIdentityKey(id)) + if err != nil { + if errors.Is(err, pebble.ErrNotFound) { + return false, nil + } + return false, err + } + closer.Close() + return true, nil +} + +// GrantsForEntitlementAllCarryInsertFact reports whether EVERY grant +// under the given entitlement identity carries the InsertResourceGrants +// annotation — the probe for I8's per-grant exemption: a dangling +// entitlement whose grants all carry the fact is the machinery-owned +// shape (exempt); one non-carrying grant makes it a connector-owned +// dangling reference. Vacuously true with no grants (never the case for +// a dangling entitlement, which is only visited because grants +// reference it). Reads row values, so it is reserved for DANGLING +// referential probes — rare to zero on healthy syncs. +func (e *Engine) GrantsForEntitlementAllCarryInsertFact(ctx context.Context, entitlementID, entResourceTypeID, entResourceID string) (bool, error) { + if e.db == nil { + return false, ErrEngineClosing + } + entID := entitlementIdentityFromParts(entResourceTypeID, entResourceID, entitlementID) + prefix := encodeGrantPrimaryEntitlementPrefix(entID) + iter, err := e.db.NewIter(&pebble.IterOptions{ + LowerBound: prefix, + UpperBound: upperBoundOf(prefix), + }) + if err != nil { + return false, err + } + defer iter.Close() + for iter.First(); iter.Valid(); iter.Next() { + if err := ctx.Err(); err != nil { + return false, err + } + carries, err := grantValueCarriesInsertFact(iter.Value()) + if err != nil { + return false, err + } + if !carries { + return false, nil + } + } + return true, iter.Error() +} + +// GrantsForEntResourceCarryInsertFact reports whether any grant under the +// given entitlement resource carries the InsertResourceGrants annotation. +// Reads row values, so it is reserved for DANGLING referential probes — +// rare to zero on healthy syncs — never the bulk path. +func (e *Engine) GrantsForEntResourceCarryInsertFact(ctx context.Context, resourceTypeID, resourceID string) (bool, error) { + if e.db == nil { + return false, ErrEngineClosing + } + prefix := encodeGrantPrimaryEntitlementResourcePrefix(resourceTypeID, resourceID) + iter, err := e.db.NewIter(&pebble.IterOptions{ + LowerBound: prefix, + UpperBound: upperBoundOf(prefix), + }) + if err != nil { + return false, err + } + defer iter.Close() + for iter.First(); iter.Valid(); iter.Next() { + if err := ctx.Err(); err != nil { + return false, err + } + carries, err := grantValueCarriesInsertFact(iter.Value()) + if err != nil { + return false, err + } + if carries { + return true, nil + } + } + return false, iter.Error() +} + +// HasResourceRecord reports whether a resource row exists — the probe +// side of the referential invariants. +func (e *Engine) HasResourceRecord(ctx context.Context, resourceTypeID, resourceID string) (bool, error) { + if e.db == nil { + return false, ErrEngineClosing + } + _, closer, err := e.db.Get(encodeResourceKey(resourceTypeID, resourceID)) + if err != nil { + if errors.Is(err, pebble.ErrNotFound) { + return false, nil + } + return false, err + } + closer.Close() + return true, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_repair.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_repair.go new file mode 100644 index 00000000..9225caa7 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/ingest_repair.go @@ -0,0 +1,325 @@ +package pebble + +// The engine side of the syncer's dangling-principal invariant (I9 in +// pkg/sync/ingest_invariants.go): the by_principal scan, the +// match-carrier probe, and the orphan index-entry heal. Policy (what +// to warn on, exemptions, fail-fast) lives in the syncer; these +// methods are mechanics. The heal is the one WRITE here, and it rides +// rawdb's typed StageGrantOrphanIndexHeal op — index-only cleanup of +// entries whose primary row is provably absent. + +import ( + "context" + "errors" + "fmt" + + "github.com/cockroachdb/pebble/v2" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" + + v3 "github.com/conductorone/baton-sdk/pb/c1/storage/v3" + "github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/codec" +) + +// EnsureGrantIndexes runs the deferred grant-index build NOW if one is +// pending, and retires the pending marker. The by_principal index is +// inline for connector-emitted grants but deferred for expansion/synth +// writes; the dangling-principal scan (I9) needs it complete. This is +// the SAME build EndSync would run, so the marker must clear here or +// EndSync repeats the whole O(grants) scan/build a second time. +// +// CALLER CONTRACT — WRITE QUIESCENCE REQUIRED: unlike EndSync, which +// seals the engine before its rebuild so a straggler writer blocked on +// writeMu cannot commit between the rebuild and the marker clear, this +// method cannot seal (the invariant pass's own heal still needs the +// write path). A deferred grant write racing this call could land +// after the rebuild and before the clear — present in the primary +// keyspace, permanently absent from by_principal. The syncer's +// post-collection seam guarantees quiescence (parallelSync has +// drained); any new caller must guarantee the same or use EndSync. +func (e *Engine) EnsureGrantIndexes(ctx context.Context) error { + if e.db == nil { + return ErrEngineClosing + } + if !e.db.DeferredIdxPending() { + return nil + } + if err := e.BuildDeferredGrantIndexes(ctx); err != nil { + return err + } + return e.clearDeferredIdxPending() +} + +// ForEachDanglingGrantPrincipal visits each distinct principal referenced +// by grants for which NO resource row exists. One seek per distinct +// principal over the by_principal index (which leads with principal +// identity) plus one point probe each — O(distinct principals), never +// O(grants). Callers must EnsureGrantIndexes first or the scan misses +// synth-written grants. +// +// matchAnnotatedOnly reports that EVERY grant of the dangling principal +// carries an ExternalResourceMatch* annotation — the legitimate carrier +// shape when no external resource file was configured (the match op +// deletes carriers when it runs, so annotated survivors always mean the +// op didn't run or didn't match). carrierGrants is the number of grant +// rows under such a principal, so callers can report per-GRANT totals. +// Value reads happen only for dangling principals, never on the +// healthy path. +// +// A principal whose index entries are ALL orphans (no primary rows) is +// never visited: it has no grants to judge, so it is healed in place — +// the orphan index keys are deleted — instead of being vacuously +// classified as match-annotated-only. +func (e *Engine) ForEachDanglingGrantPrincipal(ctx context.Context, visit func(principalRT, principalID string, matchAnnotatedOnly bool, carrierGrants int64) error) error { + if e.db == nil { + return ErrEngineClosing + } + prefix := []byte{versionV3, typeIndex, idxGrantByPrincipal} + prefix = codec.AppendTupleSeparator(prefix) + iter, err := e.db.NewIter(&pebble.IterOptions{ + LowerBound: prefix, + UpperBound: upperBoundOf(prefix), + }) + if err != nil { + return err + } + defer iter.Close() + + // Healed-orphan aggregation: one Warn per sweep (the house shape — + // never per-principal logs; a systematic writer bug could strand + // entries for thousands of principals). Orphans are always a bug + // signal, so the aggregate must be visible at default level — and + // it fires on EVERY exit path: heals commit durably as the scan + // goes, so an error/cancellation after the first heal must not + // suppress the only report those heals will ever get (a resumed + // scan finds them already healed and says nothing). + var healedEntries int64 + healedPrincipals := 0 + var healedExamples []string + scanComplete := false + defer func() { + if healedEntries > 0 { + ctxzap.Extract(ctx).Warn("HEALED orphan by_principal index entries (index keys with no grant row — evidence of a writer bug, not connector data)", + zap.Int64("healed_entries", healedEntries), + zap.Int("principals", healedPrincipals), + zap.Strings("principal_examples", healedExamples), + zap.Bool("scan_complete", scanComplete), + ) + } + }() + + for valid := iter.First(); valid; { + if err := ctx.Err(); err != nil { + return err + } + key := iter.Key() + tail := key[len(prefix):] + rtBytes, next, ok := codec.DecodeTupleStringAlias(tail, 0) + if !ok || next >= len(tail) { + return fmt.Errorf("dangling grant-principal scan: malformed index key %x", key) + } + ridBytes, _, ok := codec.DecodeTupleStringAlias(tail, next+1) + if !ok { + return fmt.Errorf("dangling grant-principal scan: malformed index key %x", key) + } + rt, rid := string(rtBytes), string(ridBytes) + exists, err := e.HasResourceRecord(ctx, rt, rid) + if err != nil { + return err + } + if !exists { + matchOnly, carrierGrants, err := e.grantsForPrincipalAllMatchAnnotated(ctx, rt, rid) + if err != nil { + return err + } + switch { + case matchOnly && carrierGrants == 0: + // Every index entry under this principal is an orphan + // (no primary row): there are no grants to judge, so + // neither the match-carrier exemption nor the warn/fail + // arms apply — the "all match-annotated" verdict was + // vacuous. Heal the index garbage instead, so a writer + // bug that strands by_principal entries is scrubbed + // rather than vacuously exempted on every future sweep. + healed, err := e.healOrphanPrincipalIndexEntries(ctx, rt, rid) + if err != nil { + return err + } + if healed > 0 { + healedEntries += healed + healedPrincipals++ + if len(healedExamples) < maxHealedOrphanExamples { + healedExamples = append(healedExamples, rt+"/"+rid) + } + } + default: + if err := visit(rt, rid, matchOnly, carrierGrants); err != nil { + return err + } + } + } + // Skip every remaining grant of this principal. + valid = iter.SeekGE(upperBoundOf(encodeGrantByPrincipalPrefix(rt, rid))) + } + if err := iter.Error(); err != nil { + return err + } + scanComplete = true + return nil +} + +// maxHealedOrphanExamples caps the principal examples on the aggregated +// healed-orphan warning, matching the dangling-reference warnings' shape. +const maxHealedOrphanExamples = 25 + +// invariantWriteOpts returns the write options for invariant-pass +// writes (today: the orphan heal). During a fresh sync they ride +// NoSync — the seal's durability flush hardens them, matching every +// other during-sync write path. +func (e *Engine) invariantWriteOpts() *pebble.WriteOptions { + if e.IsFreshSync() { + return pebble.NoSync + } + return writeOpts(e.opts.durability) +} + +// healOrphanPrincipalIndexEntries deletes by_principal index entries +// whose primary grant row does not exist, for one principal. Identities +// are re-collected and re-probed under the write lock, so an entry whose +// row appeared since the caller's read scan is kept. Returns the number +// of entries healed. +func (e *Engine) healOrphanPrincipalIndexEntries(ctx context.Context, principalRT, principalID string) (int64, error) { + var healed int64 + err := e.withWrite(func() error { + ids, err := e.grantIdentitiesForPrincipal(ctx, principalRT, principalID) + if err != nil { + return err + } + rb := e.db.NewRecordBatch() + defer func() { _ = rb.Close() }() + for _, id := range ids { + if err := ctx.Err(); err != nil { + return err + } + primaryKey := encodeGrantIdentityKey(id) + _, closer, getErr := e.db.Get(primaryKey) + switch { + case errors.Is(getErr, pebble.ErrNotFound): + if err := rb.StageGrantOrphanIndexHeal(primaryKey); err != nil { + return err + } + healed++ + case getErr != nil: + return getErr + default: + closer.Close() + } + } + if healed == 0 { + return nil + } + return rb.Commit(e.invariantWriteOpts()) + }) + if err != nil { + return 0, err + } + if healed > 0 { + ctxzap.Extract(ctx).Debug("healed orphan by_principal index entries", + zap.String("principal_resource_type_id", principalRT), + zap.String("principal_resource_id", principalID), + zap.Int64("healed", healed), + ) + } + return healed, nil +} + +// grantsForPrincipalAllMatchAnnotated reports whether every grant under +// the principal carries an ExternalResourceMatch* annotation, and how +// many carrier grants there are. The count is valid in BOTH outcomes: +// mixed populations (annotated carriers beside plain grants) report +// their carriers too, so the syncer's per-GRANT carrier totals don't +// silently lose the mixed case — the full walk is acceptable because +// this probe runs only for DANGLING principals (reads row values). +func (e *Engine) grantsForPrincipalAllMatchAnnotated(ctx context.Context, principalRT, principalID string) (bool, int64, error) { + ids, err := e.grantIdentitiesForPrincipal(ctx, principalRT, principalID) + if err != nil { + return false, 0, err + } + allCarry := true + var carrierGrants int64 + for _, id := range ids { + if err := ctx.Err(); err != nil { + return false, 0, err + } + rec, err := e.getGrantRecordByIdentity(id) + if err != nil { + if errors.Is(err, pebble.ErrNotFound) { + continue // index entry without a row; the scan tolerates it + } + return false, 0, err + } + if grantRecordHasExternalMatch(rec.GetAnnotations()) { + carrierGrants++ + } else { + allCarry = false + } + } + return allCarry, carrierGrants, nil +} + +// grantIdentitiesForPrincipal collects the grant identities under one +// principal from the by_principal index. Collected before any deletes so +// callers never interleave iteration with writes. +func (e *Engine) grantIdentitiesForPrincipal(ctx context.Context, principalRT, principalID string) ([]grantIdentity, error) { + prefix := encodeGrantByPrincipalPrefix(principalRT, principalID) + iter, err := e.db.NewIter(&pebble.IterOptions{ + LowerBound: prefix, + UpperBound: upperBoundOf(prefix), + }) + if err != nil { + return nil, err + } + defer iter.Close() + + var ids []grantIdentity + for iter.First(); iter.Valid(); iter.Next() { + if err := ctx.Err(); err != nil { + return nil, err + } + tail := iter.Key()[len(prefix):] + var comps [4]string + off := 0 + for i := range comps { + b, next, ok := codec.DecodeTupleStringAlias(tail, off) + if !ok { + return nil, fmt.Errorf("by_principal index: malformed key tail %x", iter.Key()) + } + comps[i] = string(b) + off = next + 1 + } + ids = append(ids, grantIdentity{ + entitlement: entitlementIdentity{ + resourceTypeID: comps[0], + resourceID: comps[1], + stripped: comps[2] == idFlagStripped, + tail: comps[3], + }, + principalTypeID: principalRT, + principalID: principalID, + }) + } + return ids, iter.Error() +} + +func (e *Engine) getGrantRecordByIdentity(id grantIdentity) (*v3.GrantRecord, error) { + val, closer, err := e.db.Get(encodeGrantIdentityKey(id)) + if err != nil { + return nil, err + } + defer closer.Close() + rec := &v3.GrantRecord{} + if err := unmarshalRecord(val, rec); err != nil { + return nil, fmt.Errorf("grant record by identity: unmarshal: %w", err) + } + return rec, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/internal/rawdb/records.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/internal/rawdb/records.go index 3f9d44cc..7da733df 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/internal/rawdb/records.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/internal/rawdb/records.go @@ -165,6 +165,29 @@ func (rb *RecordBatch) StageGrantPutDeferred(key, val []byte, hadOldVal, needsEx return rb.stageGrantDigestInvalidation(key, sep4) } +// StageGrantOrphanIndexHeal stages the removal of ONE orphan +// by_principal index entry — an index key whose grant primary row does +// not exist (a stranded write, never legitimate state). It takes the +// grant PRIMARY key the orphan entry derives from, and derives the +// index key with the same splice every maintained write uses, so the +// heal and the writers can never disagree about the bytes. +// +// Deliberately a distinct op rather than a flavor of StageGrantDelete: +// the primary row is ABSENT, so there is no primary delete to stage +// and no digest invalidation owed (digests fold primary rows; removing +// index garbage changes no partition content). Callers must verify the +// primary row's absence under the write lock before staging — healing +// a live row's index entry would orphan the row from its own index. +func (rb *RecordBatch) StageGrantOrphanIndexHeal(primaryKey []byte) error { + if err := assertFamily("StageGrantOrphanIndexHeal", primaryKey, grantPrimaryPrefix); err != nil { + return err + } + if _, ok := SplitGrantPrimaryKey(primaryKey); !ok { + return fmt.Errorf("rawdb.StageGrantOrphanIndexHeal: grant key %x did not decode as a 6-segment identity", primaryKey) + } + return rb.deleteByPrincipalKey(primaryKey) +} + func (rb *RecordBatch) setByPrincipalKey(key []byte) error { idx, ok := AppendGrantByPrincipalKeyFromPrimary(rb.scratch[:0], key) rb.scratch = idx diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/test_seams.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/test_seams.go index dd40b1c0..2bbe2382 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/test_seams.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/test_seams.go @@ -38,4 +38,22 @@ type testSeams struct { // delta round: the original post-stats placement made that // attribution vacuous). endSyncPreFlushHook func() + + // recordCommitHook, when non-nil, runs immediately before a + // DEFERRED-regime RecordBatch commit — the in-process analog of + // that commit failing AFTER StageGrantPutDeferred already armed + // the durable deferred-index marker. The obligations harness pins + // the resulting state: marker armed (flag AND key — agreement + // holds), zero rows committed, retry converges, sealed index + // complete. Inline-regime commits arm nothing, so they carry no + // post-arm obligation and no hook. + recordCommitHook func() error + + // endSyncStampHook, when non-nil, runs immediately before the + // ended_at stamp's PutSyncRunRecord commit in endSyncFinalize — + // the in-process analog of the stamp commit failing. The + // obligations harness pins that a failed stamp leaks nowhere: the + // stored record stays unstamped and the sync stays discoverable + // as unfinished (resumable). + endSyncStampHook func() error } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/ingest_invariant_store.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/ingest_invariant_store.go new file mode 100644 index 00000000..65ffbdbb --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/ingest_invariant_store.go @@ -0,0 +1,94 @@ +package dotc1z + +import ( + "context" +) + +// IngestInvariantStore is the optional store capability backing the +// syncer's post-collection ingestion invariants (pkg/sync +// ingest_invariants.go): the ordered-key scans the referential +// invariants (I3/I7/I8/I9) ride, plus the point probes their verdicts +// need. Pebble-only; the syncer degrades per-invariant when the store +// lacks it (SQLite artifacts are never scanned). +// +// This is deliberately the READ-ONLY half of the invariant surface: +// the default-mode drop mechanics (DeleteGrantsForPrincipal and +// friends) arrive with the dangling-reference drop policy, and the +// replay-specific facts (external-match existence bits, source-cache +// scope scans) arrive with source-cache replay. +type IngestInvariantStore interface { + // ForEachDistinctGrantEntitlementResource visits each distinct + // entitlement resource referenced by any grant: one seek per + // distinct resource, never O(grants). + ForEachDistinctGrantEntitlementResource(ctx context.Context, visit func(resourceTypeID, resourceID string) error) error + + // GrantsForEntResourceCarryInsertFact reports whether any grant + // under the entitlement resource carries InsertResourceGrants. + // Value-reading; reserved for dangling-reference probes. + GrantsForEntResourceCarryInsertFact(ctx context.Context, resourceTypeID, resourceID string) (bool, error) + + // GrantsForEntitlementAllCarryInsertFact reports whether every grant + // under the entitlement identity carries InsertResourceGrants — the + // per-grant side of I8's InsertResourceGrants exemption. + // Value-reading; reserved for dangling-reference probes. + GrantsForEntitlementAllCarryInsertFact(ctx context.Context, entitlementID, entResourceTypeID, entResourceID string) (bool, error) + + // HasResourceRecord reports whether a resource row exists. + HasResourceRecord(ctx context.Context, resourceTypeID, resourceID string) (bool, error) + + // ForEachDistinctEntitlementResource visits each distinct resource + // referenced by any entitlement row: one seek per distinct + // resource, never O(entitlements). + ForEachDistinctEntitlementResource(ctx context.Context, visit func(resourceTypeID, resourceID string) error) error + + // ForEachDanglingGrantEntitlement visits each distinct entitlement + // referenced by grants that has no entitlement row: one seek plus + // one point probe per distinct entitlement, never O(grants). + ForEachDanglingGrantEntitlement(ctx context.Context, visit func(entitlementID, resourceTypeID, resourceID string) error) error + + // EnsureGrantIndexes forces a pending deferred grant-index build to + // run now, making by_principal complete for the dangling-principal + // scan. Near-free: the same build would run at EndSync. + EnsureGrantIndexes(ctx context.Context) error + + // ForEachDanglingGrantPrincipal visits each distinct principal + // referenced by grants that has no resource row. matchAnnotatedOnly + // reports that every grant of the principal is an unprocessed + // ExternalResourceMatch* carrier (exempt shape); carrierGrants is + // the per-grant count of that population. + ForEachDanglingGrantPrincipal(ctx context.Context, visit func(principalRT, principalID string, matchAnnotatedOnly bool, carrierGrants int64) error) error +} + +var _ IngestInvariantStore = (*pebbleStore)(nil) + +func (s *pebbleStore) ForEachDistinctGrantEntitlementResource(ctx context.Context, visit func(resourceTypeID, resourceID string) error) error { + return s.Engine.ForEachDistinctGrantEntitlementResource(ctx, visit) +} + +func (s *pebbleStore) GrantsForEntResourceCarryInsertFact(ctx context.Context, resourceTypeID, resourceID string) (bool, error) { + return s.Engine.GrantsForEntResourceCarryInsertFact(ctx, resourceTypeID, resourceID) +} + +func (s *pebbleStore) GrantsForEntitlementAllCarryInsertFact(ctx context.Context, entitlementID, entResourceTypeID, entResourceID string) (bool, error) { + return s.Engine.GrantsForEntitlementAllCarryInsertFact(ctx, entitlementID, entResourceTypeID, entResourceID) +} + +func (s *pebbleStore) HasResourceRecord(ctx context.Context, resourceTypeID, resourceID string) (bool, error) { + return s.Engine.HasResourceRecord(ctx, resourceTypeID, resourceID) +} + +func (s *pebbleStore) ForEachDistinctEntitlementResource(ctx context.Context, visit func(resourceTypeID, resourceID string) error) error { + return s.Engine.ForEachDistinctEntitlementResource(ctx, visit) +} + +func (s *pebbleStore) ForEachDanglingGrantEntitlement(ctx context.Context, visit func(entitlementID, resourceTypeID, resourceID string) error) error { + return s.Engine.ForEachDanglingGrantEntitlement(ctx, visit) +} + +func (s *pebbleStore) EnsureGrantIndexes(ctx context.Context) error { + return s.Engine.EnsureGrantIndexes(ctx) +} + +func (s *pebbleStore) ForEachDanglingGrantPrincipal(ctx context.Context, visit func(principalRT, principalID string, matchAnnotatedOnly bool, carrierGrants int64) error) error { + return s.Engine.ForEachDanglingGrantPrincipal(ctx, visit) +} 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 3d00c50e..d0d7391c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go @@ -206,6 +206,21 @@ func GetExportedDefaultValue[T SchemaTypes](s SchemaField) (*T, error) { return GetDefaultValue[T](s) } +// GetSuggestedValue returns the SuggestedValue type-asserted to T, or nil when +// no suggested value is set. It populates the exported schema's suggested_value +// field, which pre-populates the c1 GUI without being injected into resolved +// config. +func GetSuggestedValue[T SchemaTypes](s SchemaField) (*T, error) { + if s.SuggestedValue == nil { + return nil, nil + } + value, ok := s.SuggestedValue.(T) + if !ok { + return nil, ErrWrongValueType + } + return &value, nil +} + func BoolField(name string, optional ...fieldOption) SchemaField { field := SchemaField{ FieldName: name, 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 13850f31..37c79368 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/marshal.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/marshal.go @@ -169,69 +169,98 @@ func schemaFieldToV1(f SchemaField) (*v1_conf.Field, error) { switch f.Variant { case IntVariant: intField := v1_conf.IntField_builder{Rules: f.Rules.i}.Build() - d, err := GetExportedDefaultValue[int](f) + d, err := GetDefaultValue[int](f) if err != nil { return nil, err } if d != nil { intField.SetDefaultValue(int64(*d)) } + s, err := GetSuggestedValue[int](f) + if err != nil { + return nil, err + } + if s != nil { + intField.SetSuggestedValue(int64(*s)) + } field.SetIntField(proto.ValueOrDefault(intField)) case BoolVariant: boolField := v1_conf.BoolField_builder{Rules: f.Rules.b}.Build() - d, err := GetExportedDefaultValue[bool](f) + d, err := GetDefaultValue[bool](f) if err != nil { return nil, err } if d != nil { boolField.SetDefaultValue(*d) } + s, err := GetSuggestedValue[bool](f) + if err != nil { + return nil, err + } + if s != nil { + boolField.SetSuggestedValue(*s) + } field.SetBoolField(proto.ValueOrDefault(boolField)) case StringSliceVariant: stringSliceField := v1_conf.StringSliceField_builder{Rules: f.Rules.ss}.Build() - d, err := GetExportedDefaultValue[[]string](f) + d, err := GetDefaultValue[[]string](f) if err != nil { return nil, err } if d != nil { stringSliceField.SetDefaultValue(*d) } + s, err := GetSuggestedValue[[]string](f) + if err != nil { + return nil, err + } + if s != nil { + stringSliceField.SetSuggestedValue(*s) + } field.SetStringSliceField(proto.ValueOrDefault(stringSliceField)) case StringMapVariant: stringMapField := v1_conf.StringMapField_builder{Rules: f.Rules.sm}.Build() - d, err := GetExportedDefaultValue[map[string]any](f) + d, err := GetDefaultValue[map[string]any](f) if err != nil { return nil, err } if d != nil { - // Convert map[string]any to map[string]*anypb.Any - anyMap := make(map[string]*anypb.Any) - for k, v := range *d { - // Convert the value to a structpb.Value - value, err := structpb.NewValue(v) - if err != nil { - return nil, fmt.Errorf("failed to convert map value to structpb.Value: %w", err) - } - anyValue, err := anypb.New(value) - if err != nil { - return nil, fmt.Errorf("failed to convert structpb.Value to Any: %w", err) - } - anyMap[k] = anyValue + anyMap, err := anyMapFromStringMap(*d) + if err != nil { + return nil, err } stringMapField.SetDefaultValue(anyMap) } + s, err := GetSuggestedValue[map[string]any](f) + if err != nil { + return nil, err + } + if s != nil { + anyMap, err := anyMapFromStringMap(*s) + if err != nil { + return nil, err + } + stringMapField.SetSuggestedValue(anyMap) + } field.SetStringMapField(proto.ValueOrDefault(stringMapField)) case StringVariant: stringField := v1_conf.StringField_builder{Rules: f.Rules.s}.Build() - d, err := GetExportedDefaultValue[string](f) + d, err := GetDefaultValue[string](f) if err != nil { return nil, err } if d != nil { stringField.SetDefaultValue(*d) } + sv, err := GetSuggestedValue[string](f) + if err != nil { + return nil, err + } + if sv != nil { + stringField.SetSuggestedValue(*sv) + } switch f.ConnectorConfig.FieldType { case Text: @@ -256,3 +285,19 @@ func schemaFieldToV1(f SchemaField) (*v1_conf.Field, error) { return field, nil } + +func anyMapFromStringMap(m map[string]any) (map[string]*anypb.Any, error) { + anyMap := make(map[string]*anypb.Any, len(m)) + for k, v := range m { + value, err := structpb.NewValue(v) + if err != nil { + return nil, fmt.Errorf("failed to convert map value to structpb.Value: %w", err) + } + anyValue, err := anypb.New(value) + if err != nil { + return nil, fmt.Errorf("failed to convert structpb.Value to Any: %w", err) + } + anyMap[k] = anyValue + } + return anyMap, 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 0966471b..c3a06f90 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.19.1" +const Version = "v0.20.1" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/drop_stats.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/drop_stats.go new file mode 100644 index 00000000..6261ebdc --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/drop_stats.go @@ -0,0 +1,102 @@ +package expand + +import ( + "context" + "sync" + + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" +) + +// DroppedEdgeStats aggregates expansion edges dropped because a +// referenced entitlement has no row — connector magic-id bugs and +// disabled-by-default resource types. Production measured ~2.9M +// per-edge warnings a week from these sites, dominated by a few +// thousand distinct ids, so per-edge logging is demoted to Debug and +// ONE aggregated warning per sync (emitted by the syncer when +// expansion completes) carries the totals and a capped sample of +// distinct ids — the same reporting shape as the ingestion invariants' +// dangling-reference warnings. +// +// One instance lives on the syncer for the whole sync (the Expander is +// reconstructed every step); guarded for parallel use. In-memory only: +// a resume after a crash undercounts, which is acceptable for +// observability. +type DroppedEdgeStats struct { + mu sync.Mutex + sourceMissing int64 + destinationMissing int64 + seen map[string]struct{} + examples []string +} + +const maxDroppedEdgeExamples = 25 + +func (s *DroppedEdgeStats) record(entitlementID string, dest bool, edges int64) { + if s == nil || edges <= 0 { + return + } + s.mu.Lock() + defer s.mu.Unlock() + if dest { + s.destinationMissing += edges + } else { + s.sourceMissing += edges + } + if s.seen == nil { + s.seen = map[string]struct{}{} + } + if _, ok := s.seen[entitlementID]; ok { + return + } + s.seen[entitlementID] = struct{}{} + if len(s.examples) < maxDroppedEdgeExamples { + s.examples = append(s.examples, entitlementID) + } +} + +// RecordSourceMissing counts ONE edge dropped because its SOURCE +// entitlement has no row. +func (s *DroppedEdgeStats) RecordSourceMissing(entitlementID string) { + s.record(entitlementID, false, 1) +} + +// RecordSourceMissingEdges counts a BATCH of edges sharing one missing +// source entitlement (the legacy expander drops a whole action's edges +// when the shared source is gone — the total must count every edge, not +// the batch). +func (s *DroppedEdgeStats) RecordSourceMissingEdges(entitlementID string, edges int) { + s.record(entitlementID, false, int64(edges)) +} + +// RecordDestinationMissing counts ONE edge dropped because its +// DESTINATION entitlement has no row. +func (s *DroppedEdgeStats) RecordDestinationMissing(entitlementID string) { + s.record(entitlementID, true, 1) +} + +// RecordDestinationMissingEdges counts every incoming edge skipped when +// one destination entitlement has no row (the topological path skips the +// destination's whole reduction — all of its incoming edges — at once). +func (s *DroppedEdgeStats) RecordDestinationMissingEdges(entitlementID string, edges int) { + s.record(entitlementID, true, int64(edges)) +} + +// LogSummary emits the one aggregated warning for the sync, if any +// edges were dropped. Safe on nil. +func (s *DroppedEdgeStats) LogSummary(ctx context.Context) { + if s == nil { + return + } + s.mu.Lock() + defer s.mu.Unlock() + if s.sourceMissing == 0 && s.destinationMissing == 0 { + return + } + ctxzap.Extract(ctx).Warn("grant expansion: DROPPED edges referencing entitlements with no entitlement row (connector bug or resource type not enabled — check magic-id construction)", + zap.Int64("edges_missing_source_entitlement", s.sourceMissing), + zap.Int64("edges_missing_destination_entitlement", s.destinationMissing), + zap.Int("distinct_missing_entitlements", len(s.seen)), + zap.Strings("entitlement_id_examples", s.examples), + ) +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/expander.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/expander.go index c54e25b4..034a1d14 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/expander.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/expander.go @@ -137,6 +137,15 @@ type entitlementGrantPrincipalKeyLister interface { type Expander struct { store ExpanderStore graph *EntitlementGraph + // dropStats, when set, aggregates dropped-edge reporting for the + // whole sync (the syncer owns it across step-wise Expander + // reconstruction). Nil is safe: recording no-ops. + dropStats *DroppedEdgeStats +} + +// SetDropStats installs the sync-scoped dropped-edge aggregator. +func (e *Expander) SetDropStats(s *DroppedEdgeStats) { + e.dropStats = s } // NewExpander creates a new Expander with the given store and graph. @@ -419,7 +428,12 @@ func (e *Expander) runAction(ctx context.Context, action *EntitlementGraphAction // drop them all and complete the action. Mirrors the inline handling // of missing destinations below. (MarkEdgeExpanded no-ops on deleted // edges, so returning "" here completes the action cleanly.) - l.Warn("runAction: source entitlement not found, dropping batch edges", + // Per-edge logging is Debug: production measured millions of + // these a week; the aggregate warning (DroppedEdgeStats) is + // the per-sync report. The batch shares one source, but every + // destination edge drops — count them all. + e.dropStats.RecordSourceMissingEdges(action.SourceEntitlementID, len(dests)) + l.Debug("runAction: source entitlement not found, dropping batch edges", zap.String("source_entitlement_id", action.SourceEntitlementID)) for _, d := range dests { _ = e.graph.DeleteEdge(ctx, action.SourceEntitlementID, d.EntitlementID) @@ -453,8 +467,9 @@ func (e *Expander) runAction(ctx context.Context, action *EntitlementGraphAction if err != nil { if status.Code(err) == codes.NotFound { // A single missing descendant drops only its own edge; the rest - // of the batch still expands. - l.Warn("runAction: descendant entitlement not found, dropping edge", + // of the batch still expands. Debug + aggregate, as above. + e.dropStats.RecordDestinationMissing(d.EntitlementID) + l.Debug("runAction: descendant entitlement not found, dropping edge", zap.String("descendant_entitlement_id", d.EntitlementID)) _ = e.graph.DeleteEdge(ctx, action.SourceEntitlementID, d.EntitlementID) continue diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge.go index 594df7c2..c3b35807 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge.go @@ -399,9 +399,14 @@ func (e *Expander) driveTopologicalLayer( destEntitlement := entitlements[destID] if destEntitlement == nil { // Same drop-don't-fail policy as the legacy expander's - // missing-descendant handling, but say so: silently zeroing - // a subtree of expansion is undiagnosable in production. - ctxzap.Extract(ctx).Warn("topological expansion: destination entitlement not in store; skipping its reduction", + // missing-descendant handling. Recorded on the sync-wide + // aggregate (one warning per sync with distinct-id + // examples); per-edge logging stays at Debug so a large + // dangling family can't flood the logs. Skipping this + // destination skips its ENTIRE reduction — every incoming + // edge — so the total counts each one. + e.dropStats.RecordDestinationMissingEdges(destID, len(incoming)) + ctxzap.Extract(ctx).Debug("topological expansion: destination entitlement not in store; skipping its reduction", zap.String("entitlement_id", destID)) continue } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge_projection.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge_projection.go index d2081d93..a8cf4b05 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge_projection.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/expand/topological_merge_projection.go @@ -162,9 +162,13 @@ func (e *Expander) mergeDestinationStreams( for _, sourceID := range sortedCopy(sourceNode.EntitlementIDs) { sourceEntitlement := entitlements[sourceID] if sourceEntitlement == nil { - // Drop-don't-fail, but loudly (see the destination-side - // warning in driveTopologicalLayer). - ctxzap.Extract(ctx).Warn("topological expansion: source entitlement not in store; its contributions are skipped", + // Drop-don't-fail, recorded on the sync-wide aggregate + // (one warning per sync — see DroppedEdgeStats and the + // destination-side twin in driveTopologicalLayer); + // per-edge logging stays at Debug so a large dangling + // family can't flood the logs. + e.dropStats.RecordSourceMissing(sourceID) + ctxzap.Extract(ctx).Debug("topological expansion: source entitlement not in store; its contributions are skipped", zap.String("entitlement_id", sourceID)) continue } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go new file mode 100644 index 00000000..22b47137 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go @@ -0,0 +1,1135 @@ +package sync //nolint:revive,nolintlint // we can't change the package name for backwards compatibility + +// Ingestion invariants: store-derived definitions of the syncer's +// side effects, evaluated at a post-collection seam. +// +// Background. The syncer historically attached side effects (flags, +// scheduled actions, derived rows, validation) to the connector-response +// ingest loop. That is correct only while response pages are the only +// way rows enter the store; any second ingestion path (source-cache +// replay, bulk import, compaction merges) turns every stream-coupled +// side effect into a latent bug. Rather than mirroring each side effect +// once per ingestion path (unmarked coupling, rediscovered by review), +// each side effect is defined as a function of the store and evaluated +// here, after every writer has finished: +// +// - I3 grant→resource referential integrity: post-collection prefix +// skip-scan over the grant keyspace. Dangling ref + an +// InsertResourceGrants-annotated grant = hard violation (the +// related-resource machinery lost a row); dangling without the +// annotation = aggregated warning (tolerated connector behavior). +// Pebble-only (the scan rides the pebble key order); full syncs only. +// - I4 child-scheduling completeness: every stored resource carrying +// ChildResourceType must have had its (childType, parent) action +// scheduled. Check-only; skipped when the resources phase did not +// run in this process (a zero-row child listing leaves no store +// evidence that its action ran). Full syncs only. FAIL-FAST ONLY: +// the check costs a full post-collection resource scan and its +// default outcome was only ever a warning, so production (default) +// skips it entirely — tests and equivalence harnesses enforce it. +// - I5 exclusion-group validation: the stored entitlement keyspace is +// validated post-collection (one default per group, one resource +// type per group, size cap). This REPLACES the former streaming +// validation entirely — it is engine-agnostic and covers fresh and +// generated (static) entitlements uniformly, however rows arrived. +// Runs on every sync type: a conflict needs both rows present, so +// partial-store evidence is always valid evidence. +// - I7 entitlement→resource referential integrity: post-collection +// prefix skip-scan over the entitlement keyspace (one seek per +// distinct resource). Per-resource entitlement scopes cannot dangle +// by construction (the scope is only visited when the resource was +// synced); the exposure is TYPE-scoped listings and magic-id +// construction bugs in connectors. +// - I8 grant→entitlement referential integrity: post-collection +// skip-scan over the grant keyspace at entitlement-identity +// granularity plus one point probe per distinct entitlement. +// Exposure: dominantly, connector magic-id bugs — annotations and +// grants naming entitlement ids the entitlement enumeration never +// produced (production expansion drops millions of edges per week +// to this class). EXEMPT: grants under InsertResourceGrants pages +// (the machinery inserts the resource; no listing returns an +// entitlement for it — an established shape). +// - I9 grant→principal referential integrity: dangling-principal scan +// over the by_principal index (one seek + probe per distinct +// principal; a pending deferred index build is forced first, which +// just moves EndSync's own pass earlier). EXEMPT: grants carrying +// ExternalResourceMatch* annotations — unprocessed match carriers +// are evidence that no external resource file was configured, not +// bad data (the match op deletes carriers when it runs). +// +// I7/I8/I9 verdicts are aggregated warnings in default mode, split by +// whether the referent's resource TYPE was synced: +// +// - Never-synced-type danglings (a CONFIG gap: typically a type added +// to the connector after the instance was configured and left +// disabled by default). The platform's ingestion provably discards +// such rows anyway; a later change may drop them at seal, with this +// warning's aggregates as the fleet evidence for that flip. +// - Synced-type danglings (the id was constructed for a row the +// enumeration never produced — a magic-id BUG, or a connector +// emitting grants for rows it never listed). Attributed in the same +// aggregate; never a per-row log line (the expansion path's +// per-edge warnings produce millions of lines a week in production). +// +// FAIL-FAST mode (tests, equivalence harnesses) hard-fails every +// dangling so engineered violations are named. See the verdict table +// (ingestInvariants) for the per-invariant policy matrix; the table is +// the single dispatcher input, so a policy hole is a missing row, not a +// missing if-branch. +// +// Evidence is monotone (existence probes, set-union scheduling +// records), so parallel workers and any arrival order yield identical +// verdicts; checks run at a phase-quiesced point, so they are +// deterministic and idempotent under crash/resume. +// +// Not yet here (extraction staging from the replay branch): I1/I2 +// store-derived fact probes and the warm/cold ErrReplayIntegrity +// verdict ladder arrive with source-cache replay; the never-synced-type +// drop arms (and their aggregated DROPPED reporting) arrive with the +// dangling-reference drop policy. + +import ( + "context" + "errors" + "fmt" + "sort" + stdsync "sync" + + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/anypb" + + c1zpb "github.com/conductorone/baton-sdk/pb/c1/c1z/v1" + v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" + "github.com/conductorone/baton-sdk/pkg/connectorstore" + "github.com/conductorone/baton-sdk/pkg/dotc1z" +) + +// ErrIngestInvariantViolated classifies DATA VERDICTS — the store's +// content violates an invariant — as distinct from the pass's own IO +// failures (listing errors, probe errors, cancellation). A verdict is +// deterministic on an immutable dataset: retrying it re-fails forever, +// so runners map it to their non-retryable failure class +// (pkg/tasks/c1api wraps it with ErrTaskNonRetryable), while IO +// failures stay retryable. Test with errors.Is. +var ErrIngestInvariantViolated = errors.New("ingest invariant violated") + +// invariantVerdictError carries the sentinel WITHOUT altering the +// verdict's message (operator-facing text and the error-string +// assertions in the suites stay byte-identical). +type invariantVerdictError struct{ err error } + +func (e *invariantVerdictError) Error() string { return e.err.Error() } + +func (e *invariantVerdictError) Unwrap() []error { + return []error{e.err, ErrIngestInvariantViolated} +} + +// invariantVerdict marks err as a data verdict. +func invariantVerdict(err error) error { return &invariantVerdictError{err: err} } + +// sideEffectAnnotationCoverage is the enumerated coupling between +// connector annotations that imply syncer side effects and the mechanism +// that guarantees them independent of ingestion path. This map IS the +// audit that review rounds used to re-derive from memory; the +// completeness meta-test (ingest_invariants_test.go) fails when a listed +// annotation loses its mapping, and NEW side-effect-implying annotations +// must be added here with an invariant (or a documented exclusion) +// before they ship. +// +// I1 and I2 are registered against today's stream-coupled mechanisms: +// they are correct while the response loop is the only ingestion path, +// and are superseded by store-derived probes when source-cache replay +// adds a second one (see ingestInvariantExclusions in the meta-test). +// When the type-scoped listing annotations (TypeScopedEntitlements, +// TypeScopedGrants) land, they register here against I7 and I8 +// respectively — type-granularity scopes are exactly the shapes those +// referential checks exist for. +var sideEffectAnnotationCoverage = map[string]string{ + "c1.connector.v2.GrantExpandable": "I1: response-loop expansion arming (SetNeedsExpansion) + needs_expansion column persistence; store-derived probe arrives with replay", + "c1.connector.v2.ExternalResourceMatch": "I2: response-loop match arming (SetHasExternalResourcesGrants); store-derived existence-bit repair arrives with replay", + "c1.connector.v2.ExternalResourceMatchAll": "I2: response-loop match arming (SetHasExternalResourcesGrants); store-derived existence-bit repair arrives with replay", + "c1.connector.v2.ExternalResourceMatchID": "I2: response-loop match arming (SetHasExternalResourcesGrants); store-derived existence-bit repair arrives with replay", + "c1.connector.v2.InsertResourceGrants": "I3: grant→resource referential check post-collection", + "c1.connector.v2.ChildResourceType": "I4: scheduled-set completeness check post-collection", + "c1.connector.v2.EntitlementExclusionGroup": "I5: stored-keyspace validation post-collection", +} + +// childScheduleSet is the monotone record of scheduled child-resource +// actions, keyed (childTypeID, parentTypeID, parentID). Guarded for +// parallel workers; in-memory only (see the I4 resume caveat). +type childScheduleSet struct { + mu stdsync.Mutex + m map[string]struct{} +} + +func childScheduleKey(childTypeID, parentTypeID, parentID string) string { + return childTypeID + "\x00" + parentTypeID + "\x00" + parentID +} + +// recordIfNew records the pair and reports whether it was NEW this sync. +// The set doubles as the scheduling dedupe: a parent can be discovered +// more than once in one sync, and its children only need one +// SyncResourcesOp per pair — the second discovery would double the +// child-listing work. Atomic check-and-set so parallel workers can't +// both see "new". +func (c *childScheduleSet) recordIfNew(childTypeID, parentTypeID, parentID string) bool { + c.mu.Lock() + defer c.mu.Unlock() + if c.m == nil { + c.m = make(map[string]struct{}) + } + key := childScheduleKey(childTypeID, parentTypeID, parentID) + if _, ok := c.m[key]; ok { + return false + } + c.m[key] = struct{}{} + return true +} + +func (c *childScheduleSet) has(childTypeID, parentTypeID, parentID string) bool { + c.mu.Lock() + defer c.mu.Unlock() + _, ok := c.m[childScheduleKey(childTypeID, parentTypeID, parentID)] + return ok +} + +// IngestInvariantsPolicy parameterizes one run of the ingestion +// invariant pass. The exported fields are the caller contract (the +// syncer today; a store-producing pipeline like the compactor's expand +// pass can run the same pass without a syncer). The unexported fields +// carry syncer-private evidence (the in-memory I4 schedule set) and the +// test-only halt hook; external callers leave them zero and the +// affected invariants degrade per their gates. +type IngestInvariantsPolicy struct { + // ActiveSyncID scopes every store read to the sync under judgment. + ActiveSyncID string + // SyncType gates the full-keyspace invariants: store-derived + // referential verdicts are only evaluable over a COMPLETE keyspace, + // so I3/I4/I7/I8/I9 run on full syncs only. I5 runs on every sync + // type (a conflict requires both rows present — valid evidence on a + // partial store). + SyncType connectorstore.SyncType + // FailFast promotes every invariant verdict to a hard, + // plainly-attributed failure: tolerated warns fail, and I4 (skipped + // entirely in default mode) runs. Tests and equivalence harnesses + // set it. + FailFast bool + // CompactionMerge marks a pass over a PRE-SEALED artifact this + // process did not collect — the compactor's keep-newer merge + // (whose key union manufactures shapes no single input contained: + // dangling references, stranded InsertResourceGrants rows, + // exclusion-group conflicts) and rollback-expansion's replay + // (whose inputs include such merged artifacts). Verdicts that + // would blame the connector are attributed to the merge and hard + // arms soften to aggregated warnings: the hard arms exist to stop + // a NEW collection from sealing bad data, not to re-adjudicate an + // artifact that already sealed. A normal connector sync must never + // set this. + CompactionMerge bool + + // I4 evidence: only a process that ran the resources phase can + // supply the in-memory scheduled set, so only the syncer sets these. + childSchedule *childScheduleSet + resourcesPhaseRan bool + syncResourceTypes []string + + // halt, when non-nil, fires at named seams of the pass (see + // ingestInvariantHaltStages); returning an error fails the sync at + // exactly that boundary. Test-only. + halt func(stage string) error +} + +// ingestInvariantsPass is the per-run state shared by the checks: the +// store handles and the policy. +type ingestInvariantsPass struct { + store connectorstore.Reader + // facts is the optional pebble inspection surface; nil degrades + // every requiresStore invariant (SQLite artifacts are never + // scanned). + facts dotc1z.IngestInvariantStore + p *IngestInvariantsPolicy +} + +func (pass *ingestInvariantsPass) haltAt(stage string) error { + if pass.p.halt == nil { + return nil + } + return pass.p.halt(stage) +} + +// ingestInvariant is one row of the verdict table: the policy matrix +// entry AND the dispatch entry for a single invariant. The dispatcher +// consumes the table in order, so gating lives here once — a +// policy hole is a missing row or a wrong field, both of which the +// completeness meta-test (ingest_invariants_test.go) and the fail-fast +// suite pin — instead of an if-branch inside a check body. +type ingestInvariant struct { + // id is the invariant's name in docs, log lines, and the + // sideEffectAnnotationCoverage registry ("I5"). + id string + // runsOnAllSyncTypes: false gates the check to full syncs (complete + // keyspace); true runs it on partial syncs too. + runsOnAllSyncTypes bool + // requiresStore: the check needs the pebble inspection surface + // (dotc1z.IngestInvariantStore) and degrades to a no-op without it. + requiresStore bool + // failFastOnly: the check ONLY runs under FailFast (I4's + // full-resource-scan cost is a bad trade for a default-mode + // warning). + failFastOnly bool + // failFastPromotes: under FailFast the check's tolerated + // warn-verdicts become hard failures. Enforced by the fail-fast + // test suite; documented here so the matrix is one artifact. + failFastPromotes bool + // ridesReplayLadder: the check's FAIL-class verdicts wrap + // ErrReplayIntegrity on warm syncs for the runners' cold-retry + // ladder. Always false until source-cache replay lands; the + // meta-test pins that so the field cannot silently pre-enable. + ridesReplayLadder bool + // haltStage, when non-empty, names the test-only halt seam fired + // AFTER this invariant completes. + haltStage string + // check is a method expression on the pass (receiver-first calling + // convention). + check func(pass *ingestInvariantsPass, ctx context.Context) error +} + +// ingestInvariants is the verdict table, in evaluation order: the +// hard-fail class (I5) runs first — behavior-criticality, not cost, +// orders the table (I5's full entitlement listing is mechanically the +// most expensive read here; it goes first so a seal-blocking verdict +// surfaces before the cheaper warn-class scans spend their seeks). +// The relative order of the +// referential family (I7, I3, I8, I9) is load-bearing for the future +// drop arms (I7 dropping dangling entitlements orphans their grants, +// which I8 then catches; I9 runs last over whatever grants survive) — +// keep it even while the checks are read-only so the drop flip cannot +// reorder verdicts. +var ingestInvariants = []ingestInvariant{ + { + id: "I5", + runsOnAllSyncTypes: true, + // Hard failure on connector-produced stores; the compaction + // expand pass aggregates merge-manufactured conflicts into a + // warning, which fail-fast promotes back to a failure. + failFastPromotes: true, + haltStage: "invariants-I5-complete", + check: (*ingestInvariantsPass).checkStoredExclusionGroups, + }, + { + id: "I4", + failFastOnly: true, + failFastPromotes: true, // the whole check exists only under fail-fast + check: (*ingestInvariantsPass).checkChildScheduling, + }, + { + id: "I7", + requiresStore: true, + failFastPromotes: true, + haltStage: "invariants-I7-complete", + check: (*ingestInvariantsPass).checkEntitlementResourceReferences, + }, + { + id: "I3", + requiresStore: true, + failFastPromotes: true, + haltStage: "invariants-I3-complete", + check: (*ingestInvariantsPass).checkGrantResourceReferences, + }, + { + id: "I8", + requiresStore: true, + failFastPromotes: true, + haltStage: "invariants-I8-complete", + check: (*ingestInvariantsPass).checkGrantEntitlementReferences, + }, + { + id: "I9", + requiresStore: true, + failFastPromotes: true, + check: (*ingestInvariantsPass).checkGrantPrincipalReferences, + }, +} + +// haltStageI9IndexesEnsured fires INSIDE I9, between the forced +// deferred-index build (marker durably cleared) and the dangling scan: +// a crash there must resume without EndSync repeating the O(grants) +// rebuild and with I9 re-scanning cleanly. +const haltStageI9IndexesEnsured = "invariants-I9-indexes-ensured" + +// haltStageInvariantsComplete fires at the syncer seam AFTER the whole +// pass, before the checkpoint/EndSync: a resumed sync re-runs the +// entire pass over the same state, so every check must be idempotent. +const haltStageInvariantsComplete = "ingest-invariants-complete" + +// ingestInvariantHaltStages enumerates every halt seam the pass can +// fire, in firing order — the halt sweep iterates this list, so a new +// stage is swept by construction, and the meta-test pins +// uniqueness/nonemptiness. +func ingestInvariantHaltStages() []string { + stages := make([]string, 0, len(ingestInvariants)+2) + for _, inv := range ingestInvariants { + if inv.id == "I9" { + stages = append(stages, haltStageI9IndexesEnsured) + } + if inv.haltStage != "" { + stages = append(stages, inv.haltStage) + } + } + return append(stages, haltStageInvariantsComplete) +} + +// RunIngestInvariants evaluates the post-collection ingestion +// invariants over store, per the verdict table (ingestInvariants) and +// policy. Callers run it at a quiesced point — after every ingestion +// path has finished writing and before the sync is sealed — so a +// violating store is never published as complete. Idempotent: a +// resumed run re-evaluates with the same verdicts. +// +// The syncer is one caller (runIngestionInvariants); the pass is a +// store-level function so store-producing pipelines without a syncer +// (the compactor's expand pass) can enforce the same contract. +func RunIngestInvariants(ctx context.Context, store connectorstore.Reader, policy IngestInvariantsPolicy) error { + if store == nil { + return fmt.Errorf("ingest invariants: store is required") + } + // Fail closed on a zero SyncType: connectorstore's zero value is + // SyncTypeAny (""), which is not SyncTypeFull — a caller omitting + // the field would silently skip every full-keyspace invariant and + // read a green pass that validated almost nothing. + if policy.SyncType == "" { + return fmt.Errorf("ingest invariants: policy.SyncType is required (the zero value would silently skip the full-keyspace invariants; pass the sync's actual type)") + } + pass := &ingestInvariantsPass{store: store, p: &policy} + if facts, ok := store.(dotc1z.IngestInvariantStore); ok { + pass.facts = facts + } + var skippedNoStore []string + for i := range ingestInvariants { + inv := &ingestInvariants[i] + if !inv.runsOnAllSyncTypes && policy.SyncType != connectorstore.SyncTypeFull { + continue + } + if inv.requiresStore && pass.facts == nil { + // Engine without the inspection surface (SQLite): the + // referential invariants degrade by design, but the + // downgrade must be visible — a sealed artifact that was + // never referentially validated should not be + // indistinguishable from one that passed. + skippedNoStore = append(skippedNoStore, inv.id) + continue + } + if inv.failFastOnly && !policy.FailFast { + continue + } + if err := inv.check(pass, ctx); err != nil { + return err + } + if inv.haltStage != "" { + if err := pass.haltAt(inv.haltStage); err != nil { + return err + } + } + } + if len(skippedNoStore) > 0 { + ctxzap.Extract(ctx).Info("ingest invariants: store engine lacks the inspection surface; referential invariants were not evaluated", + zap.Strings("skipped_invariants", skippedNoStore), + ) + } + return nil +} + +// runIngestionInvariants is the syncer's call into the pass: policy +// from syncer state, evidence from the in-memory schedule set, halt +// hook from the test seam. +func (s *syncer) runIngestionInvariants(ctx context.Context) error { + policy := IngestInvariantsPolicy{ + ActiveSyncID: s.getActiveSyncID(), + SyncType: s.syncType, + FailFast: s.failFastInvariants, + CompactionMerge: s.compactionMergedStore, + childSchedule: &s.childSchedule, + resourcesPhaseRan: s.resourcesPhaseRanHere, + syncResourceTypes: s.syncResourceTypes, + } + if s.testIngestHaltHook != nil { + policy.halt = s.testIngestHaltHook + } + return RunIngestInvariants(ctx, s.store, policy) +} + +// exclusionGroupTracker is the pure validation core behind invariant I5: +// one default per group, one resource type per group, at most +// maxEntitlementsPerExclusionGroup members. Error text intentionally +// matches the retired streaming validator. Recording the same +// entitlement twice is idempotent for the default check but counts twice +// toward the cap — callers feed each stored entitlement exactly once +// (the store keyspace holds one row per entitlement id). +type exclusionGroupTracker struct { + groups map[string]*exclusionGroupState +} + +type exclusionGroupState struct { + resourceTypeID string + defaultEntID string + count uint32 +} + +// exclusionGroupViolation is the typed verdict record returns: it +// carries the offending group id so the warn-only aggregation can +// count LOGICAL conflicts (distinct groups) instead of violating rows — +// an oversized group would otherwise report one "conflict" per excess +// row and crowd every example slot with near-identical strings. +type exclusionGroupViolation struct { + groupID string + err error +} + +func (v *exclusionGroupViolation) Error() string { return v.err.Error() } +func (v *exclusionGroupViolation) Unwrap() error { return v.err } + +func (t *exclusionGroupTracker) record(ent *v2.Entitlement) error { + // Every EntitlementExclusionGroup annotation is JUDGED, not just + // the first (Pick-first would let a second annotation carry an + // unseen is_default or a cross-type membership — a hostile or + // malformed connector shape, but one the stored keyspace + // faithfully holds and the validator must therefore see). The + // member CAP, however, counts DISTINCT ENTITLEMENTS per group — + // exactly what its error message claims — so duplicate annotations + // naming the same group on one entitlement validate their rules + // without inflating the count (one entitlement with 51 copies of + // the same annotation is degenerate data, not a 51-member group). + var counted map[string]bool + for _, a := range ent.GetAnnotations() { + if !a.MessageIs((*v2.EntitlementExclusionGroup)(nil)) { + continue + } + eg := &v2.EntitlementExclusionGroup{} + if err := a.UnmarshalTo(eg); err != nil { + return fmt.Errorf("parsing exclusion group on %q: %w", ent.GetId(), err) + } + groupID := eg.GetExclusionGroupId() + if groupID == "" { + continue + } + if counted == nil { + counted = map[string]bool{} + } + if err := t.recordMembership(ent, eg, counted[groupID]); err != nil { + return err + } + counted[groupID] = true + } + return nil +} + +// recordMembership applies the group rules to one (entitlement, +// exclusion-group annotation) membership. alreadyCounted suppresses +// the cap increment for repeat annotations of the same group on the +// same entitlement; the type and default rules always apply. +func (t *exclusionGroupTracker) recordMembership(ent *v2.Entitlement, eg *v2.EntitlementExclusionGroup, alreadyCounted bool) error { + groupID := eg.GetExclusionGroupId() + if t.groups == nil { + t.groups = map[string]*exclusionGroupState{} + } + st := t.groups[groupID] + if st == nil { + st = &exclusionGroupState{} + t.groups[groupID] = st + } + rt := ent.GetResource().GetId().GetResourceType() + if st.resourceTypeID == "" { + st.resourceTypeID = rt + } else if st.resourceTypeID != rt { + return &exclusionGroupViolation{groupID: groupID, err: fmt.Errorf( + "exclusion group %q is used on multiple resource types (%q and %q); "+ + "exclusion groups may span resources but must be scoped to a single resource type", + groupID, st.resourceTypeID, rt)} + } + if eg.GetIsDefault() { + if st.defaultEntID != "" && st.defaultEntID != ent.GetId() { + return &exclusionGroupViolation{groupID: groupID, err: fmt.Errorf( + "exclusion group %q has multiple default entitlements (%q and %q); "+ + "at most one entitlement per exclusion group may set is_default=true", + groupID, st.defaultEntID, ent.GetId())} + } + st.defaultEntID = ent.GetId() + } + if alreadyCounted { + return nil + } + st.count++ + if st.count > maxEntitlementsPerExclusionGroup { + return &exclusionGroupViolation{groupID: groupID, err: fmt.Errorf( + "exclusion group %q has too many entitlements (%d); "+ + "at most %d entitlements are allowed per exclusion group", + groupID, st.count, maxEntitlementsPerExclusionGroup)} + } + return nil +} + +// checkStoredExclusionGroups is invariant I5: exclusion-group +// invariants validated over the STORED entitlement keyspace. This is +// the sole exclusion-group validation: it covers fresh and generated +// (static) entitlements uniformly, on every engine, regardless of how +// rows arrived — the page-level streaming validator it replaced could +// not see rows a non-stream ingestion path wrote. A verdict on a +// connector-produced store is a hard failure (a conflicting artifact +// must not seal). +// +// The compaction expand pass (CompactionMerge) is the exception: it +// runs over a keep-newer MERGE of individually-valid syncs, and the +// key union can manufacture conflicts no input contained — a default +// moved from E1 to E2 keeps both rows' is_default, a group grown +// across generations exceeds the member cap, a group id reused on a +// new resource type collides with retained old rows. Failing would +// reject an artifact the merge produced by design (the same class +// I3/I7/I8/I9 exempt), so expand-only runs aggregate into one warning +// instead. Fail-fast still hard-fails everything. +func (pass *ingestInvariantsPass) checkStoredExclusionGroups(ctx context.Context) error { + // warnOnly: merge-manufactured conflicts are expected shapes on the + // expand pass, not seal-blockers. + warnOnly := pass.p.CompactionMerge && !pass.p.FailFast + tracker := &exclusionGroupTracker{} + // Conflicts are counted per GROUP, not per violating row: one + // oversized group re-errors on every excess row, and per-row + // counting would report it as dozens of "conflicts" while crowding + // the example slots with near-identical strings. The first error + // per group is the example. + conflictGroups := map[string]bool{} + corruptAnnotations := 0 + var examples []string + pageToken := "" + for { + resp, err := pass.store.ListEntitlements(ctx, v2.EntitlementsServiceListEntitlementsRequest_builder{ + PageToken: pageToken, + ActiveSyncId: pass.p.ActiveSyncID, + }.Build()) + if err != nil { + return fmt.Errorf("ingest invariant I5: listing entitlements: %w", err) + } + for _, ent := range resp.GetList() { + if err := tracker.record(ent); err != nil { + // Every arm of I5 — typed group violations AND corrupt + // (undecodable) annotations — follows the pass semantics: + // a NEW collection hard-fails the seal with the + // non-retryable sentinel (both are deterministic stored + // bytes; retrying cannot fix either), while a pass over a + // pre-sealed artifact (compactor merge, rollback replay) + // observes and attributes. A corrupt annotation is not + // merge-MANUFACTURED, but on a pre-sealed pass the bytes + // already sealed once and failing here — after the merge + // or the rollback mutation — punishes the wrong actor + // with no operator escape. + if !warnOnly { + return invariantVerdict(fmt.Errorf("ingest invariant I5 violated: %w", err)) + } + var viol *exclusionGroupViolation + if !errors.As(err, &viol) { + // Corrupt annotation: counted separately from group + // conflicts (it is artifact damage, not a group + // shape), one example per row. + corruptAnnotations++ + if len(examples) < maxDanglingIDExamples { + examples = append(examples, err.Error()) + } + continue + } + if conflictGroups[viol.groupID] { + continue + } + conflictGroups[viol.groupID] = true + if len(examples) < maxDanglingIDExamples { + examples = append(examples, err.Error()) + } + } + } + if pageToken = resp.GetNextPageToken(); pageToken == "" { + break + } + } + if len(conflictGroups) > 0 || corruptAnnotations > 0 { + // The attribution differs by what was found: group conflicts are + // merge-manufactured by design, but corrupt annotations are + // artifact damage the merge merely carried — saying "manufactured + // by design" about damage would misdirect the reader. + msg := "ingest invariant I5: exclusion-group conflicts on the compaction expand pass (keep-newer merges manufacture these by design; not a connector bug)" + if len(conflictGroups) == 0 { + msg = "ingest invariant I5: corrupt exclusion-group annotations on a pre-sealed artifact " + + "(artifact damage carried by the merge/replay input, not merge-manufactured; the rows could not be judged)" + } + ctxzap.Extract(ctx).Warn(msg, + zap.Int("conflict_groups", len(conflictGroups)), + zap.Int("corrupt_annotations", corruptAnnotations), + zap.Strings("group_examples", examples), + ) + } + return nil +} + +// checkChildScheduling is invariant I4: every stored resource carrying a +// ChildResourceType annotation (and passing the resource-type filter) +// must have had its child action scheduled. Check-only — scheduling +// cannot be derived after the fact (an executed child action that +// returned zero rows leaves no store evidence). Fail-fast only (the +// table gates it): the check costs a full post-collection resource scan +// (value decode + annotation walk per row) and in default mode a +// violation was only ever a warning — a bad trade at whale scale. +func (pass *ingestInvariantsPass) checkChildScheduling(ctx context.Context) error { + if !pass.p.resourcesPhaseRan || pass.p.childSchedule == nil { + // Resumed past the resources phase (or a caller with no + // scheduling evidence at all): the scheduled set from the prior + // process is gone; the predicate is unverifiable. + return nil + } + syncResourceTypeMap := make(map[string]bool, len(pass.p.syncResourceTypes)) + for _, rt := range pass.p.syncResourceTypes { + syncResourceTypeMap[rt] = true + } + + var violations []string + pageToken := "" + for { + resp, err := pass.store.ListResources(ctx, v2.ResourcesServiceListResourcesRequest_builder{ + PageToken: pageToken, + ActiveSyncId: pass.p.ActiveSyncID, + }.Build()) + if err != nil { + return fmt.Errorf("ingest invariant I4: listing resources: %w", err) + } + for _, r := range resp.GetList() { + for _, a := range r.GetAnnotations() { + if !a.MessageIs((*v2.ChildResourceType)(nil)) { + continue + } + crt := &v2.ChildResourceType{} + if err := a.UnmarshalTo(crt); err != nil { + return fmt.Errorf("ingest invariant I4: parsing ChildResourceType on %s/%s: %w", + r.GetId().GetResourceType(), r.GetId().GetResource(), err) + } + childType := crt.GetResourceTypeId() + if childType == "" { + continue + } + if len(pass.p.syncResourceTypes) > 0 && !syncResourceTypeMap[childType] { + continue + } + if !pass.p.childSchedule.has(childType, r.GetId().GetResourceType(), r.GetId().GetResource()) { + violations = append(violations, fmt.Sprintf("%s under %s/%s", + childType, r.GetId().GetResourceType(), r.GetId().GetResource())) + } + } + } + if pageToken = resp.GetNextPageToken(); pageToken == "" { + break + } + } + if len(violations) > 0 { + // Sorted so the error text is byte-stable regardless of store + // iteration order (the verdict already is). + sort.Strings(violations) + return invariantVerdict(fmt.Errorf( + "ingest invariant I4 violated: %d child resource sync(s) were never scheduled: %v", + len(violations), violations)) + } + return nil +} + +// maxDanglingIDExamples caps the id samples carried on the aggregated +// dangling-reference warnings. Production data shows a handful of +// distinct ids explain millions of dangling rows (magic-id construction +// bugs repeat), so a small sample is enough to pivot on. +const maxDanglingIDExamples = 25 + +// danglingTypeProbe memoizes "does a resource-type row exist" — the +// attribution split for dangling references. A reference into a type +// with NO type row means the type was never synced (typically a type +// added to the connector after the instance was configured and left +// disabled by default — a CONFIG gap); a missing row under a type that +// EXISTS means the id was constructed for a row the enumeration never +// produced (a magic-id BUG). +type danglingTypeProbe struct { + store connectorstore.Reader + // syncScope carries the pass's ActiveSyncID as a SyncDetails + // annotation (GetResourceType has no ActiveSyncId field), scoping + // the probe like every other read in the pass: without it, the + // pebble adapter falls back to current-sync resolution, which can + // fail on an unbound store (external callers, corrupted metadata) + // while the sibling ListEntitlements/-Resources reads — which DO + // carry the id — succeed. + syncScope []*anypb.Any + known map[string]bool +} + +// newTypeProbe builds the pass's memoizing resource-type probe, scoped +// to the pass's sync. +func (pass *ingestInvariantsPass) newTypeProbe() (*danglingTypeProbe, error) { + p := &danglingTypeProbe{store: pass.store} + if pass.p.ActiveSyncID != "" { + sd, err := anypb.New(c1zpb.SyncDetails_builder{Id: pass.p.ActiveSyncID}.Build()) + if err != nil { + return nil, fmt.Errorf("type probe: encoding sync scope: %w", err) + } + p.syncScope = []*anypb.Any{sd} + } + return p, nil +} + +func (p *danglingTypeProbe) typeExists(ctx context.Context, resourceTypeID string) (bool, error) { + if v, ok := p.known[resourceTypeID]; ok { + return v, nil + } + _, err := p.store.GetResourceType(ctx, reader_v2.ResourceTypesReaderServiceGetResourceTypeRequest_builder{ + ResourceTypeId: resourceTypeID, + Annotations: p.syncScope, + }.Build()) + if err != nil && status.Code(err) != codes.NotFound { + // A read failure is NOT "type never synced": that verdict picks + // the config-gap attribution, so an IO error or canceled context + // here would mislabel the aggregate where policy demands a loud + // failure. Propagate, and memoize nothing — only definitive + // answers may be cached (a memoized transient error would poison + // every later reference to the type). + return false, fmt.Errorf("resource-type probe for %q: %w", resourceTypeID, err) + } + if p.known == nil { + p.known = map[string]bool{} + } + exists := err == nil + p.known[resourceTypeID] = exists + return exists, nil +} + +// danglingAttribution renders the attribution split for the aggregated +// dangling-reference warnings: references into never-synced types are +// config gaps; references into SYNCED types are connector data bugs — +// unless the pass runs over a compaction merge (CompactionMerge), +// where keep-newer merges manufacture them by design. +func danglingAttribution(unsyncedTypeCount, syncedTypeCount int, compactionMerge bool) string { + switch { + case syncedTypeCount == 0: + return "referenced resource type(s) never synced — likely disabled on the connector (config gap), not a code bug" + case unsyncedTypeCount == 0 && compactionMerge: + return "references target SYNCED types under the compaction expand pass — keep-newer merges manufacture these by design; not a connector bug" + case unsyncedTypeCount == 0: + return "references target SYNCED types — likely a connector magic-id construction bug, or rows emitted for referents the enumeration never produced" + case compactionMerge: + return "mixed: some references target never-synced types (config gap), some target synced types under the compaction expand pass (keep-newer merges manufacture these by design)" + default: + return "mixed: some references target never-synced types (config gap), some target synced types (likely connector data bugs)" + } +} + +// checkGrantResourceReferences is invariant I3: every distinct +// entitlement resource referenced by a grant must exist as a resource +// row. One seek per distinct resource (the grant keyspace leads with the +// entitlement resource), value reads only for dangling refs. +// +// The annotated arm (dangling ref + InsertResourceGrants) is a hard +// violation: those rows are the syncer's own establishment guarantee +// (no ListResources call ever returns them; the machinery materializes +// the row in the same page handling), so a missing row means the +// machinery lost it or the connector's own data destroyed it. The +// compaction expand pass (CompactionMerge) is exempt from the hard arm +// in default mode: keep-newer merges can strand an annotated grant +// whose resource row lost the merge, by design — those aggregate into +// the warning instead. +// +// The unannotated arm (connectors emitting grants for unlisted +// resources without InsertResourceGrants) is tolerated: one aggregated +// warning per sync — except under fail-fast, whose contract is that +// every tolerated warn becomes a named failure. +func (pass *ingestInvariantsPass) checkGrantResourceReferences(ctx context.Context) error { + danglingResources, unsyncedType, syncedType := 0, 0, 0 + var annotatedMergeStranded int + var resourceExamples []string + probe, err := pass.newTypeProbe() + if err != nil { + return err + } + err = pass.facts.ForEachDistinctGrantEntitlementResource(ctx, func(rt, rid string) error { + exists, err := pass.facts.HasResourceRecord(ctx, rt, rid) + if err != nil { + return fmt.Errorf("ingest invariant I3: probing resource %s/%s: %w", rt, rid, err) + } + if exists { + return nil + } + annotated, err := pass.facts.GrantsForEntResourceCarryInsertFact(ctx, rt, rid) + if err != nil { + return fmt.Errorf("ingest invariant I3: probing grant annotations for %s/%s: %w", rt, rid, err) + } + if annotated { + if pass.p.CompactionMerge && !pass.p.FailFast { + // A keep-newer merge stranded a machinery-owned grant: + // the input that won the grant row lost the resource + // row. Manufactured by the merge, not evidence of a + // machinery bug — aggregate it. + annotatedMergeStranded++ + danglingResources++ + syncedType++ // the flavor split below reports it under synced types + if len(resourceExamples) < maxDanglingIDExamples { + resourceExamples = append(resourceExamples, rt+"/"+rid) + } + return nil + } + return invariantVerdict(fmt.Errorf( + "ingest invariant I3 violated: grants reference resource %s/%s via InsertResourceGrants "+ + "but no resource row exists — the related-resource machinery lost the row or the "+ + "connector's own data is inconsistent (check for anything deleting grant-inserted resources)", + rt, rid)) + } + // Tolerated today: connectors emitting grants for unlisted + // resources without InsertResourceGrants. Visible, not fatal — + // except under fail-fast, whose contract is that every tolerated + // warn becomes a named failure (harnesses must catch connector + // shapes production only logs). + if pass.p.FailFast { + return invariantVerdict(fmt.Errorf( + "ingest invariant I3 violated: grants reference resource %s/%s which was never synced "+ + "(no InsertResourceGrants annotation — tolerated with a warning in production, promoted under fail-fast)", + rt, rid)) + } + typeSynced, probeErr := probe.typeExists(ctx, rt) + if probeErr != nil { + return fmt.Errorf("ingest invariant I3: %w", probeErr) + } + danglingResources++ + if typeSynced { + syncedType++ + } else { + unsyncedType++ + } + if len(resourceExamples) < maxDanglingIDExamples { + resourceExamples = append(resourceExamples, rt+"/"+rid) + } + return nil + }) + if err != nil { + return err + } + if danglingResources > 0 { + ctxzap.Extract(ctx).Warn("ingest invariant I3: grants reference resources with no resource row", + zap.Int("dangling_resources", danglingResources), + zap.Int("refs_into_unsynced_types", unsyncedType), + zap.Int("refs_under_synced_types", syncedType), + zap.Int("insert_resource_grants_merge_stranded", annotatedMergeStranded), + zap.String("attribution", danglingAttribution(unsyncedType, syncedType, pass.p.CompactionMerge)), + zap.Strings("resource_examples", resourceExamples), + ) + } + return nil +} + +// checkEntitlementResourceReferences is invariant I7: every distinct +// resource referenced by an entitlement row must exist as a resource +// row. One seek per distinct resource among entitlements — bounded by +// the entitlement count. Default mode aggregates every dangling into +// one warning with the type-synced attribution split; fail-fast mode +// hard-fails the first one. +func (pass *ingestInvariantsPass) checkEntitlementResourceReferences(ctx context.Context) error { + probe, err := pass.newTypeProbe() + if err != nil { + return err + } + danglingResources, unsyncedType, syncedType := 0, 0, 0 + var resourceExamples []string + err = pass.facts.ForEachDistinctEntitlementResource(ctx, func(rt, rid string) error { + exists, err := pass.facts.HasResourceRecord(ctx, rt, rid) + if err != nil { + return fmt.Errorf("ingest invariant I7: probing resource %s/%s: %w", rt, rid, err) + } + if exists { + return nil + } + typeSynced, probeErr := probe.typeExists(ctx, rt) + if probeErr != nil { + return fmt.Errorf("ingest invariant I7: %w", probeErr) + } + if pass.p.FailFast { + return invariantVerdict(fmt.Errorf( + "ingest invariant I7 violated: entitlements reference resource %s/%s but no resource row exists "+ + "(resource type synced: %t — false means a config gap, true a magic-id construction bug)", + rt, rid, typeSynced)) + } + danglingResources++ + if typeSynced { + syncedType++ + } else { + unsyncedType++ + } + if len(resourceExamples) < maxDanglingIDExamples { + resourceExamples = append(resourceExamples, rt+"/"+rid) + } + return nil + }) + if err != nil { + return err + } + if danglingResources > 0 { + ctxzap.Extract(ctx).Warn("ingest invariant I7: entitlements reference resources with no resource row", + zap.Int("dangling_resources", danglingResources), + zap.Int("refs_into_unsynced_types", unsyncedType), + zap.Int("refs_under_synced_types", syncedType), + zap.String("attribution", danglingAttribution(unsyncedType, syncedType, pass.p.CompactionMerge)), + zap.Strings("resource_examples", resourceExamples), + ) + } + return nil +} + +// checkGrantEntitlementReferences is invariant I8: every distinct +// entitlement referenced by a grant must exist as an entitlement row. +// One seek plus one point probe per distinct entitlement — O(distinct +// entitlements), never O(grants). +// +// InsertResourceGrants grants are EXEMPT in every mode, per GRANT: that +// pattern has always produced grants whose entitlements have no row (the +// machinery inserts the grant's embedded resource; no listing ever +// returns an entitlement for it), and downstream consumers synthesize +// the entitlement from the grant. The exemption follows the ownership +// rule at the grant's own granularity: a connector-owned grant dangling +// under the same missing entitlement as machinery-owned IRG grants is +// still a violation — a resource- or entitlement-level exemption would +// let one IRG grant launder every dangling reference that shares its +// resource. +// +// Default mode aggregates every dangling into one warning with the +// type-synced attribution split; fail-fast mode hard-fails the first +// non-exempt one. +func (pass *ingestInvariantsPass) checkGrantEntitlementReferences(ctx context.Context) error { + probe, err := pass.newTypeProbe() + if err != nil { + return err + } + danglingEnts, unsyncedType, syncedType := 0, 0, 0 + var entIDExamples []string + err = pass.facts.ForEachDanglingGrantEntitlement(ctx, func(entitlementID, rt, rid string) error { + allCarry, err := pass.facts.GrantsForEntitlementAllCarryInsertFact(ctx, entitlementID, rt, rid) + if err != nil { + return fmt.Errorf("ingest invariant I8: probing grant annotations for entitlement %q: %w", entitlementID, err) + } + if allCarry { + return nil // the established InsertResourceGrants shape + } + typeSynced, probeErr := probe.typeExists(ctx, rt) + if probeErr != nil { + return fmt.Errorf("ingest invariant I8: %w", probeErr) + } + if pass.p.FailFast { + return invariantVerdict(fmt.Errorf( + "ingest invariant I8 violated: grants without InsertResourceGrants reference entitlement %q (resource %s/%s) but no entitlement row exists "+ + "(resource type synced: %t — false means a config gap, true a magic-id construction bug)", + entitlementID, rt, rid, typeSynced)) + } + danglingEnts++ + if typeSynced { + syncedType++ + } else { + unsyncedType++ + } + if len(entIDExamples) < maxDanglingIDExamples { + entIDExamples = append(entIDExamples, entitlementID) + } + return nil + }) + if err != nil { + return err + } + if danglingEnts > 0 { + ctxzap.Extract(ctx).Warn("ingest invariant I8: grants reference entitlements with no entitlement row", + zap.Int("dangling_entitlements", danglingEnts), + zap.Int("refs_into_unsynced_types", unsyncedType), + zap.Int("refs_under_synced_types", syncedType), + zap.String("attribution", danglingAttribution(unsyncedType, syncedType, pass.p.CompactionMerge)), + zap.Strings("entitlement_id_examples", entIDExamples), + ) + } + return nil +} + +// checkGrantPrincipalReferences is invariant I9: every distinct +// principal referenced by a grant must exist as a resource row. Scans +// the by_principal index (one seek + probe per distinct principal); a +// pending deferred index build is forced first so every grant write +// path is covered — that build is EndSync's own pass moved earlier, so +// the net cost is ~zero. +// +// Grants carrying ExternalResourceMatch* annotations are EXEMPT in +// every mode: unprocessed match carriers mean no external resource file +// was configured (the match op deletes carriers when it runs) — they +// are evidence of a config gap, not bad data, and hiding them would +// make a misconfigured deployment look clean. +// +// Default mode aggregates every dangling into one warning with the +// type-synced attribution split; fail-fast mode hard-fails the first +// non-exempt one. +func (pass *ingestInvariantsPass) checkGrantPrincipalReferences(ctx context.Context) error { + if err := pass.facts.EnsureGrantIndexes(ctx); err != nil { + return fmt.Errorf("ingest invariant I9: ensuring grant indexes: %w", err) + } + if err := pass.haltAt(haltStageI9IndexesEnsured); err != nil { + return err + } + probe, err := pass.newTypeProbe() + if err != nil { + return err + } + danglingPrincipals, unsyncedType, syncedType := 0, 0, 0 + var matchCarriersKept int64 + var principalExamples []string + err = pass.facts.ForEachDanglingGrantPrincipal(ctx, func(rt, rid string, matchAnnotatedOnly bool, carrierGrants int64) error { + // Carrier grants are counted per GRANT in both shapes: a fully + // annotated principal is exempt outright, and a MIXED population + // still reports its carriers (the plain grants are what make the + // principal a violation, not the carriers beside them). + matchCarriersKept += carrierGrants + if matchAnnotatedOnly { + return nil + } + typeSynced, probeErr := probe.typeExists(ctx, rt) + if probeErr != nil { + return fmt.Errorf("ingest invariant I9: %w", probeErr) + } + if pass.p.FailFast { + return invariantVerdict(fmt.Errorf( + "ingest invariant I9 violated: grants reference principal %s/%s but no resource row exists "+ + "(resource type synced: %t — false means a config gap, true means the connector "+ + "emitted grants for a principal it never synced)", + rt, rid, typeSynced)) + } + danglingPrincipals++ + if typeSynced { + syncedType++ + } else { + unsyncedType++ + } + if len(principalExamples) < maxDanglingIDExamples { + principalExamples = append(principalExamples, rt+"/"+rid) + } + return nil + }) + if err != nil { + return err + } + l := ctxzap.Extract(ctx) + if danglingPrincipals > 0 { + l.Warn("ingest invariant I9: grants reference principals with no resource row", + zap.Int("dangling_principals", danglingPrincipals), + zap.Int("refs_into_unsynced_types", unsyncedType), + zap.Int("refs_under_synced_types", syncedType), + zap.String("attribution", danglingAttribution(unsyncedType, syncedType, pass.p.CompactionMerge)), + zap.Strings("principal_examples", principalExamples), + ) + } + if matchCarriersKept > 0 { + l.Warn("ingest invariant I9: kept unprocessed external-match carrier grants with dangling principals — was the external resource file configured?", + zap.Int64("match_carriers_kept", matchCarriersKept), + ) + } + return nil +} 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 cf8680c6..f4ce91a2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/state.go @@ -47,28 +47,6 @@ type State interface { RecordSessionOp(op string, duration time.Duration, opErr error, timedOut bool) MergeSessionStat(op string, add SessionStoreStat) SessionStoreStats() map[string]SessionStoreStat - // CheckAndSetExclusionGroupResourceType records that exclusionGroupID is - // used on resourceTypeID. If the group was already recorded against a - // different resource type, the prior value is returned with conflict=true - // and the map is not modified. Otherwise the map is updated (if needed) - // and ("", false) is returned. The existing return value is meaningful - // only when conflict is true. - CheckAndSetExclusionGroupResourceType(exclusionGroupID, resourceTypeID string) (existing string, conflict bool) - // CheckAndSetExclusionGroupDefault records that entitlementID is the - // default entitlement for exclusionGroupID. If the group already has a - // recorded default that is not entitlementID, the prior value is returned - // with conflict=true and the map is not modified. Otherwise the map is - // updated (if needed) and ("", false) is returned. The existing return - // value is meaningful only when conflict is true. - CheckAndSetExclusionGroupDefault(exclusionGroupID, entitlementID string) (existing string, conflict bool) - // IncrementExclusionGroupCount increments the running count of entitlements - // observed for exclusionGroupID and returns the new count. The count is - // global per exclusion group id (across all resources) and survives resume. - IncrementExclusionGroupCount(exclusionGroupID string) uint32 - // ClearExclusionGroupTracking drops the exclusion group bookkeeping maps so - // they don't bloat the token of a completed sync, mirroring - // ClearEntitlementGraph. - ClearExclusionGroupTracking(ctx context.Context) } func NeedsExpansion(stateStr string) (bool, error) { @@ -228,9 +206,6 @@ type state struct { shouldSkipEntitlementsAndGrants bool shouldSkipGrants bool completedActionsCount uint64 - exclusionGroupResourceTypes map[string]string - exclusionGroupDefaults map[string]string - exclusionGroupCounts map[string]uint32 stepDurationsMs map[string]int64 connectorCallStats map[string]*ConnectorCallStat sessionStoreStats map[string]*SessionStoreStat @@ -276,39 +251,38 @@ type serializedTokenV0 struct { // serializedTokenV1 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 serializedTokenV1 struct { - ActionsMap map[string]Action `json:"actions_map,omitempty"` - ActionOrder []string `json:"action_order,omitempty"` - CurrentActionID uint64 `json:"current_action_id,omitempty"` - NeedsExpansion bool `json:"needs_expansion,omitempty"` - EntitlementGraph *expand.EntitlementGraph `json:"entitlement_graph,omitempty"` - HasExternalResourceGrants bool `json:"has_external_resource_grants,omitempty"` - ShouldFetchRelatedResources bool `json:"should_fetch_related_resources,omitempty"` - ShouldSkipEntitlementsAndGrants bool `json:"should_skip_entitlements_and_grants,omitempty"` - ShouldSkipGrants bool `json:"should_skip_grants,omitempty"` - CompletedActionsCount uint64 `json:"completed_actions_count,omitempty"` - ExclusionGroupResourceTypes map[string]string `json:"exclusion_group_resource_types,omitempty"` - ExclusionGroupDefaults map[string]string `json:"exclusion_group_defaults,omitempty"` - ExclusionGroupCounts map[string]uint32 `json:"exclusion_group_counts,omitempty"` - StepDurationsMs map[string]int64 `json:"step_durations_ms,omitempty"` - ConnectorCallStats map[string]*ConnectorCallStat `json:"connector_call_stats,omitempty"` - SessionStoreStats map[string]*SessionStoreStat `json:"session_store_stats,omitempty"` - Compaction *CompactionTokenStats `json:"compaction,omitempty"` - Version uint64 `json:"version"` + ActionsMap map[string]Action `json:"actions_map,omitempty"` + ActionOrder []string `json:"action_order,omitempty"` + CurrentActionID uint64 `json:"current_action_id,omitempty"` + NeedsExpansion bool `json:"needs_expansion,omitempty"` + EntitlementGraph *expand.EntitlementGraph `json:"entitlement_graph,omitempty"` + HasExternalResourceGrants bool `json:"has_external_resource_grants,omitempty"` + ShouldFetchRelatedResources bool `json:"should_fetch_related_resources,omitempty"` + ShouldSkipEntitlementsAndGrants bool `json:"should_skip_entitlements_and_grants,omitempty"` + ShouldSkipGrants bool `json:"should_skip_grants,omitempty"` + CompletedActionsCount uint64 `json:"completed_actions_count,omitempty"` + // Exclusion-group tracking maps (exclusion_group_resource_types, + // exclusion_group_defaults, exclusion_group_counts) were removed + // when the streaming exclusion-group validation was replaced by + // ingestion invariant I5 over the stored keyspace: old tokens + // carrying them still parse (unknown JSON fields are ignored). + StepDurationsMs map[string]int64 `json:"step_durations_ms,omitempty"` + ConnectorCallStats map[string]*ConnectorCallStat `json:"connector_call_stats,omitempty"` + SessionStoreStats map[string]*SessionStoreStat `json:"session_store_stats,omitempty"` + Compaction *CompactionTokenStats `json:"compaction,omitempty"` + Version uint64 `json:"version"` } func newState() *state { return &state{ - actions: make(map[string]Action), - actionOrder: []string{}, - currentActionID: 0, - entitlementGraph: nil, - needsExpansion: false, - exclusionGroupResourceTypes: make(map[string]string), - exclusionGroupDefaults: make(map[string]string), - exclusionGroupCounts: make(map[string]uint32), - stepDurationsMs: make(map[string]int64), - connectorCallStats: make(map[string]*ConnectorCallStat), - sessionStoreStats: make(map[string]*SessionStoreStat), + actions: make(map[string]Action), + actionOrder: []string{}, + currentActionID: 0, + entitlementGraph: nil, + needsExpansion: false, + stepDurationsMs: make(map[string]int64), + connectorCallStats: make(map[string]*ConnectorCallStat), + sessionStoreStats: make(map[string]*SessionStoreStat), } } @@ -433,18 +407,6 @@ func (st *state) Unmarshal(input string) error { st.shouldSkipGrants = token.ShouldSkipGrants st.shouldFetchRelatedResources = token.ShouldFetchRelatedResources st.completedActionsCount = token.CompletedActionsCount - st.exclusionGroupResourceTypes = token.ExclusionGroupResourceTypes - if st.exclusionGroupResourceTypes == nil { - st.exclusionGroupResourceTypes = make(map[string]string) - } - st.exclusionGroupDefaults = token.ExclusionGroupDefaults - if st.exclusionGroupDefaults == nil { - st.exclusionGroupDefaults = make(map[string]string) - } - st.exclusionGroupCounts = token.ExclusionGroupCounts - if st.exclusionGroupCounts == nil { - st.exclusionGroupCounts = make(map[string]uint32) - } st.stepDurationsMs = token.StepDurationsMs if st.stepDurationsMs == nil { st.stepDurationsMs = make(map[string]int64) @@ -471,9 +433,6 @@ func (st *state) Unmarshal(input string) error { st.actions[actionID] = Action{Op: InitOp, ID: actionID} st.actionOrder = append(st.actionOrder, actionID) st.completedActionsCount = 0 - st.exclusionGroupResourceTypes = make(map[string]string) - st.exclusionGroupDefaults = make(map[string]string) - st.exclusionGroupCounts = make(map[string]uint32) st.stepDurationsMs = make(map[string]int64) st.connectorCallStats = make(map[string]*ConnectorCallStat) st.sessionStoreStats = make(map[string]*SessionStoreStat) @@ -499,9 +458,6 @@ func (st *state) Marshal() (string, error) { ShouldSkipEntitlementsAndGrants: st.shouldSkipEntitlementsAndGrants, ShouldSkipGrants: st.shouldSkipGrants, CompletedActionsCount: st.completedActionsCount, - ExclusionGroupResourceTypes: st.exclusionGroupResourceTypes, - ExclusionGroupDefaults: st.exclusionGroupDefaults, - ExclusionGroupCounts: st.exclusionGroupCounts, StepDurationsMs: st.stepDurationsMs, ConnectorCallStats: st.connectorCallStats, SessionStoreStats: st.sessionStoreStats, @@ -774,59 +730,3 @@ func (st *state) GetCompletedActionsCount() uint64 { defer st.mtx.RUnlock() return st.completedActionsCount } - -func (st *state) CheckAndSetExclusionGroupResourceType(exclusionGroupID, resourceTypeID string) (string, bool) { - st.mtx.Lock() - defer st.mtx.Unlock() - - if st.exclusionGroupResourceTypes == nil { - st.exclusionGroupResourceTypes = make(map[string]string) - } - if existing, ok := st.exclusionGroupResourceTypes[exclusionGroupID]; ok { - if existing != resourceTypeID { - return existing, true - } - return "", false - } - st.exclusionGroupResourceTypes[exclusionGroupID] = resourceTypeID - return "", false -} - -func (st *state) CheckAndSetExclusionGroupDefault(exclusionGroupID, entitlementID string) (string, bool) { - st.mtx.Lock() - defer st.mtx.Unlock() - - if st.exclusionGroupDefaults == nil { - st.exclusionGroupDefaults = make(map[string]string) - } - if existing, ok := st.exclusionGroupDefaults[exclusionGroupID]; ok { - if existing != entitlementID { - return existing, true - } - return "", false - } - st.exclusionGroupDefaults[exclusionGroupID] = entitlementID - return "", false -} - -func (st *state) IncrementExclusionGroupCount(exclusionGroupID string) uint32 { - st.mtx.Lock() - defer st.mtx.Unlock() - - if st.exclusionGroupCounts == nil { - st.exclusionGroupCounts = make(map[string]uint32) - } - st.exclusionGroupCounts[exclusionGroupID]++ - return st.exclusionGroupCounts[exclusionGroupID] -} - -// ClearExclusionGroupTracking drops the exclusion group bookkeeping maps. This -// is meant to keep the final sync token small, mirroring ClearEntitlementGraph. -func (st *state) ClearExclusionGroupTracking(ctx context.Context) { - st.mtx.Lock() - defer st.mtx.Unlock() - - st.exclusionGroupResourceTypes = nil - st.exclusionGroupDefaults = nil - st.exclusionGroupCounts = nil -} 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 ddfad187..64d4b8fc 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -142,35 +142,65 @@ type syncer struct { store c1zstore.Store externalResourceReader connectorstore.Reader previousSyncReader connectorstore.Reader - connector types.ConnectorClient - state State - runDuration time.Duration - transitionHandler func(s Action) - progressHandler func(p *Progress) - tmpDir string - storageEngine c1zstore.Engine - skipFullSync bool - lastCheckPointTime time.Time - counts *progresslog.ProgressLog - targetedSyncResources []*v2.Resource - onlyExpandGrants bool - dontExpandGrants bool - syncID string - skipEGForResourceType syncMap[string, bool] - skipEntitlementsForResourceType syncMap[string, bool] - scheduledResourceTypes syncMap[string, bool] - ingestFilterStats ingestFilterStats - skipEntitlementsAndGrants bool - skipGrants bool - resourceTypeTraits syncMap[string, []v2.ResourceType_Trait] - syncType connectorstore.SyncType - injectSyncIDAnnotation bool - setSessionStore sessions.SetSessionStore - syncResourceTypes []string - workerCount int // If 1, sync is sequential (default). If > 1, sync operations are done in parallel. - metricsHandler metrics.Handler - syncIdentity uotel.SyncIdentity - recordStats bool + // Ingestion-invariant state (see ingest_invariants.go): + // childSchedule is the monotone record backing invariant I4; + // resourcesPhaseRanHere gates I4 to processes that actually ran the + // resources phase; failFastInvariants promotes every invariant + // verdict to a hard, plainly-attributed sync failure — tolerated + // warns fail — and enables I4 (skipped entirely in default mode). + // Tests and equivalence harnesses set it; production default + // follows the per-invariant policy in the verdict table + // (ingestInvariants). + childSchedule childScheduleSet + resourcesPhaseRanHere bool + failFastInvariants bool + // expandDropStats aggregates expansion edges dropped over missing + // entitlements across the whole sync (see expand.DroppedEdgeStats); + // summarized once when expansion completes. + expandDropStats *expand.DroppedEdgeStats + // testIngestHaltHook, when non-nil, fires at named seams of the + // ingestion-invariant pass (see ingestInvariantHaltStages); + // returning an error fails the sync at exactly that boundary. The + // halt sweep uses it to prove crash/resume equivalence at every + // ordering-sensitive point. Nil in production: one pointer check. + testIngestHaltHook func(stage string) error + connector types.ConnectorClient + state State + runDuration time.Duration + transitionHandler func(s Action) + progressHandler func(p *Progress) + tmpDir string + storageEngine c1zstore.Engine + skipFullSync bool + lastCheckPointTime time.Time + counts *progresslog.ProgressLog + targetedSyncResources []*v2.Resource + onlyExpandGrants bool + // compactionMergedStore marks the store as a pre-sealed artifact + // this process did not collect (WithCompactionMergedStore — the + // compactor's keep-newer merge and rollback-expansion's replay): + // invariant verdicts attribute merge-manufactured shapes to the + // merge and soften hard arms to aggregated warnings. Distinct from + // onlyExpandGrants, which changes WHAT syncs and carries no + // invariant policy on its own. + compactionMergedStore bool + dontExpandGrants bool + syncID string + skipEGForResourceType syncMap[string, bool] + skipEntitlementsForResourceType syncMap[string, bool] + scheduledResourceTypes syncMap[string, bool] + ingestFilterStats ingestFilterStats + skipEntitlementsAndGrants bool + skipGrants bool + resourceTypeTraits syncMap[string, []v2.ResourceType_Trait] + syncType connectorstore.SyncType + injectSyncIDAnnotation bool + setSessionStore sessions.SetSessionStore + syncResourceTypes []string + workerCount int // If 1, sync is sequential (default). If > 1, sync operations are done in parallel. + metricsHandler metrics.Handler + syncIdentity uotel.SyncIdentity + recordStats bool // Watermark for the rate_limit_wait_wall bucket: the latest instant // already counted as rate-limit-blocked wall time, plus the @@ -620,63 +650,12 @@ func (s *syncer) handleProgress(ctx context.Context, a *Action, c int) { } // maxEntitlementsPerExclusionGroup caps how many entitlements may share a -// single exclusion_group_id. Phase 1 limit. +// single exclusion_group_id. Phase 1 limit. Enforced by ingestion +// invariant I5 over the STORED entitlement keyspace post-collection +// (ingest_invariants.go) — the former page-level streaming validation +// could not see rows a non-stream ingestion path wrote. const maxEntitlementsPerExclusionGroup = 50 -// recordEntitlementExclusionGroup enforces the invariants on an exclusion -// group membership: a given exclusion_group_id must stay within one resource -// type, a group may have at most one entitlement marked is_default, and a group -// may contain at most maxEntitlementsPerExclusionGroup entitlements. Empty -// group ids are treated as "no exclusion group" and skipped. -func (s *syncer) recordEntitlementExclusionGroup(eg *v2.EntitlementExclusionGroup, entitlementID, resourceTypeID string) error { - groupID := eg.GetExclusionGroupId() - if groupID == "" { - return nil - } - if existing, conflict := s.state.CheckAndSetExclusionGroupResourceType(groupID, resourceTypeID); conflict { - return fmt.Errorf("exclusion group %q is used on multiple resource types (%q and %q); "+ - "exclusion groups may span resources but must be scoped to a single resource type", - groupID, existing, resourceTypeID) - } - if eg.GetIsDefault() { - if existing, conflict := s.state.CheckAndSetExclusionGroupDefault(groupID, entitlementID); conflict { - return fmt.Errorf("exclusion group %q has multiple default entitlements (%q and %q); "+ - "at most one entitlement per exclusion group may set is_default=true", - groupID, existing, entitlementID) - } - } - if count := s.state.IncrementExclusionGroupCount(groupID); count > maxEntitlementsPerExclusionGroup { - return fmt.Errorf("exclusion group %q has too many entitlements (%d); "+ - "at most %d entitlements are allowed per exclusion group", - groupID, count, maxEntitlementsPerExclusionGroup) - } - return nil -} - -// validateEntitlementExclusionGroups picks the exclusion group annotation off -// each entitlement (if present) and forwards to recordEntitlementExclusionGroup. -// Use this on lists of entitlements that may independently carry exclusion -// group annotations (e.g., the dynamic ListEntitlements path); callers that -// already have the annotation in hand should call recordEntitlementExclusionGroup -// directly to avoid the per-entitlement Pick. -func (s *syncer) validateEntitlementExclusionGroups(ents []*v2.Entitlement) error { - for _, ent := range ents { - eg := &v2.EntitlementExclusionGroup{} - entAnnos := annotations.Annotations(ent.GetAnnotations()) - ok, err := entAnnos.Pick(eg) - if err != nil { - return err - } - if !ok { - continue - } - if err := s.recordEntitlementExclusionGroup(eg, ent.GetId(), ent.GetResource().GetId().GetResourceType()); err != nil { - return err - } - } - return nil -} - // nextPageOrFinishAction updates the action with the next page token, or if there is no next page, finishes the action. // It also pushes any child actions before updating/finishing the action. // This is useful for pagination, and for actions that create other actions. @@ -929,9 +908,25 @@ func (s *syncer) Sync(ctx context.Context) error { s.logIngestFilterSummary(ctx) + // Post-collection ingestion invariants (ingest_invariants.go): every + // ingestion path has finished writing, so the store-derived + // definitions of the sync's side effects are checkable. Runs before + // EndSync so a violating sync is never sealed as complete. + if err := s.runIngestionInvariants(ctx); err != nil { + return s.returnSyncError(l, span, err) + } + if s.testIngestHaltHook != nil { + // The seam AFTER the invariant pass and BEFORE the + // checkpoint/EndSync below: a resumed sync re-runs the whole + // invariant pass over the same state, so every check must be + // idempotent. + if err := s.testIngestHaltHook(haltStageInvariantsComplete); err != nil { + return s.returnSyncError(l, span, err) + } + } + // Force a checkpoint to clear completed actions & entitlement graph in sync_token. s.state.ClearEntitlementGraph(ctx) - s.state.ClearExclusionGroupTracking(ctx) err = s.Checkpoint(ctx, true) if err != nil { @@ -1147,11 +1142,7 @@ func (s *syncer) hasChildResources(resource *v2.Resource) bool { // At sync scale (100k+ resources per trace) the span overhead and trace bloat // outweighed any debugging value. func (s *syncer) getSubResources(ctx context.Context, parent *v2.Resource) error { - syncResourceTypeMap := make(map[string]bool) - for _, rt := range s.syncResourceTypes { - syncResourceTypeMap[rt] = true - } - + var childTypeIDs []string for _, a := range parent.GetAnnotations() { if a.MessageIs((*v2.ChildResourceType)(nil)) { crt := &v2.ChildResourceType{} @@ -1159,24 +1150,41 @@ func (s *syncer) getSubResources(ctx context.Context, parent *v2.Resource) error if err != nil { return err } - if len(s.syncResourceTypes) > 0 { - if shouldSync := syncResourceTypeMap[crt.GetResourceTypeId()]; !shouldSync { - continue - } - } - childAction := Action{ - Op: SyncResourcesOp, - ResourceTypeID: crt.GetResourceTypeId(), - ParentResourceID: parent.GetId().GetResource(), - ParentResourceTypeID: parent.GetId().GetResourceType(), - } - s.state.PushAction(ctx, childAction) + childTypeIDs = append(childTypeIDs, crt.GetResourceTypeId()) } } - + s.pushChildResourceActions(ctx, childTypeIDs, parent.GetId().GetResourceType(), parent.GetId().GetResource()) return nil } +// pushChildResourceActions queues child resource syncs for one parent, +// honoring the sync's resource-type filter. Factored out of +// getSubResources so any ingestion path that discovers a parent +// resource can schedule its children through the same evidence-recorded +// seam. +func (s *syncer) pushChildResourceActions(ctx context.Context, childTypeIDs []string, parentTypeID, parentID string) { + for _, childTypeID := range childTypeIDs { + if len(s.syncResourceTypes) > 0 && !slices.Contains(s.syncResourceTypes, childTypeID) { + continue + } + // Monotone evidence for ingestion invariant I4 (see + // ingest_invariants.go), doubling as the per-sync scheduling + // dedupe: a parent discovered more than once in one sync + // schedules its children exactly once. In-memory, so a resumed + // process re-schedules — the existing at-least-once semantic, + // just not N-times-per-sync. + if !s.childSchedule.recordIfNew(childTypeID, parentTypeID, parentID) { + continue + } + s.state.PushAction(ctx, Action{ + Op: SyncResourcesOp, + ResourceTypeID: childTypeID, + ParentResourceID: parentID, + ParentResourceTypeID: parentTypeID, + }) + } +} + func (s *syncer) getResourceFromConnector(ctx context.Context, resourceID *v2.ResourceId, parentResourceID *v2.ResourceId) (*v2.Resource, error) { ctx, span := tracer.Start(ctx, "syncer.getResource") var err error @@ -1297,6 +1305,10 @@ func (s *syncer) SyncResources(ctx context.Context, action *Action) error { if action.PageToken == "" { ctxzap.Extract(ctx).Info("Syncing resources...") s.handleInitialActionForStep(ctx, *action) + // Ingestion invariant I4 is only verifiable when the + // resources phase started in THIS process (the scheduled + // set is in-memory); see ingest_invariants.go. + s.resourcesPhaseRanHere = true } resp, err := s.store.ListResourceTypes(ctx, v2.ResourceTypesServiceListResourceTypesRequest_builder{ @@ -1621,15 +1633,14 @@ func (s *syncer) syncEntitlementsForResource(ctx context.Context, action *Action if err != nil { return err } - // Filter before exclusion-group validation: a dropped entitlement must not - // mutate exclusion-group state or fail the sync as if it had been ingested. + // Filter before the put: a dropped entitlement must never be + // ingested (exclusion-group validation happens post-collection over + // the STORED keyspace — ingestion invariant I5 — so filtered rows + // are invisible to it by construction). entitlements, err := s.filterFreshEntitlements(ctx, resp.GetList()) if err != nil { return fmt.Errorf("sync-entitlements: filtering disabled-type references: %w", err) } - if err := s.validateEntitlementExclusionGroups(entitlements); err != nil { - return err - } err = s.store.PutEntitlements(ctx, entitlements...) if err != nil { return err @@ -1735,11 +1746,6 @@ func (s *syncer) syncStaticEntitlementsForResourceType(ctx context.Context, acti } entID := entitlement.NewEntitlementID(resource, ent.GetSlug()) - if hasExclusionGroup { - if err := s.recordEntitlementExclusionGroup(exclusionGroup, entID, resource.GetId().GetResourceType()); err != nil { - return err - } - } entitlements = append(entitlements, &v2.Entitlement{ Resource: resource, @@ -1976,6 +1982,13 @@ func (s *syncer) loadEntitlementGraph(ctx context.Context, action *Action, graph // Only skip not-found entitlements; propagate other errors // to avoid silently dropping edges and yielding incorrect expansions. if status.Code(err) == codes.NotFound { + // Counted on the same sync-wide aggregate as the + // expander's drops (this seam was previously + // Debug-only — invisible in production). + if s.expandDropStats == nil { + s.expandDropStats = &expand.DroppedEdgeStats{} + } + s.expandDropStats.RecordSourceMissing(srcEntitlementID) l.Debug("source entitlement not found, skipping edge", zap.String("src_entitlement_id", srcEntitlementID), zap.String("dst_entitlement_id", dstEntitlementID), @@ -2951,7 +2964,11 @@ func (s *syncer) expandGrantsForEntitlements(ctx context.Context, action *Action // The expander needs Reader methods (on s.store) plus StoreExpandedGrants // (on s.store.Grants()). An inline adapter composes them so expand // stays decoupled from C1ZStore. + if s.expandDropStats == nil { + s.expandDropStats = &expand.DroppedEdgeStats{} + } expander := expand.NewExpander(expanderStoreAdapter{s.store}, graph) + expander.SetDropStats(s.expandDropStats) err = expander.RunSingleStep(ctx) if err != nil { l.Error("expandGrantsForEntitlements: error during expansion", zap.Error(err)) @@ -2965,6 +2982,9 @@ func (s *syncer) expandGrantsForEntitlements(ctx context.Context, action *Action if expander.IsDone(ctx) { l.Debug("expandGrantsForEntitlements: graph is expanded") + // The sync's one aggregated dropped-edge report (totals + + // distinct-id examples) — per-edge drops log at Debug only. + s.expandDropStats.LogSummary(ctx) s.state.FinishAction(ctx, action) } @@ -3147,6 +3167,20 @@ func WithStorageEngine(engine c1zstore.Engine) SyncOpt { } } +// WithFailFastInvariants promotes every ingestion-invariant verdict +// (see ingest_invariants.go) to a hard, plainly-attributed sync +// failure: tolerated warns fail, and I4 (skipped in default mode) +// runs. Tests and equivalence harnesses enable it; production default +// follows the per-invariant policy in the verdict table +// (ingestInvariants) — aggregated warnings with attribution for +// dangling references, hard failure for I5 and I3's +// InsertResourceGrants arm. +func WithFailFastInvariants() SyncOpt { + return func(s *syncer) { + s.failFastInvariants = true + } +} + // WithSkipFullSync skips syncing entirely. func WithSkipFullSync() SyncOpt { return func(s *syncer) { @@ -3236,6 +3270,24 @@ func WithOnlyExpandGrants() SyncOpt { } } +// WithCompactionMergedStore marks the store under this sync as a +// pre-sealed artifact this process did not collect — the compactor's +// keep-newer merge, or rollback-expansion's replay over an existing +// c1z (whose inputs include such merges). The ingestion invariants +// (ingest_invariants.go) then attribute merge-manufactured shapes — +// dangling references, stranded InsertResourceGrants rows, +// exclusion-group conflicts unioned from different input generations — +// to the merge instead of the connector, and soften the corresponding +// hard arms to aggregated warnings (fail-fast still promotes). The +// hard arms exist to stop a NEW collection from sealing bad data; +// passes over already-sealed artifacts observe and attribute instead. +// A normal connector sync must never set this. +func WithCompactionMergedStore() SyncOpt { + return func(s *syncer) { + s.compactionMergedStore = true + } +} + // WithDontExpandGrants sets whether to skip expanding grants. // This is used for speeding up service mode connectors and reducing their c1z upload size. // C1 will process the uploaded c1z and expand grants itself. diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go index 48514230..b1cfeee3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go @@ -582,6 +582,11 @@ func (c *Compactor) expandGrants(ctx context.Context, newSyncId string, compacti sync.WithTmpDir(c.tmpDir), sync.WithSyncID(newSyncId), sync.WithOnlyExpandGrants(), + // The store is a keep-newer merge: invariant verdicts must + // attribute merge-manufactured shapes to the merge, not the + // connector, and must not fail the seal over them. Wiring + // pinned by TestCompactionExpandToleratesMergeManufacturedExclusionConflicts. + sync.WithCompactionMergedStore(), } compactionDuration := time.Since(compactionStart) 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 ed2fe9fc..188ecedf 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 @@ -33,6 +33,20 @@ type fullSyncHelpers interface { TempDir() string } +// classifySyncError applies the task-manager retry policy to a failed +// sync's error. Ingestion-invariant DATA VERDICTS are deterministic on +// the connector's dataset: retrying re-fails identically, so they are +// marked non-retryable. The pass's IO failures don't carry the sentinel +// and stay retryable. Kept as a standalone function so the mapping is +// testable at this layer (the manager consumes ErrTaskNonRetryable via +// errors.Is when finishing the task). +func classifySyncError(err error) error { + if errors.Is(err, sdkSync.ErrIngestInvariantViolated) { + err = errors.Join(err, ErrTaskNonRetryable) + } + return err +} + type fullSyncTaskHandler struct { task *v1.Task helpers fullSyncHelpers @@ -308,7 +322,7 @@ func (c *fullSyncTaskHandler) HandleTask(ctx context.Context) error { if removeErr := os.Remove(c1zPath); removeErr != nil && !errors.Is(removeErr, os.ErrNotExist) { l.Error("failed to remove temp file after sync failure", zap.Error(removeErr), zap.String("path", c1zPath)) } - return c.helpers.FinishTask(ctx, nil, nil, err) + return c.helpers.FinishTask(ctx, nil, nil, classifySyncError(err)) } c1zF, err := os.Open(c1zPath) diff --git a/vendor/modules.txt b/vendor/modules.txt index 345550c6..611fd2d5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -272,7 +272,7 @@ github.com/cockroachdb/swiss # github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 ## explicit; go 1.19 github.com/cockroachdb/tokenbucket -# github.com/conductorone/baton-sdk v0.20.1 +# github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231 ## explicit; go 1.25.2 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 From 620e8c489123163254ed5f0b94c9a43f432c11e0 Mon Sep 17 00:00:00 2001 From: John Allers Date: Fri, 24 Jul 2026 13:15:19 +0000 Subject: [PATCH 2/2] chore(deps): bump baton-sdk to v0.20.3 Move off the pre-release pseudo-version now that the suggested_value SDK change is released as v0.20.3. Co-authored-by: c1-squire-dev[bot] --- go.mod | 2 +- go.sum | 4 +- .../internal/connector/noop_provisioner.go | 4 + .../baton-sdk/pb/c1/config/v1/config.pb.go | 64 +- .../pb/c1/config/v1/config_protoopaque.pb.go | 23 +- .../pb/c1/connector/v2/connector.pb.go | 659 ++- .../c1/connector/v2/connector.pb.validate.go | 515 ++ .../connector/v2/connector_protoopaque.pb.go | 660 ++- .../pb/c1/connector/v2/resource.pb.go | 1835 +++++-- .../c1/connector/v2/resource.pb.validate.go | 4621 +++++++++++------ .../pb/c1/connector/v2/resource_grpc.pb.go | 50 + .../connector/v2/resource_protoopaque.pb.go | 1823 +++++-- .../pb/c1/connectorapi/baton/v1/baton.pb.go | 547 +- .../baton/v1/baton.pb.validate.go | 264 + .../baton/v1/baton_protoopaque.pb.go | 548 +- .../baton-sdk/pb/c1/storage/v3/records.pb.go | 74 +- .../pb/c1/storage/v3/records.pb.validate.go | 4 + .../c1/storage/v3/records_protoopaque.pb.go | 83 +- .../pkg/connectorbuilder/connectorbuilder.go | 119 + .../credential_issue_validation.go | 145 + .../pkg/connectorbuilder/credentials.go | 202 + .../baton-sdk/pkg/crypto/crypto.go | 20 + .../baton-sdk/pkg/crypto/providers/age/age.go | 5 + .../baton-sdk/pkg/crypto/providers/jwk/jwk.go | 16 + .../pkg/crypto/providers/registry.go | 8 + .../baton-sdk/pkg/dotc1z/c1file_store.go | 23 +- .../pkg/dotc1z/c1zstore/sync_meta.go | 47 + .../pkg/dotc1z/engine/pebble/adapter.go | 24 +- .../dotc1z/engine/pebble/adapter_sync_meta.go | 93 +- .../baton-sdk/pkg/dotc1z/pebble_store.go | 61 + .../baton-sdk/pkg/dotc1z/sync_runs.go | 194 +- .../baton-sdk/pkg/dotc1z/to_pebble.go | 11 +- .../baton-sdk/pkg/field/fields.go | 16 - .../baton-sdk/pkg/lambda/grpc/client.go | 14 +- .../baton-sdk/pkg/lambda/grpc/server.go | 2 +- .../baton-sdk/pkg/lambda/grpc/util.go | 38 + .../baton-sdk/pkg/sdk/empty_connector.go | 4 + .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../baton-sdk/pkg/sync/ingest_invariants.go | 107 +- .../conductorone/baton-sdk/pkg/sync/syncer.go | 71 +- .../pkg/synccompactor/compactor_pebble.go | 6 + .../pkg/tasks/c1api/issue_credential.go | 59 + .../baton-sdk/pkg/tasks/c1api/manager.go | 2 + .../conductorone/baton-sdk/pkg/tasks/tasks.go | 4 + .../baton-sdk/pkg/types/tasks/tasks.go | 3 + vendor/modules.txt | 2 +- 46 files changed, 9961 insertions(+), 3117 deletions(-) create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credential_issue_validation.go create mode 100644 vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/issue_credential.go diff --git a/go.mod b/go.mod index fd3fe28b..18931b52 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-confluence go 1.25.2 require ( - github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231 + github.com/conductorone/baton-sdk v0.20.3 github.com/deckarep/golang-set/v2 v2.9.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 diff --git a/go.sum b/go.sum index 99540002..730102be 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b h1:VXvSNzmr8hMj8 github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b/go.mod h1:yBRu/cnL4ks9bgy4vAASdjIW+/xMlFwuHKqtmh3GZQg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231 h1:Y5zaGFKCRsqGhWK8fjuFZ8fGZsnTNrvW3gUmcwkk0fk= -github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231/go.mod h1:sOlgVNTcl6XhbCVRhEnGX79uXz8Vh4V3T03daVPzm+g= +github.com/conductorone/baton-sdk v0.20.3 h1:IanOE9tjEpyedUHe1jDRM47TgZgg/fGmBdb3baaY+Ww= +github.com/conductorone/baton-sdk v0.20.3/go.mod h1:sOlgVNTcl6XhbCVRhEnGX79uXz8Vh4V3T03daVPzm+g= github.com/conductorone/dpop v0.2.6 h1:fakwai/Xm2b/fcDUwJN41WtcSI/2UhQOyRIVvnnrrNA= github.com/conductorone/dpop v0.2.6/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.4 h1:lYxYi9/WTSL9sE96CO0QF2BY3kehs8dTTApI134TGCA= diff --git a/vendor/github.com/conductorone/baton-sdk/internal/connector/noop_provisioner.go b/vendor/github.com/conductorone/baton-sdk/internal/connector/noop_provisioner.go index 85f57ea9..df5acbd5 100644 --- a/vendor/github.com/conductorone/baton-sdk/internal/connector/noop_provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/internal/connector/noop_provisioner.go @@ -34,6 +34,10 @@ func (n *noopProvisioner) RotateCredential(ctx context.Context, request *v2.Rota return nil, status.Error(codes.FailedPrecondition, "provisioning is not enabled") } +func (n *noopProvisioner) IssueCredential(ctx context.Context, request *v2.IssueCredentialRequest) (*v2.IssueCredentialResponse, error) { + return nil, status.Error(codes.FailedPrecondition, "provisioning is not enabled") +} + func (n *noopProvisioner) CreateAccount(ctx context.Context, request *v2.CreateAccountRequest) (*v2.CreateAccountResponse, error) { return nil, status.Error(codes.FailedPrecondition, "provisioning is not enabled") } 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 c4664ed7..3280317f 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 @@ -2180,10 +2180,9 @@ func (b0 ResourceIdSliceField_builder) Build() *ResourceIdSliceField { type IntField struct { state protoimpl.MessageState `protogen:"hybrid.v1"` // rules - DefaultValue int64 `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - Rules *Int64Rules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config - SuggestedValue int64 `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + DefaultValue int64 `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + Rules *Int64Rules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + SuggestedValue int64 `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2261,9 +2260,8 @@ type IntField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. // rules - DefaultValue int64 - Rules *Int64Rules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue int64 + Rules *Int64Rules SuggestedValue int64 } @@ -2278,11 +2276,10 @@ func (b0 IntField_builder) Build() *IntField { } type BoolField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue bool `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - Rules *BoolRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config - SuggestedValue bool `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue bool `protobuf:"varint,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + Rules *BoolRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + SuggestedValue bool `protobuf:"varint,3,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2359,9 +2356,8 @@ func (x *BoolField) ClearRules() { type BoolField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - DefaultValue bool - Rules *BoolRules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue bool + Rules *BoolRules SuggestedValue bool } @@ -2376,11 +2372,10 @@ func (b0 BoolField_builder) Build() *BoolField { } type StringSliceField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue []string `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - Rules *RepeatedStringRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config - SuggestedValue []string `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue []string `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + Rules *RepeatedStringRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + SuggestedValue []string `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2457,9 +2452,8 @@ func (x *StringSliceField) ClearRules() { type StringSliceField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - DefaultValue []string - Rules *RepeatedStringRules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue []string + Rules *RepeatedStringRules SuggestedValue []string } @@ -2474,11 +2468,10 @@ func (b0 StringSliceField_builder) Build() *StringSliceField { } type StringMapField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue map[string]*anypb.Any `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Rules *StringMapRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config - SuggestedValue map[string]*anypb.Any `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue map[string]*anypb.Any `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Rules *StringMapRules `protobuf:"bytes,2,opt,name=rules,proto3,oneof" json:"rules,omitempty"` + SuggestedValue map[string]*anypb.Any `protobuf:"bytes,3,rep,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2555,9 +2548,8 @@ func (x *StringMapField) ClearRules() { type StringMapField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - DefaultValue map[string]*anypb.Any - Rules *StringMapRules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue map[string]*anypb.Any + Rules *StringMapRules SuggestedValue map[string]*anypb.Any } @@ -2664,10 +2656,9 @@ type StringField struct { // only used for FileUpload atm, oneofs are evil AllowedExtensions []string `protobuf:"bytes,4,rep,name=allowed_extensions,json=allowedExtensions,proto3" json:"allowed_extensions,omitempty"` Options []*StringFieldOption `protobuf:"bytes,5,rep,name=options,proto3" json:"options,omitempty"` - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config - SuggestedValue string `protobuf:"bytes,6,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + SuggestedValue string `protobuf:"bytes,6,opt,name=suggested_value,json=suggestedValue,proto3" json:"suggested_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StringField) Reset() { @@ -2781,8 +2772,7 @@ type StringField_builder struct { // only used for FileUpload atm, oneofs are evil AllowedExtensions []string Options []*StringFieldOption - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config - SuggestedValue string + SuggestedValue string } func (b0 StringField_builder) Build() *StringField { diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go index a16d293a..e23183fe 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go @@ -2255,9 +2255,8 @@ type IntField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. // rules - DefaultValue int64 - Rules *Int64Rules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue int64 + Rules *Int64Rules SuggestedValue int64 } @@ -2352,9 +2351,8 @@ func (x *BoolField) ClearRules() { type BoolField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - DefaultValue bool - Rules *BoolRules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue bool + Rules *BoolRules SuggestedValue bool } @@ -2449,9 +2447,8 @@ func (x *StringSliceField) ClearRules() { type StringSliceField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - DefaultValue []string - Rules *RepeatedStringRules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue []string + Rules *RepeatedStringRules SuggestedValue []string } @@ -2546,9 +2543,8 @@ func (x *StringMapField) ClearRules() { type StringMapField_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - DefaultValue map[string]*anypb.Any - Rules *StringMapRules - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config + DefaultValue map[string]*anypb.Any + Rules *StringMapRules SuggestedValue map[string]*anypb.Any } @@ -2772,8 +2768,7 @@ type StringField_builder struct { // only used for FileUpload atm, oneofs are evil AllowedExtensions []string Options []*StringFieldOption - // suggested_value pre-populates the c1 GUI for new connectors but is NOT injected into resolved config - SuggestedValue string + SuggestedValue string } func (b0 StringField_builder) Build() *StringField { 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 5c26735c..ca51d4ba 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 @@ -13,6 +13,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + durationpb "google.golang.org/protobuf/types/known/durationpb" structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" unsafe "unsafe" @@ -42,6 +43,9 @@ const ( Capability_CAPABILITY_TARGETED_SYNC Capability = 11 Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC Capability = 13 + // The connector can mint new credentials for an existing identity via + // CredentialManagerService.IssueCredential. + Capability_CAPABILITY_CREDENTIAL_ISSUE Capability = 14 ) // Enum value maps for Capability. @@ -61,6 +65,7 @@ var ( 11: "CAPABILITY_TARGETED_SYNC", 12: "CAPABILITY_EVENT_FEED_V2", 13: "CAPABILITY_SERVICE_MODE_TARGETED_SYNC", + 14: "CAPABILITY_CREDENTIAL_ISSUE", } Capability_value = map[string]int32{ "CAPABILITY_UNSPECIFIED": 0, @@ -77,6 +82,7 @@ var ( "CAPABILITY_TARGETED_SYNC": 11, "CAPABILITY_EVENT_FEED_V2": 12, "CAPABILITY_SERVICE_MODE_TARGETED_SYNC": 13, + "CAPABILITY_CREDENTIAL_ISSUE": 14, } ) @@ -110,6 +116,10 @@ const ( CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD CapabilityDetailCredentialOption = 2 CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO CapabilityDetailCredentialOption = 3 CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD CapabilityDetailCredentialOption = 4 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY CapabilityDetailCredentialOption = 5 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR CapabilityDetailCredentialOption = 6 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN CapabilityDetailCredentialOption = 7 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET CapabilityDetailCredentialOption = 8 ) // Enum value maps for CapabilityDetailCredentialOption. @@ -120,6 +130,10 @@ var ( 2: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD", 3: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO", 4: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD", + 5: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY", + 6: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR", + 7: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN", + 8: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET", } CapabilityDetailCredentialOption_value = map[string]int32{ "CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED": 0, @@ -127,6 +141,10 @@ var ( "CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD": 2, "CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO": 3, "CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD": 4, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY": 5, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR": 6, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN": 7, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET": 8, } ) @@ -739,6 +757,358 @@ func (b0 CredentialDetailsCredentialRotation_builder) Build() *CredentialDetails return m0 } +// Advertises which credential options CredentialManagerService.IssueCredential +// supports for this identity type. +type CredentialDetailsCredentialIssue struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Options []*CredentialIssueOptionDescriptor `protobuf:"bytes,1,rep,name=options,proto3" json:"options,omitempty"` + PreferredOption CapabilityDetailCredentialOption `protobuf:"varint,2,opt,name=preferred_option,json=preferredOption,proto3,enum=c1.connector.v2.CapabilityDetailCredentialOption" json:"preferred_option,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialDetailsCredentialIssue) Reset() { + *x = CredentialDetailsCredentialIssue{} + mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialDetailsCredentialIssue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialDetailsCredentialIssue) ProtoMessage() {} + +func (x *CredentialDetailsCredentialIssue) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialDetailsCredentialIssue) GetOptions() []*CredentialIssueOptionDescriptor { + if x != nil { + return x.Options + } + return nil +} + +func (x *CredentialDetailsCredentialIssue) GetPreferredOption() CapabilityDetailCredentialOption { + if x != nil { + return x.PreferredOption + } + return CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED +} + +func (x *CredentialDetailsCredentialIssue) SetOptions(v []*CredentialIssueOptionDescriptor) { + x.Options = v +} + +func (x *CredentialDetailsCredentialIssue) SetPreferredOption(v CapabilityDetailCredentialOption) { + x.PreferredOption = v +} + +type CredentialDetailsCredentialIssue_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Options []*CredentialIssueOptionDescriptor + PreferredOption CapabilityDetailCredentialOption +} + +func (b0 CredentialDetailsCredentialIssue_builder) Build() *CredentialDetailsCredentialIssue { + m0 := &CredentialDetailsCredentialIssue{} + b, x := &b0, m0 + _, _ = b, x + x.Options = b.Options + x.PreferredOption = b.PreferredOption + return m0 +} + +type CredentialIssueOptionDescriptor struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Option CapabilityDetailCredentialOption `protobuf:"varint,1,opt,name=option,proto3,enum=c1.connector.v2.CapabilityDetailCredentialOption" json:"option,omitempty"` + KeyProfiles []*KeyGenerationProfile `protobuf:"bytes,2,rep,name=key_profiles,json=keyProfiles,proto3" json:"key_profiles,omitempty"` + Expiry *IssuanceExpiryCapability `protobuf:"bytes,3,opt,name=expiry,proto3" json:"expiry,omitempty"` + Scopes []string `protobuf:"bytes,4,rep,name=scopes,proto3" json:"scopes,omitempty"` + CustomScopesAllowed bool `protobuf:"varint,5,opt,name=custom_scopes_allowed,json=customScopesAllowed,proto3" json:"custom_scopes_allowed,omitempty"` + CustomAudiencesAllowed bool `protobuf:"varint,6,opt,name=custom_audiences_allowed,json=customAudiencesAllowed,proto3" json:"custom_audiences_allowed,omitempty"` + Audiences []string `protobuf:"bytes,7,rep,name=audiences,proto3" json:"audiences,omitempty"` + ResourceMode CredentialResourceMode `protobuf:"varint,8,opt,name=resource_mode,json=resourceMode,proto3,enum=c1.connector.v2.CredentialResourceMode" json:"resource_mode,omitempty"` + // Resource type returned by IssueCredential. It must be registered with a + // ResourceDeleterV2 so every issued credential has a provider revoke path, + // including virtual credentials that cannot be listed later. + SecretResourceTypeId string `protobuf:"bytes,9,opt,name=secret_resource_type_id,json=secretResourceTypeId,proto3" json:"secret_resource_type_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptionDescriptor) Reset() { + *x = CredentialIssueOptionDescriptor{} + mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptionDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptionDescriptor) ProtoMessage() {} + +func (x *CredentialIssueOptionDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptionDescriptor) GetOption() CapabilityDetailCredentialOption { + if x != nil { + return x.Option + } + return CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED +} + +func (x *CredentialIssueOptionDescriptor) GetKeyProfiles() []*KeyGenerationProfile { + if x != nil { + return x.KeyProfiles + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetExpiry() *IssuanceExpiryCapability { + if x != nil { + return x.Expiry + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetCustomScopesAllowed() bool { + if x != nil { + return x.CustomScopesAllowed + } + return false +} + +func (x *CredentialIssueOptionDescriptor) GetCustomAudiencesAllowed() bool { + if x != nil { + return x.CustomAudiencesAllowed + } + return false +} + +func (x *CredentialIssueOptionDescriptor) GetAudiences() []string { + if x != nil { + return x.Audiences + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetResourceMode() CredentialResourceMode { + if x != nil { + return x.ResourceMode + } + return CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED +} + +func (x *CredentialIssueOptionDescriptor) GetSecretResourceTypeId() string { + if x != nil { + return x.SecretResourceTypeId + } + return "" +} + +func (x *CredentialIssueOptionDescriptor) SetOption(v CapabilityDetailCredentialOption) { + x.Option = v +} + +func (x *CredentialIssueOptionDescriptor) SetKeyProfiles(v []*KeyGenerationProfile) { + x.KeyProfiles = v +} + +func (x *CredentialIssueOptionDescriptor) SetExpiry(v *IssuanceExpiryCapability) { + x.Expiry = v +} + +func (x *CredentialIssueOptionDescriptor) SetScopes(v []string) { + x.Scopes = v +} + +func (x *CredentialIssueOptionDescriptor) SetCustomScopesAllowed(v bool) { + x.CustomScopesAllowed = v +} + +func (x *CredentialIssueOptionDescriptor) SetCustomAudiencesAllowed(v bool) { + x.CustomAudiencesAllowed = v +} + +func (x *CredentialIssueOptionDescriptor) SetAudiences(v []string) { + x.Audiences = v +} + +func (x *CredentialIssueOptionDescriptor) SetResourceMode(v CredentialResourceMode) { + x.ResourceMode = v +} + +func (x *CredentialIssueOptionDescriptor) SetSecretResourceTypeId(v string) { + x.SecretResourceTypeId = v +} + +func (x *CredentialIssueOptionDescriptor) HasExpiry() bool { + if x == nil { + return false + } + return x.Expiry != nil +} + +func (x *CredentialIssueOptionDescriptor) ClearExpiry() { + x.Expiry = nil +} + +type CredentialIssueOptionDescriptor_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Option CapabilityDetailCredentialOption + KeyProfiles []*KeyGenerationProfile + Expiry *IssuanceExpiryCapability + Scopes []string + CustomScopesAllowed bool + CustomAudiencesAllowed bool + Audiences []string + ResourceMode CredentialResourceMode + // Resource type returned by IssueCredential. It must be registered with a + // ResourceDeleterV2 so every issued credential has a provider revoke path, + // including virtual credentials that cannot be listed later. + SecretResourceTypeId string +} + +func (b0 CredentialIssueOptionDescriptor_builder) Build() *CredentialIssueOptionDescriptor { + m0 := &CredentialIssueOptionDescriptor{} + b, x := &b0, m0 + _, _ = b, x + x.Option = b.Option + x.KeyProfiles = b.KeyProfiles + x.Expiry = b.Expiry + x.Scopes = b.Scopes + x.CustomScopesAllowed = b.CustomScopesAllowed + x.CustomAudiencesAllowed = b.CustomAudiencesAllowed + x.Audiences = b.Audiences + x.ResourceMode = b.ResourceMode + x.SecretResourceTypeId = b.SecretResourceTypeId + return m0 +} + +type IssuanceExpiryCapability struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Min *durationpb.Duration `protobuf:"bytes,1,opt,name=min,proto3" json:"min,omitempty"` + Max *durationpb.Duration `protobuf:"bytes,2,opt,name=max,proto3" json:"max,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IssuanceExpiryCapability) Reset() { + *x = IssuanceExpiryCapability{} + mi := &file_c1_connector_v2_connector_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IssuanceExpiryCapability) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IssuanceExpiryCapability) ProtoMessage() {} + +func (x *IssuanceExpiryCapability) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_connector_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) +} + +func (x *IssuanceExpiryCapability) GetMin() *durationpb.Duration { + if x != nil { + return x.Min + } + return nil +} + +func (x *IssuanceExpiryCapability) GetMax() *durationpb.Duration { + if x != nil { + return x.Max + } + return nil +} + +func (x *IssuanceExpiryCapability) SetMin(v *durationpb.Duration) { + x.Min = v +} + +func (x *IssuanceExpiryCapability) SetMax(v *durationpb.Duration) { + x.Max = v +} + +func (x *IssuanceExpiryCapability) HasMin() bool { + if x == nil { + return false + } + return x.Min != nil +} + +func (x *IssuanceExpiryCapability) HasMax() bool { + if x == nil { + return false + } + return x.Max != nil +} + +func (x *IssuanceExpiryCapability) ClearMin() { + x.Min = nil +} + +func (x *IssuanceExpiryCapability) ClearMax() { + x.Max = nil +} + +type IssuanceExpiryCapability_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Min *durationpb.Duration + Max *durationpb.Duration +} + +func (b0 IssuanceExpiryCapability_builder) Build() *IssuanceExpiryCapability { + m0 := &IssuanceExpiryCapability{} + b, x := &b0, m0 + _, _ = b, x + x.Min = b.Min + x.Max = b.Max + return m0 +} + type ConnectorCapabilities struct { state protoimpl.MessageState `protogen:"hybrid.v1"` ResourceTypeCapabilities []*ResourceTypeCapability `protobuf:"bytes,1,rep,name=resource_type_capabilities,json=resourceTypeCapabilities,proto3" json:"resource_type_capabilities,omitempty"` @@ -750,7 +1120,7 @@ type ConnectorCapabilities struct { func (x *ConnectorCapabilities) Reset() { *x = ConnectorCapabilities{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + mi := &file_c1_connector_v2_connector_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -762,7 +1132,7 @@ func (x *ConnectorCapabilities) String() string { func (*ConnectorCapabilities) ProtoMessage() {} func (x *ConnectorCapabilities) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + mi := &file_c1_connector_v2_connector_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -844,7 +1214,7 @@ type CapabilityPermission struct { func (x *CapabilityPermission) Reset() { *x = CapabilityPermission{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + mi := &file_c1_connector_v2_connector_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -856,7 +1226,7 @@ func (x *CapabilityPermission) String() string { func (*CapabilityPermission) ProtoMessage() {} func (x *CapabilityPermission) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + mi := &file_c1_connector_v2_connector_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -901,7 +1271,7 @@ type CapabilityPermissions struct { func (x *CapabilityPermissions) Reset() { *x = CapabilityPermissions{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[8] + mi := &file_c1_connector_v2_connector_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -913,7 +1283,7 @@ func (x *CapabilityPermissions) String() string { func (*CapabilityPermissions) ProtoMessage() {} func (x *CapabilityPermissions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[8] + mi := &file_c1_connector_v2_connector_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -957,7 +1327,7 @@ type OptInRequired struct { func (x *OptInRequired) Reset() { *x = OptInRequired{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[9] + mi := &file_c1_connector_v2_connector_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -969,7 +1339,7 @@ func (x *OptInRequired) String() string { func (*OptInRequired) ProtoMessage() {} func (x *OptInRequired) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[9] + mi := &file_c1_connector_v2_connector_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1004,7 +1374,7 @@ type SkipSyncAnomalyDetection struct { func (x *SkipSyncAnomalyDetection) Reset() { *x = SkipSyncAnomalyDetection{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[10] + mi := &file_c1_connector_v2_connector_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1016,7 +1386,7 @@ func (x *SkipSyncAnomalyDetection) String() string { func (*SkipSyncAnomalyDetection) ProtoMessage() {} func (x *SkipSyncAnomalyDetection) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[10] + mi := &file_c1_connector_v2_connector_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1040,19 +1410,20 @@ func (b0 SkipSyncAnomalyDetection_builder) Build() *SkipSyncAnomalyDetection { } type ResourceTypeCapability struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - ResourceType *ResourceType `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` - Capabilities []Capability `protobuf:"varint,2,rep,packed,name=capabilities,proto3,enum=c1.connector.v2.Capability" json:"capabilities,omitempty"` - Permissions *CapabilityPermissions `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"` - OptInRequired bool `protobuf:"varint,4,opt,name=opt_in_required,json=optInRequired,proto3" json:"opt_in_required,omitempty"` - SkipSyncAnomalyDetection bool `protobuf:"varint,5,opt,name=skip_sync_anomaly_detection,json=skipSyncAnomalyDetection,proto3" json:"skip_sync_anomaly_detection,omitempty"` + state protoimpl.MessageState `protogen:"hybrid.v1"` + ResourceType *ResourceType `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + Capabilities []Capability `protobuf:"varint,2,rep,packed,name=capabilities,proto3,enum=c1.connector.v2.Capability" json:"capabilities,omitempty"` + Permissions *CapabilityPermissions `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"` + OptInRequired bool `protobuf:"varint,4,opt,name=opt_in_required,json=optInRequired,proto3" json:"opt_in_required,omitempty"` + SkipSyncAnomalyDetection bool `protobuf:"varint,5,opt,name=skip_sync_anomaly_detection,json=skipSyncAnomalyDetection,proto3" json:"skip_sync_anomaly_detection,omitempty"` + CredentialIssue *CredentialDetailsCredentialIssue `protobuf:"bytes,6,opt,name=credential_issue,json=credentialIssue,proto3" json:"credential_issue,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ResourceTypeCapability) Reset() { *x = ResourceTypeCapability{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[11] + mi := &file_c1_connector_v2_connector_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1064,7 +1435,7 @@ func (x *ResourceTypeCapability) String() string { func (*ResourceTypeCapability) ProtoMessage() {} func (x *ResourceTypeCapability) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[11] + mi := &file_c1_connector_v2_connector_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1110,6 +1481,13 @@ func (x *ResourceTypeCapability) GetSkipSyncAnomalyDetection() bool { return false } +func (x *ResourceTypeCapability) GetCredentialIssue() *CredentialDetailsCredentialIssue { + if x != nil { + return x.CredentialIssue + } + return nil +} + func (x *ResourceTypeCapability) SetResourceType(v *ResourceType) { x.ResourceType = v } @@ -1130,6 +1508,10 @@ func (x *ResourceTypeCapability) SetSkipSyncAnomalyDetection(v bool) { x.SkipSyncAnomalyDetection = v } +func (x *ResourceTypeCapability) SetCredentialIssue(v *CredentialDetailsCredentialIssue) { + x.CredentialIssue = v +} + func (x *ResourceTypeCapability) HasResourceType() bool { if x == nil { return false @@ -1144,6 +1526,13 @@ func (x *ResourceTypeCapability) HasPermissions() bool { return x.Permissions != nil } +func (x *ResourceTypeCapability) HasCredentialIssue() bool { + if x == nil { + return false + } + return x.CredentialIssue != nil +} + func (x *ResourceTypeCapability) ClearResourceType() { x.ResourceType = nil } @@ -1152,6 +1541,10 @@ func (x *ResourceTypeCapability) ClearPermissions() { x.Permissions = nil } +func (x *ResourceTypeCapability) ClearCredentialIssue() { + x.CredentialIssue = nil +} + type ResourceTypeCapability_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. @@ -1160,6 +1553,7 @@ type ResourceTypeCapability_builder struct { Permissions *CapabilityPermissions OptInRequired bool SkipSyncAnomalyDetection bool + CredentialIssue *CredentialDetailsCredentialIssue } func (b0 ResourceTypeCapability_builder) Build() *ResourceTypeCapability { @@ -1171,6 +1565,7 @@ func (b0 ResourceTypeCapability_builder) Build() *ResourceTypeCapability { x.Permissions = b.Permissions x.OptInRequired = b.OptInRequired x.SkipSyncAnomalyDetection = b.SkipSyncAnomalyDetection + x.CredentialIssue = b.CredentialIssue return m0 } @@ -1182,7 +1577,7 @@ type ConnectorServiceGetMetadataRequest struct { func (x *ConnectorServiceGetMetadataRequest) Reset() { *x = ConnectorServiceGetMetadataRequest{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[12] + mi := &file_c1_connector_v2_connector_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1194,7 +1589,7 @@ func (x *ConnectorServiceGetMetadataRequest) String() string { func (*ConnectorServiceGetMetadataRequest) ProtoMessage() {} func (x *ConnectorServiceGetMetadataRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[12] + mi := &file_c1_connector_v2_connector_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1226,7 +1621,7 @@ type ConnectorServiceGetMetadataResponse struct { func (x *ConnectorServiceGetMetadataResponse) Reset() { *x = ConnectorServiceGetMetadataResponse{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[13] + mi := &file_c1_connector_v2_connector_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1238,7 +1633,7 @@ func (x *ConnectorServiceGetMetadataResponse) String() string { func (*ConnectorServiceGetMetadataResponse) ProtoMessage() {} func (x *ConnectorServiceGetMetadataResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[13] + mi := &file_c1_connector_v2_connector_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1293,7 +1688,7 @@ type ConnectorServiceValidateRequest struct { func (x *ConnectorServiceValidateRequest) Reset() { *x = ConnectorServiceValidateRequest{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[14] + mi := &file_c1_connector_v2_connector_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1305,7 +1700,7 @@ func (x *ConnectorServiceValidateRequest) String() string { func (*ConnectorServiceValidateRequest) ProtoMessage() {} func (x *ConnectorServiceValidateRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[14] + mi := &file_c1_connector_v2_connector_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1340,7 +1735,7 @@ type ConnectorServiceValidateResponse struct { func (x *ConnectorServiceValidateResponse) Reset() { *x = ConnectorServiceValidateResponse{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[15] + mi := &file_c1_connector_v2_connector_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1352,7 +1747,7 @@ func (x *ConnectorServiceValidateResponse) String() string { func (*ConnectorServiceValidateResponse) ProtoMessage() {} func (x *ConnectorServiceValidateResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[15] + mi := &file_c1_connector_v2_connector_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1410,7 +1805,7 @@ type ConnectorAccountCreationSchema struct { func (x *ConnectorAccountCreationSchema) Reset() { *x = ConnectorAccountCreationSchema{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[16] + mi := &file_c1_connector_v2_connector_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1422,7 +1817,7 @@ func (x *ConnectorAccountCreationSchema) String() string { func (*ConnectorAccountCreationSchema) ProtoMessage() {} func (x *ConnectorAccountCreationSchema) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[16] + mi := &file_c1_connector_v2_connector_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1480,7 +1875,7 @@ type ConnectorAccountCreationSchema_Field struct { func (x *ConnectorAccountCreationSchema_Field) Reset() { *x = ConnectorAccountCreationSchema_Field{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[18] + mi := &file_c1_connector_v2_connector_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1492,7 +1887,7 @@ func (x *ConnectorAccountCreationSchema_Field) String() string { func (*ConnectorAccountCreationSchema_Field) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_Field) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[18] + mi := &file_c1_connector_v2_connector_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1818,7 +2213,7 @@ func (b0 ConnectorAccountCreationSchema_Field_builder) Build() *ConnectorAccount type case_ConnectorAccountCreationSchema_Field_Field protoreflect.FieldNumber func (x case_ConnectorAccountCreationSchema_Field_Field) String() string { - md := file_c1_connector_v2_connector_proto_msgTypes[18].Descriptor() + md := file_c1_connector_v2_connector_proto_msgTypes[21].Descriptor() if x == 0 { return "not set" } @@ -1873,7 +2268,7 @@ type ConnectorAccountCreationSchema_StringField struct { func (x *ConnectorAccountCreationSchema_StringField) Reset() { *x = ConnectorAccountCreationSchema_StringField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[19] + mi := &file_c1_connector_v2_connector_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1885,7 +2280,7 @@ func (x *ConnectorAccountCreationSchema_StringField) String() string { func (*ConnectorAccountCreationSchema_StringField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_StringField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[19] + mi := &file_c1_connector_v2_connector_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1941,7 +2336,7 @@ type ConnectorAccountCreationSchema_BoolField struct { func (x *ConnectorAccountCreationSchema_BoolField) Reset() { *x = ConnectorAccountCreationSchema_BoolField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[20] + mi := &file_c1_connector_v2_connector_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1953,7 +2348,7 @@ func (x *ConnectorAccountCreationSchema_BoolField) String() string { func (*ConnectorAccountCreationSchema_BoolField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_BoolField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[20] + mi := &file_c1_connector_v2_connector_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2009,7 +2404,7 @@ type ConnectorAccountCreationSchema_StringListField struct { func (x *ConnectorAccountCreationSchema_StringListField) Reset() { *x = ConnectorAccountCreationSchema_StringListField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[21] + mi := &file_c1_connector_v2_connector_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2021,7 +2416,7 @@ func (x *ConnectorAccountCreationSchema_StringListField) String() string { func (*ConnectorAccountCreationSchema_StringListField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_StringListField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[21] + mi := &file_c1_connector_v2_connector_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2066,7 +2461,7 @@ type ConnectorAccountCreationSchema_IntField struct { func (x *ConnectorAccountCreationSchema_IntField) Reset() { *x = ConnectorAccountCreationSchema_IntField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[22] + mi := &file_c1_connector_v2_connector_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2078,7 +2473,7 @@ func (x *ConnectorAccountCreationSchema_IntField) String() string { func (*ConnectorAccountCreationSchema_IntField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_IntField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[22] + mi := &file_c1_connector_v2_connector_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2134,7 +2529,7 @@ type ConnectorAccountCreationSchema_MapField struct { func (x *ConnectorAccountCreationSchema_MapField) Reset() { *x = ConnectorAccountCreationSchema_MapField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[23] + mi := &file_c1_connector_v2_connector_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2146,7 +2541,7 @@ func (x *ConnectorAccountCreationSchema_MapField) String() string { func (*ConnectorAccountCreationSchema_MapField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_MapField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[23] + mi := &file_c1_connector_v2_connector_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2186,7 +2581,7 @@ var File_c1_connector_v2_connector_proto protoreflect.FileDescriptor const file_c1_connector_v2_connector_proto_rawDesc = "" + "\n" + - "\x1fc1/connector/v2/connector.proto\x12\x0fc1.connector.v2\x1a\x1bc1/connector/v2/asset.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\x8d\x01\n" + + "\x1fc1/connector/v2/connector.proto\x12\x0fc1.connector.v2\x1a\x1bc1/connector/v2/asset.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\x8d\x01\n" + "\x1eConnectorServiceCleanupRequest\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + "\x0eactive_sync_id\x18\x02 \x01(\tB\r\xfaB\n" + @@ -2213,7 +2608,24 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x1bpreferred_credential_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x19preferredCredentialOption\"\x8d\x02\n" + "#CredentialDetailsCredentialRotation\x12s\n" + "\x1csupported_credential_options\x18\x01 \x03(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x1asupportedCredentialOptions\x12q\n" + - "\x1bpreferred_credential_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x19preferredCredentialOption\"\xa5\x02\n" + + "\x1bpreferred_credential_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x19preferredCredentialOption\"\xcc\x01\n" + + " CredentialDetailsCredentialIssue\x12J\n" + + "\aoptions\x18\x01 \x03(\v20.c1.connector.v2.CredentialIssueOptionDescriptorR\aoptions\x12\\\n" + + "\x10preferred_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x0fpreferredOption\"\xae\x04\n" + + "\x1fCredentialIssueOptionDescriptor\x12I\n" + + "\x06option\x18\x01 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x06option\x12H\n" + + "\fkey_profiles\x18\x02 \x03(\v2%.c1.connector.v2.KeyGenerationProfileR\vkeyProfiles\x12A\n" + + "\x06expiry\x18\x03 \x01(\v2).c1.connector.v2.IssuanceExpiryCapabilityR\x06expiry\x12\x16\n" + + "\x06scopes\x18\x04 \x03(\tR\x06scopes\x122\n" + + "\x15custom_scopes_allowed\x18\x05 \x01(\bR\x13customScopesAllowed\x128\n" + + "\x18custom_audiences_allowed\x18\x06 \x01(\bR\x16customAudiencesAllowed\x12\x1c\n" + + "\taudiences\x18\a \x03(\tR\taudiences\x12L\n" + + "\rresource_mode\x18\b \x01(\x0e2'.c1.connector.v2.CredentialResourceModeR\fresourceMode\x12A\n" + + "\x17secret_resource_type_id\x18\t \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\x14secretResourceTypeId\"t\n" + + "\x18IssuanceExpiryCapability\x12+\n" + + "\x03min\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x03min\x12+\n" + + "\x03max\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x03max\"\xa5\x02\n" + "\x15ConnectorCapabilities\x12e\n" + "\x1aresource_type_capabilities\x18\x01 \x03(\v2'.c1.connector.v2.ResourceTypeCapabilityR\x18resourceTypeCapabilities\x12R\n" + "\x16connector_capabilities\x18\x02 \x03(\x0e2\x1b.c1.connector.v2.CapabilityR\x15connectorCapabilities\x12Q\n" + @@ -2225,13 +2637,14 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x15CapabilityPermissions\x12G\n" + "\vpermissions\x18\x01 \x03(\v2%.c1.connector.v2.CapabilityPermissionR\vpermissions\"\x0f\n" + "\rOptInRequired\"\x1a\n" + - "\x18SkipSyncAnomalyDetection\"\xce\x02\n" + + "\x18SkipSyncAnomalyDetection\"\xac\x03\n" + "\x16ResourceTypeCapability\x12B\n" + "\rresource_type\x18\x01 \x01(\v2\x1d.c1.connector.v2.ResourceTypeR\fresourceType\x12?\n" + "\fcapabilities\x18\x02 \x03(\x0e2\x1b.c1.connector.v2.CapabilityR\fcapabilities\x12H\n" + "\vpermissions\x18\x03 \x01(\v2&.c1.connector.v2.CapabilityPermissionsR\vpermissions\x12&\n" + "\x0fopt_in_required\x18\x04 \x01(\bR\roptInRequired\x12=\n" + - "\x1bskip_sync_anomaly_detection\x18\x05 \x01(\bR\x18skipSyncAnomalyDetection\"$\n" + + "\x1bskip_sync_anomaly_detection\x18\x05 \x01(\bR\x18skipSyncAnomalyDetection\x12\\\n" + + "\x10credential_issue\x18\x06 \x01(\v21.c1.connector.v2.CredentialDetailsCredentialIssueR\x0fcredentialIssue\"$\n" + "\"ConnectorServiceGetMetadataRequest\"e\n" + "#ConnectorServiceGetMetadataResponse\x12>\n" + "\bmetadata\x18\x01 \x01(\v2\".c1.connector.v2.ConnectorMetadataR\bmetadata\"!\n" + @@ -2276,7 +2689,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\rdefault_value\x18\x01 \x03(\v2J.c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntryR\fdefaultValue\x1av\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12K\n" + - "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xb1\x03\n" + + "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xd2\x03\n" + "\n" + "Capability\x12\x1a\n" + "\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\x18\n" + @@ -2293,20 +2706,25 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x12\x1c\n" + "\x18CAPABILITY_TARGETED_SYNC\x10\v\x12\x1c\n" + "\x18CAPABILITY_EVENT_FEED_V2\x10\f\x12)\n" + - "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r*\xae\x02\n" + + "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r\x12\x1f\n" + + "\x1bCAPABILITY_CREDENTIAL_ISSUE\x10\x0e*\xf6\x03\n" + " CapabilityDetailCredentialOption\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED\x10\x00\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD\x10\x01\x127\n" + "3CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD\x10\x02\x12+\n" + "'CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO\x10\x03\x12:\n" + - "6CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD\x10\x042\xeb\x02\n" + + "6CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD\x10\x04\x12/\n" + + "+CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY\x10\x05\x12/\n" + + "+CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR\x10\x06\x12-\n" + + ")CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN\x10\a\x125\n" + + "1CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET\x10\b2\xeb\x02\n" + "\x10ConnectorService\x12x\n" + "\vGetMetadata\x123.c1.connector.v2.ConnectorServiceGetMetadataRequest\x1a4.c1.connector.v2.ConnectorServiceGetMetadataResponse\x12o\n" + "\bValidate\x120.c1.connector.v2.ConnectorServiceValidateRequest\x1a1.c1.connector.v2.ConnectorServiceValidateResponse\x12l\n" + "\aCleanup\x12/.c1.connector.v2.ConnectorServiceCleanupRequest\x1a0.c1.connector.v2.ConnectorServiceCleanupResponseB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" var file_c1_connector_v2_connector_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_connector_v2_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_c1_connector_v2_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_c1_connector_v2_connector_proto_goTypes = []any{ (Capability)(0), // 0: c1.connector.v2.Capability (CapabilityDetailCredentialOption)(0), // 1: c1.connector.v2.CapabilityDetailCredentialOption @@ -2316,74 +2734,89 @@ var file_c1_connector_v2_connector_proto_goTypes = []any{ (*CredentialDetails)(nil), // 5: c1.connector.v2.CredentialDetails (*CredentialDetailsAccountProvisioning)(nil), // 6: c1.connector.v2.CredentialDetailsAccountProvisioning (*CredentialDetailsCredentialRotation)(nil), // 7: c1.connector.v2.CredentialDetailsCredentialRotation - (*ConnectorCapabilities)(nil), // 8: c1.connector.v2.ConnectorCapabilities - (*CapabilityPermission)(nil), // 9: c1.connector.v2.CapabilityPermission - (*CapabilityPermissions)(nil), // 10: c1.connector.v2.CapabilityPermissions - (*OptInRequired)(nil), // 11: c1.connector.v2.OptInRequired - (*SkipSyncAnomalyDetection)(nil), // 12: c1.connector.v2.SkipSyncAnomalyDetection - (*ResourceTypeCapability)(nil), // 13: c1.connector.v2.ResourceTypeCapability - (*ConnectorServiceGetMetadataRequest)(nil), // 14: c1.connector.v2.ConnectorServiceGetMetadataRequest - (*ConnectorServiceGetMetadataResponse)(nil), // 15: c1.connector.v2.ConnectorServiceGetMetadataResponse - (*ConnectorServiceValidateRequest)(nil), // 16: c1.connector.v2.ConnectorServiceValidateRequest - (*ConnectorServiceValidateResponse)(nil), // 17: c1.connector.v2.ConnectorServiceValidateResponse - (*ConnectorAccountCreationSchema)(nil), // 18: c1.connector.v2.ConnectorAccountCreationSchema - nil, // 19: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry - (*ConnectorAccountCreationSchema_Field)(nil), // 20: c1.connector.v2.ConnectorAccountCreationSchema.Field - (*ConnectorAccountCreationSchema_StringField)(nil), // 21: c1.connector.v2.ConnectorAccountCreationSchema.StringField - (*ConnectorAccountCreationSchema_BoolField)(nil), // 22: c1.connector.v2.ConnectorAccountCreationSchema.BoolField - (*ConnectorAccountCreationSchema_StringListField)(nil), // 23: c1.connector.v2.ConnectorAccountCreationSchema.StringListField - (*ConnectorAccountCreationSchema_IntField)(nil), // 24: c1.connector.v2.ConnectorAccountCreationSchema.IntField - (*ConnectorAccountCreationSchema_MapField)(nil), // 25: c1.connector.v2.ConnectorAccountCreationSchema.MapField - nil, // 26: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry - (*anypb.Any)(nil), // 27: google.protobuf.Any - (*AssetRef)(nil), // 28: c1.connector.v2.AssetRef - (*structpb.Struct)(nil), // 29: google.protobuf.Struct - (*ResourceType)(nil), // 30: c1.connector.v2.ResourceType + (*CredentialDetailsCredentialIssue)(nil), // 8: c1.connector.v2.CredentialDetailsCredentialIssue + (*CredentialIssueOptionDescriptor)(nil), // 9: c1.connector.v2.CredentialIssueOptionDescriptor + (*IssuanceExpiryCapability)(nil), // 10: c1.connector.v2.IssuanceExpiryCapability + (*ConnectorCapabilities)(nil), // 11: c1.connector.v2.ConnectorCapabilities + (*CapabilityPermission)(nil), // 12: c1.connector.v2.CapabilityPermission + (*CapabilityPermissions)(nil), // 13: c1.connector.v2.CapabilityPermissions + (*OptInRequired)(nil), // 14: c1.connector.v2.OptInRequired + (*SkipSyncAnomalyDetection)(nil), // 15: c1.connector.v2.SkipSyncAnomalyDetection + (*ResourceTypeCapability)(nil), // 16: c1.connector.v2.ResourceTypeCapability + (*ConnectorServiceGetMetadataRequest)(nil), // 17: c1.connector.v2.ConnectorServiceGetMetadataRequest + (*ConnectorServiceGetMetadataResponse)(nil), // 18: c1.connector.v2.ConnectorServiceGetMetadataResponse + (*ConnectorServiceValidateRequest)(nil), // 19: c1.connector.v2.ConnectorServiceValidateRequest + (*ConnectorServiceValidateResponse)(nil), // 20: c1.connector.v2.ConnectorServiceValidateResponse + (*ConnectorAccountCreationSchema)(nil), // 21: c1.connector.v2.ConnectorAccountCreationSchema + nil, // 22: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry + (*ConnectorAccountCreationSchema_Field)(nil), // 23: c1.connector.v2.ConnectorAccountCreationSchema.Field + (*ConnectorAccountCreationSchema_StringField)(nil), // 24: c1.connector.v2.ConnectorAccountCreationSchema.StringField + (*ConnectorAccountCreationSchema_BoolField)(nil), // 25: c1.connector.v2.ConnectorAccountCreationSchema.BoolField + (*ConnectorAccountCreationSchema_StringListField)(nil), // 26: c1.connector.v2.ConnectorAccountCreationSchema.StringListField + (*ConnectorAccountCreationSchema_IntField)(nil), // 27: c1.connector.v2.ConnectorAccountCreationSchema.IntField + (*ConnectorAccountCreationSchema_MapField)(nil), // 28: c1.connector.v2.ConnectorAccountCreationSchema.MapField + nil, // 29: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry + (*anypb.Any)(nil), // 30: google.protobuf.Any + (*AssetRef)(nil), // 31: c1.connector.v2.AssetRef + (*structpb.Struct)(nil), // 32: google.protobuf.Struct + (*KeyGenerationProfile)(nil), // 33: c1.connector.v2.KeyGenerationProfile + (CredentialResourceMode)(0), // 34: c1.connector.v2.CredentialResourceMode + (*durationpb.Duration)(nil), // 35: google.protobuf.Duration + (*ResourceType)(nil), // 36: c1.connector.v2.ResourceType } var file_c1_connector_v2_connector_proto_depIdxs = []int32{ - 27, // 0: c1.connector.v2.ConnectorServiceCleanupRequest.annotations:type_name -> google.protobuf.Any - 27, // 1: c1.connector.v2.ConnectorServiceCleanupResponse.annotations:type_name -> google.protobuf.Any - 28, // 2: c1.connector.v2.ConnectorMetadata.icon:type_name -> c1.connector.v2.AssetRef - 28, // 3: c1.connector.v2.ConnectorMetadata.logo:type_name -> c1.connector.v2.AssetRef - 29, // 4: c1.connector.v2.ConnectorMetadata.profile:type_name -> google.protobuf.Struct - 27, // 5: c1.connector.v2.ConnectorMetadata.annotations:type_name -> google.protobuf.Any - 8, // 6: c1.connector.v2.ConnectorMetadata.capabilities:type_name -> c1.connector.v2.ConnectorCapabilities - 18, // 7: c1.connector.v2.ConnectorMetadata.account_creation_schema:type_name -> c1.connector.v2.ConnectorAccountCreationSchema + 30, // 0: c1.connector.v2.ConnectorServiceCleanupRequest.annotations:type_name -> google.protobuf.Any + 30, // 1: c1.connector.v2.ConnectorServiceCleanupResponse.annotations:type_name -> google.protobuf.Any + 31, // 2: c1.connector.v2.ConnectorMetadata.icon:type_name -> c1.connector.v2.AssetRef + 31, // 3: c1.connector.v2.ConnectorMetadata.logo:type_name -> c1.connector.v2.AssetRef + 32, // 4: c1.connector.v2.ConnectorMetadata.profile:type_name -> google.protobuf.Struct + 30, // 5: c1.connector.v2.ConnectorMetadata.annotations:type_name -> google.protobuf.Any + 11, // 6: c1.connector.v2.ConnectorMetadata.capabilities:type_name -> c1.connector.v2.ConnectorCapabilities + 21, // 7: c1.connector.v2.ConnectorMetadata.account_creation_schema:type_name -> c1.connector.v2.ConnectorAccountCreationSchema 6, // 8: c1.connector.v2.CredentialDetails.capability_account_provisioning:type_name -> c1.connector.v2.CredentialDetailsAccountProvisioning 7, // 9: c1.connector.v2.CredentialDetails.capability_credential_rotation:type_name -> c1.connector.v2.CredentialDetailsCredentialRotation 1, // 10: c1.connector.v2.CredentialDetailsAccountProvisioning.supported_credential_options:type_name -> c1.connector.v2.CapabilityDetailCredentialOption 1, // 11: c1.connector.v2.CredentialDetailsAccountProvisioning.preferred_credential_option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption 1, // 12: c1.connector.v2.CredentialDetailsCredentialRotation.supported_credential_options:type_name -> c1.connector.v2.CapabilityDetailCredentialOption 1, // 13: c1.connector.v2.CredentialDetailsCredentialRotation.preferred_credential_option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption - 13, // 14: c1.connector.v2.ConnectorCapabilities.resource_type_capabilities:type_name -> c1.connector.v2.ResourceTypeCapability - 0, // 15: c1.connector.v2.ConnectorCapabilities.connector_capabilities:type_name -> c1.connector.v2.Capability - 5, // 16: c1.connector.v2.ConnectorCapabilities.credential_details:type_name -> c1.connector.v2.CredentialDetails - 9, // 17: c1.connector.v2.CapabilityPermissions.permissions:type_name -> c1.connector.v2.CapabilityPermission - 30, // 18: c1.connector.v2.ResourceTypeCapability.resource_type:type_name -> c1.connector.v2.ResourceType - 0, // 19: c1.connector.v2.ResourceTypeCapability.capabilities:type_name -> c1.connector.v2.Capability - 10, // 20: c1.connector.v2.ResourceTypeCapability.permissions:type_name -> c1.connector.v2.CapabilityPermissions - 4, // 21: c1.connector.v2.ConnectorServiceGetMetadataResponse.metadata:type_name -> c1.connector.v2.ConnectorMetadata - 27, // 22: c1.connector.v2.ConnectorServiceValidateResponse.annotations:type_name -> google.protobuf.Any - 19, // 23: c1.connector.v2.ConnectorAccountCreationSchema.field_map:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry - 20, // 24: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field - 21, // 25: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringField - 22, // 26: c1.connector.v2.ConnectorAccountCreationSchema.Field.bool_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.BoolField - 23, // 27: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_list_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringListField - 24, // 28: c1.connector.v2.ConnectorAccountCreationSchema.Field.int_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.IntField - 25, // 29: c1.connector.v2.ConnectorAccountCreationSchema.Field.map_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField - 26, // 30: c1.connector.v2.ConnectorAccountCreationSchema.MapField.default_value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry - 20, // 31: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field - 14, // 32: c1.connector.v2.ConnectorService.GetMetadata:input_type -> c1.connector.v2.ConnectorServiceGetMetadataRequest - 16, // 33: c1.connector.v2.ConnectorService.Validate:input_type -> c1.connector.v2.ConnectorServiceValidateRequest - 2, // 34: c1.connector.v2.ConnectorService.Cleanup:input_type -> c1.connector.v2.ConnectorServiceCleanupRequest - 15, // 35: c1.connector.v2.ConnectorService.GetMetadata:output_type -> c1.connector.v2.ConnectorServiceGetMetadataResponse - 17, // 36: c1.connector.v2.ConnectorService.Validate:output_type -> c1.connector.v2.ConnectorServiceValidateResponse - 3, // 37: c1.connector.v2.ConnectorService.Cleanup:output_type -> c1.connector.v2.ConnectorServiceCleanupResponse - 35, // [35:38] is the sub-list for method output_type - 32, // [32:35] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 9, // 14: c1.connector.v2.CredentialDetailsCredentialIssue.options:type_name -> c1.connector.v2.CredentialIssueOptionDescriptor + 1, // 15: c1.connector.v2.CredentialDetailsCredentialIssue.preferred_option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption + 1, // 16: c1.connector.v2.CredentialIssueOptionDescriptor.option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption + 33, // 17: c1.connector.v2.CredentialIssueOptionDescriptor.key_profiles:type_name -> c1.connector.v2.KeyGenerationProfile + 10, // 18: c1.connector.v2.CredentialIssueOptionDescriptor.expiry:type_name -> c1.connector.v2.IssuanceExpiryCapability + 34, // 19: c1.connector.v2.CredentialIssueOptionDescriptor.resource_mode:type_name -> c1.connector.v2.CredentialResourceMode + 35, // 20: c1.connector.v2.IssuanceExpiryCapability.min:type_name -> google.protobuf.Duration + 35, // 21: c1.connector.v2.IssuanceExpiryCapability.max:type_name -> google.protobuf.Duration + 16, // 22: c1.connector.v2.ConnectorCapabilities.resource_type_capabilities:type_name -> c1.connector.v2.ResourceTypeCapability + 0, // 23: c1.connector.v2.ConnectorCapabilities.connector_capabilities:type_name -> c1.connector.v2.Capability + 5, // 24: c1.connector.v2.ConnectorCapabilities.credential_details:type_name -> c1.connector.v2.CredentialDetails + 12, // 25: c1.connector.v2.CapabilityPermissions.permissions:type_name -> c1.connector.v2.CapabilityPermission + 36, // 26: c1.connector.v2.ResourceTypeCapability.resource_type:type_name -> c1.connector.v2.ResourceType + 0, // 27: c1.connector.v2.ResourceTypeCapability.capabilities:type_name -> c1.connector.v2.Capability + 13, // 28: c1.connector.v2.ResourceTypeCapability.permissions:type_name -> c1.connector.v2.CapabilityPermissions + 8, // 29: c1.connector.v2.ResourceTypeCapability.credential_issue:type_name -> c1.connector.v2.CredentialDetailsCredentialIssue + 4, // 30: c1.connector.v2.ConnectorServiceGetMetadataResponse.metadata:type_name -> c1.connector.v2.ConnectorMetadata + 30, // 31: c1.connector.v2.ConnectorServiceValidateResponse.annotations:type_name -> google.protobuf.Any + 22, // 32: c1.connector.v2.ConnectorAccountCreationSchema.field_map:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry + 23, // 33: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field + 24, // 34: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringField + 25, // 35: c1.connector.v2.ConnectorAccountCreationSchema.Field.bool_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.BoolField + 26, // 36: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_list_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringListField + 27, // 37: c1.connector.v2.ConnectorAccountCreationSchema.Field.int_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.IntField + 28, // 38: c1.connector.v2.ConnectorAccountCreationSchema.Field.map_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField + 29, // 39: c1.connector.v2.ConnectorAccountCreationSchema.MapField.default_value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry + 23, // 40: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field + 17, // 41: c1.connector.v2.ConnectorService.GetMetadata:input_type -> c1.connector.v2.ConnectorServiceGetMetadataRequest + 19, // 42: c1.connector.v2.ConnectorService.Validate:input_type -> c1.connector.v2.ConnectorServiceValidateRequest + 2, // 43: c1.connector.v2.ConnectorService.Cleanup:input_type -> c1.connector.v2.ConnectorServiceCleanupRequest + 18, // 44: c1.connector.v2.ConnectorService.GetMetadata:output_type -> c1.connector.v2.ConnectorServiceGetMetadataResponse + 20, // 45: c1.connector.v2.ConnectorService.Validate:output_type -> c1.connector.v2.ConnectorServiceValidateResponse + 3, // 46: c1.connector.v2.ConnectorService.Cleanup:output_type -> c1.connector.v2.ConnectorServiceCleanupResponse + 44, // [44:47] is the sub-list for method output_type + 41, // [41:44] is the sub-list for method input_type + 41, // [41:41] is the sub-list for extension type_name + 41, // [41:41] is the sub-list for extension extendee + 0, // [0:41] is the sub-list for field type_name } func init() { file_c1_connector_v2_connector_proto_init() } @@ -2393,23 +2826,23 @@ func file_c1_connector_v2_connector_proto_init() { } file_c1_connector_v2_asset_proto_init() file_c1_connector_v2_resource_proto_init() - file_c1_connector_v2_connector_proto_msgTypes[18].OneofWrappers = []any{ + file_c1_connector_v2_connector_proto_msgTypes[21].OneofWrappers = []any{ (*ConnectorAccountCreationSchema_Field_StringField)(nil), (*ConnectorAccountCreationSchema_Field_BoolField)(nil), (*ConnectorAccountCreationSchema_Field_StringListField)(nil), (*ConnectorAccountCreationSchema_Field_IntField)(nil), (*ConnectorAccountCreationSchema_Field_MapField)(nil), } - file_c1_connector_v2_connector_proto_msgTypes[19].OneofWrappers = []any{} - file_c1_connector_v2_connector_proto_msgTypes[20].OneofWrappers = []any{} file_c1_connector_v2_connector_proto_msgTypes[22].OneofWrappers = []any{} + file_c1_connector_v2_connector_proto_msgTypes[23].OneofWrappers = []any{} + file_c1_connector_v2_connector_proto_msgTypes[25].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_connector_proto_rawDesc), len(file_c1_connector_v2_connector_proto_rawDesc)), NumEnums: 2, - NumMessages: 25, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.validate.go index 0033fd7f..599f4761 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.validate.go @@ -1052,6 +1052,492 @@ var _ interface { ErrorName() string } = CredentialDetailsCredentialRotationValidationError{} +// Validate checks the field values on CredentialDetailsCredentialIssue 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 *CredentialDetailsCredentialIssue) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CredentialDetailsCredentialIssue 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 +// CredentialDetailsCredentialIssueMultiError, or nil if none found. +func (m *CredentialDetailsCredentialIssue) ValidateAll() error { + return m.validate(true) +} + +func (m *CredentialDetailsCredentialIssue) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetOptions() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialDetailsCredentialIssueValidationError{ + field: fmt.Sprintf("Options[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialDetailsCredentialIssueValidationError{ + field: fmt.Sprintf("Options[%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 CredentialDetailsCredentialIssueValidationError{ + field: fmt.Sprintf("Options[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for PreferredOption + + if len(errors) > 0 { + return CredentialDetailsCredentialIssueMultiError(errors) + } + + return nil +} + +// CredentialDetailsCredentialIssueMultiError is an error wrapping multiple +// validation errors returned by +// CredentialDetailsCredentialIssue.ValidateAll() if the designated +// constraints aren't met. +type CredentialDetailsCredentialIssueMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CredentialDetailsCredentialIssueMultiError) 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 CredentialDetailsCredentialIssueMultiError) AllErrors() []error { return m } + +// CredentialDetailsCredentialIssueValidationError is the validation error +// returned by CredentialDetailsCredentialIssue.Validate if the designated +// constraints aren't met. +type CredentialDetailsCredentialIssueValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CredentialDetailsCredentialIssueValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CredentialDetailsCredentialIssueValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CredentialDetailsCredentialIssueValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CredentialDetailsCredentialIssueValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CredentialDetailsCredentialIssueValidationError) ErrorName() string { + return "CredentialDetailsCredentialIssueValidationError" +} + +// Error satisfies the builtin error interface +func (e CredentialDetailsCredentialIssueValidationError) 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 %sCredentialDetailsCredentialIssue.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CredentialDetailsCredentialIssueValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CredentialDetailsCredentialIssueValidationError{} + +// Validate checks the field values on CredentialIssueOptionDescriptor 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 *CredentialIssueOptionDescriptor) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CredentialIssueOptionDescriptor 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 +// CredentialIssueOptionDescriptorMultiError, or nil if none found. +func (m *CredentialIssueOptionDescriptor) ValidateAll() error { + return m.validate(true) +} + +func (m *CredentialIssueOptionDescriptor) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Option + + for idx, item := range m.GetKeyProfiles() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialIssueOptionDescriptorValidationError{ + field: fmt.Sprintf("KeyProfiles[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialIssueOptionDescriptorValidationError{ + field: fmt.Sprintf("KeyProfiles[%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 CredentialIssueOptionDescriptorValidationError{ + field: fmt.Sprintf("KeyProfiles[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if all { + switch v := interface{}(m.GetExpiry()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialIssueOptionDescriptorValidationError{ + field: "Expiry", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialIssueOptionDescriptorValidationError{ + field: "Expiry", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetExpiry()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CredentialIssueOptionDescriptorValidationError{ + field: "Expiry", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for CustomScopesAllowed + + // no validation rules for CustomAudiencesAllowed + + // no validation rules for ResourceMode + + if l := len(m.GetSecretResourceTypeId()); l < 1 || l > 1024 { + err := CredentialIssueOptionDescriptorValidationError{ + field: "SecretResourceTypeId", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return CredentialIssueOptionDescriptorMultiError(errors) + } + + return nil +} + +// CredentialIssueOptionDescriptorMultiError is an error wrapping multiple +// validation errors returned by CredentialIssueOptionDescriptor.ValidateAll() +// if the designated constraints aren't met. +type CredentialIssueOptionDescriptorMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CredentialIssueOptionDescriptorMultiError) 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 CredentialIssueOptionDescriptorMultiError) AllErrors() []error { return m } + +// CredentialIssueOptionDescriptorValidationError is the validation error +// returned by CredentialIssueOptionDescriptor.Validate if the designated +// constraints aren't met. +type CredentialIssueOptionDescriptorValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CredentialIssueOptionDescriptorValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CredentialIssueOptionDescriptorValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CredentialIssueOptionDescriptorValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CredentialIssueOptionDescriptorValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CredentialIssueOptionDescriptorValidationError) ErrorName() string { + return "CredentialIssueOptionDescriptorValidationError" +} + +// Error satisfies the builtin error interface +func (e CredentialIssueOptionDescriptorValidationError) 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 %sCredentialIssueOptionDescriptor.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CredentialIssueOptionDescriptorValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CredentialIssueOptionDescriptorValidationError{} + +// Validate checks the field values on IssuanceExpiryCapability 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 *IssuanceExpiryCapability) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on IssuanceExpiryCapability 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 +// IssuanceExpiryCapabilityMultiError, or nil if none found. +func (m *IssuanceExpiryCapability) ValidateAll() error { + return m.validate(true) +} + +func (m *IssuanceExpiryCapability) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetMin()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, IssuanceExpiryCapabilityValidationError{ + field: "Min", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, IssuanceExpiryCapabilityValidationError{ + field: "Min", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMin()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IssuanceExpiryCapabilityValidationError{ + field: "Min", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetMax()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, IssuanceExpiryCapabilityValidationError{ + field: "Max", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, IssuanceExpiryCapabilityValidationError{ + field: "Max", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMax()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IssuanceExpiryCapabilityValidationError{ + field: "Max", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return IssuanceExpiryCapabilityMultiError(errors) + } + + return nil +} + +// IssuanceExpiryCapabilityMultiError is an error wrapping multiple validation +// errors returned by IssuanceExpiryCapability.ValidateAll() if the designated +// constraints aren't met. +type IssuanceExpiryCapabilityMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m IssuanceExpiryCapabilityMultiError) 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 IssuanceExpiryCapabilityMultiError) AllErrors() []error { return m } + +// IssuanceExpiryCapabilityValidationError is the validation error returned by +// IssuanceExpiryCapability.Validate if the designated constraints aren't met. +type IssuanceExpiryCapabilityValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e IssuanceExpiryCapabilityValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e IssuanceExpiryCapabilityValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e IssuanceExpiryCapabilityValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e IssuanceExpiryCapabilityValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e IssuanceExpiryCapabilityValidationError) ErrorName() string { + return "IssuanceExpiryCapabilityValidationError" +} + +// Error satisfies the builtin error interface +func (e IssuanceExpiryCapabilityValidationError) 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 %sIssuanceExpiryCapability.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = IssuanceExpiryCapabilityValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = IssuanceExpiryCapabilityValidationError{} + // Validate checks the field values on ConnectorCapabilities 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. @@ -1743,6 +2229,35 @@ func (m *ResourceTypeCapability) validate(all bool) error { // no validation rules for SkipSyncAnomalyDetection + if all { + switch v := interface{}(m.GetCredentialIssue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceTypeCapabilityValidationError{ + field: "CredentialIssue", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceTypeCapabilityValidationError{ + field: "CredentialIssue", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCredentialIssue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceTypeCapabilityValidationError{ + field: "CredentialIssue", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return ResourceTypeCapabilityMultiError(errors) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go index 8db88dda..e099524c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go @@ -13,6 +13,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + durationpb "google.golang.org/protobuf/types/known/durationpb" structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" unsafe "unsafe" @@ -42,6 +43,9 @@ const ( Capability_CAPABILITY_TARGETED_SYNC Capability = 11 Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC Capability = 13 + // The connector can mint new credentials for an existing identity via + // CredentialManagerService.IssueCredential. + Capability_CAPABILITY_CREDENTIAL_ISSUE Capability = 14 ) // Enum value maps for Capability. @@ -61,6 +65,7 @@ var ( 11: "CAPABILITY_TARGETED_SYNC", 12: "CAPABILITY_EVENT_FEED_V2", 13: "CAPABILITY_SERVICE_MODE_TARGETED_SYNC", + 14: "CAPABILITY_CREDENTIAL_ISSUE", } Capability_value = map[string]int32{ "CAPABILITY_UNSPECIFIED": 0, @@ -77,6 +82,7 @@ var ( "CAPABILITY_TARGETED_SYNC": 11, "CAPABILITY_EVENT_FEED_V2": 12, "CAPABILITY_SERVICE_MODE_TARGETED_SYNC": 13, + "CAPABILITY_CREDENTIAL_ISSUE": 14, } ) @@ -110,6 +116,10 @@ const ( CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD CapabilityDetailCredentialOption = 2 CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO CapabilityDetailCredentialOption = 3 CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD CapabilityDetailCredentialOption = 4 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY CapabilityDetailCredentialOption = 5 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR CapabilityDetailCredentialOption = 6 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN CapabilityDetailCredentialOption = 7 + CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET CapabilityDetailCredentialOption = 8 ) // Enum value maps for CapabilityDetailCredentialOption. @@ -120,6 +130,10 @@ var ( 2: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD", 3: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO", 4: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD", + 5: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY", + 6: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR", + 7: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN", + 8: "CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET", } CapabilityDetailCredentialOption_value = map[string]int32{ "CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED": 0, @@ -127,6 +141,10 @@ var ( "CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD": 2, "CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO": 3, "CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD": 4, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY": 5, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR": 6, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN": 7, + "CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET": 8, } ) @@ -745,6 +763,359 @@ func (b0 CredentialDetailsCredentialRotation_builder) Build() *CredentialDetails return m0 } +// Advertises which credential options CredentialManagerService.IssueCredential +// supports for this identity type. +type CredentialDetailsCredentialIssue struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Options *[]*CredentialIssueOptionDescriptor `protobuf:"bytes,1,rep,name=options,proto3"` + xxx_hidden_PreferredOption CapabilityDetailCredentialOption `protobuf:"varint,2,opt,name=preferred_option,json=preferredOption,proto3,enum=c1.connector.v2.CapabilityDetailCredentialOption"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialDetailsCredentialIssue) Reset() { + *x = CredentialDetailsCredentialIssue{} + mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialDetailsCredentialIssue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialDetailsCredentialIssue) ProtoMessage() {} + +func (x *CredentialDetailsCredentialIssue) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialDetailsCredentialIssue) GetOptions() []*CredentialIssueOptionDescriptor { + if x != nil { + if x.xxx_hidden_Options != nil { + return *x.xxx_hidden_Options + } + } + return nil +} + +func (x *CredentialDetailsCredentialIssue) GetPreferredOption() CapabilityDetailCredentialOption { + if x != nil { + return x.xxx_hidden_PreferredOption + } + return CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED +} + +func (x *CredentialDetailsCredentialIssue) SetOptions(v []*CredentialIssueOptionDescriptor) { + x.xxx_hidden_Options = &v +} + +func (x *CredentialDetailsCredentialIssue) SetPreferredOption(v CapabilityDetailCredentialOption) { + x.xxx_hidden_PreferredOption = v +} + +type CredentialDetailsCredentialIssue_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Options []*CredentialIssueOptionDescriptor + PreferredOption CapabilityDetailCredentialOption +} + +func (b0 CredentialDetailsCredentialIssue_builder) Build() *CredentialDetailsCredentialIssue { + m0 := &CredentialDetailsCredentialIssue{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Options = &b.Options + x.xxx_hidden_PreferredOption = b.PreferredOption + return m0 +} + +type CredentialIssueOptionDescriptor struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Option CapabilityDetailCredentialOption `protobuf:"varint,1,opt,name=option,proto3,enum=c1.connector.v2.CapabilityDetailCredentialOption"` + xxx_hidden_KeyProfiles *[]*KeyGenerationProfile `protobuf:"bytes,2,rep,name=key_profiles,json=keyProfiles,proto3"` + xxx_hidden_Expiry *IssuanceExpiryCapability `protobuf:"bytes,3,opt,name=expiry,proto3"` + xxx_hidden_Scopes []string `protobuf:"bytes,4,rep,name=scopes,proto3"` + xxx_hidden_CustomScopesAllowed bool `protobuf:"varint,5,opt,name=custom_scopes_allowed,json=customScopesAllowed,proto3"` + xxx_hidden_CustomAudiencesAllowed bool `protobuf:"varint,6,opt,name=custom_audiences_allowed,json=customAudiencesAllowed,proto3"` + xxx_hidden_Audiences []string `protobuf:"bytes,7,rep,name=audiences,proto3"` + xxx_hidden_ResourceMode CredentialResourceMode `protobuf:"varint,8,opt,name=resource_mode,json=resourceMode,proto3,enum=c1.connector.v2.CredentialResourceMode"` + xxx_hidden_SecretResourceTypeId string `protobuf:"bytes,9,opt,name=secret_resource_type_id,json=secretResourceTypeId,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptionDescriptor) Reset() { + *x = CredentialIssueOptionDescriptor{} + mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptionDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptionDescriptor) ProtoMessage() {} + +func (x *CredentialIssueOptionDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptionDescriptor) GetOption() CapabilityDetailCredentialOption { + if x != nil { + return x.xxx_hidden_Option + } + return CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED +} + +func (x *CredentialIssueOptionDescriptor) GetKeyProfiles() []*KeyGenerationProfile { + if x != nil { + if x.xxx_hidden_KeyProfiles != nil { + return *x.xxx_hidden_KeyProfiles + } + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetExpiry() *IssuanceExpiryCapability { + if x != nil { + return x.xxx_hidden_Expiry + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetScopes() []string { + if x != nil { + return x.xxx_hidden_Scopes + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetCustomScopesAllowed() bool { + if x != nil { + return x.xxx_hidden_CustomScopesAllowed + } + return false +} + +func (x *CredentialIssueOptionDescriptor) GetCustomAudiencesAllowed() bool { + if x != nil { + return x.xxx_hidden_CustomAudiencesAllowed + } + return false +} + +func (x *CredentialIssueOptionDescriptor) GetAudiences() []string { + if x != nil { + return x.xxx_hidden_Audiences + } + return nil +} + +func (x *CredentialIssueOptionDescriptor) GetResourceMode() CredentialResourceMode { + if x != nil { + return x.xxx_hidden_ResourceMode + } + return CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED +} + +func (x *CredentialIssueOptionDescriptor) GetSecretResourceTypeId() string { + if x != nil { + return x.xxx_hidden_SecretResourceTypeId + } + return "" +} + +func (x *CredentialIssueOptionDescriptor) SetOption(v CapabilityDetailCredentialOption) { + x.xxx_hidden_Option = v +} + +func (x *CredentialIssueOptionDescriptor) SetKeyProfiles(v []*KeyGenerationProfile) { + x.xxx_hidden_KeyProfiles = &v +} + +func (x *CredentialIssueOptionDescriptor) SetExpiry(v *IssuanceExpiryCapability) { + x.xxx_hidden_Expiry = v +} + +func (x *CredentialIssueOptionDescriptor) SetScopes(v []string) { + x.xxx_hidden_Scopes = v +} + +func (x *CredentialIssueOptionDescriptor) SetCustomScopesAllowed(v bool) { + x.xxx_hidden_CustomScopesAllowed = v +} + +func (x *CredentialIssueOptionDescriptor) SetCustomAudiencesAllowed(v bool) { + x.xxx_hidden_CustomAudiencesAllowed = v +} + +func (x *CredentialIssueOptionDescriptor) SetAudiences(v []string) { + x.xxx_hidden_Audiences = v +} + +func (x *CredentialIssueOptionDescriptor) SetResourceMode(v CredentialResourceMode) { + x.xxx_hidden_ResourceMode = v +} + +func (x *CredentialIssueOptionDescriptor) SetSecretResourceTypeId(v string) { + x.xxx_hidden_SecretResourceTypeId = v +} + +func (x *CredentialIssueOptionDescriptor) HasExpiry() bool { + if x == nil { + return false + } + return x.xxx_hidden_Expiry != nil +} + +func (x *CredentialIssueOptionDescriptor) ClearExpiry() { + x.xxx_hidden_Expiry = nil +} + +type CredentialIssueOptionDescriptor_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Option CapabilityDetailCredentialOption + KeyProfiles []*KeyGenerationProfile + Expiry *IssuanceExpiryCapability + Scopes []string + CustomScopesAllowed bool + CustomAudiencesAllowed bool + Audiences []string + ResourceMode CredentialResourceMode + // Resource type returned by IssueCredential. It must be registered with a + // ResourceDeleterV2 so every issued credential has a provider revoke path, + // including virtual credentials that cannot be listed later. + SecretResourceTypeId string +} + +func (b0 CredentialIssueOptionDescriptor_builder) Build() *CredentialIssueOptionDescriptor { + m0 := &CredentialIssueOptionDescriptor{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Option = b.Option + x.xxx_hidden_KeyProfiles = &b.KeyProfiles + x.xxx_hidden_Expiry = b.Expiry + x.xxx_hidden_Scopes = b.Scopes + x.xxx_hidden_CustomScopesAllowed = b.CustomScopesAllowed + x.xxx_hidden_CustomAudiencesAllowed = b.CustomAudiencesAllowed + x.xxx_hidden_Audiences = b.Audiences + x.xxx_hidden_ResourceMode = b.ResourceMode + x.xxx_hidden_SecretResourceTypeId = b.SecretResourceTypeId + return m0 +} + +type IssuanceExpiryCapability struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Min *durationpb.Duration `protobuf:"bytes,1,opt,name=min,proto3"` + xxx_hidden_Max *durationpb.Duration `protobuf:"bytes,2,opt,name=max,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IssuanceExpiryCapability) Reset() { + *x = IssuanceExpiryCapability{} + mi := &file_c1_connector_v2_connector_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IssuanceExpiryCapability) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IssuanceExpiryCapability) ProtoMessage() {} + +func (x *IssuanceExpiryCapability) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_connector_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) +} + +func (x *IssuanceExpiryCapability) GetMin() *durationpb.Duration { + if x != nil { + return x.xxx_hidden_Min + } + return nil +} + +func (x *IssuanceExpiryCapability) GetMax() *durationpb.Duration { + if x != nil { + return x.xxx_hidden_Max + } + return nil +} + +func (x *IssuanceExpiryCapability) SetMin(v *durationpb.Duration) { + x.xxx_hidden_Min = v +} + +func (x *IssuanceExpiryCapability) SetMax(v *durationpb.Duration) { + x.xxx_hidden_Max = v +} + +func (x *IssuanceExpiryCapability) HasMin() bool { + if x == nil { + return false + } + return x.xxx_hidden_Min != nil +} + +func (x *IssuanceExpiryCapability) HasMax() bool { + if x == nil { + return false + } + return x.xxx_hidden_Max != nil +} + +func (x *IssuanceExpiryCapability) ClearMin() { + x.xxx_hidden_Min = nil +} + +func (x *IssuanceExpiryCapability) ClearMax() { + x.xxx_hidden_Max = nil +} + +type IssuanceExpiryCapability_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Min *durationpb.Duration + Max *durationpb.Duration +} + +func (b0 IssuanceExpiryCapability_builder) Build() *IssuanceExpiryCapability { + m0 := &IssuanceExpiryCapability{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Min = b.Min + x.xxx_hidden_Max = b.Max + return m0 +} + type ConnectorCapabilities struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_ResourceTypeCapabilities *[]*ResourceTypeCapability `protobuf:"bytes,1,rep,name=resource_type_capabilities,json=resourceTypeCapabilities,proto3"` @@ -756,7 +1127,7 @@ type ConnectorCapabilities struct { func (x *ConnectorCapabilities) Reset() { *x = ConnectorCapabilities{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + mi := &file_c1_connector_v2_connector_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -768,7 +1139,7 @@ func (x *ConnectorCapabilities) String() string { func (*ConnectorCapabilities) ProtoMessage() {} func (x *ConnectorCapabilities) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[6] + mi := &file_c1_connector_v2_connector_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -852,7 +1223,7 @@ type CapabilityPermission struct { func (x *CapabilityPermission) Reset() { *x = CapabilityPermission{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + mi := &file_c1_connector_v2_connector_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -864,7 +1235,7 @@ func (x *CapabilityPermission) String() string { func (*CapabilityPermission) ProtoMessage() {} func (x *CapabilityPermission) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[7] + mi := &file_c1_connector_v2_connector_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -909,7 +1280,7 @@ type CapabilityPermissions struct { func (x *CapabilityPermissions) Reset() { *x = CapabilityPermissions{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[8] + mi := &file_c1_connector_v2_connector_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -921,7 +1292,7 @@ func (x *CapabilityPermissions) String() string { func (*CapabilityPermissions) ProtoMessage() {} func (x *CapabilityPermissions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[8] + mi := &file_c1_connector_v2_connector_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -967,7 +1338,7 @@ type OptInRequired struct { func (x *OptInRequired) Reset() { *x = OptInRequired{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[9] + mi := &file_c1_connector_v2_connector_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -979,7 +1350,7 @@ func (x *OptInRequired) String() string { func (*OptInRequired) ProtoMessage() {} func (x *OptInRequired) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[9] + mi := &file_c1_connector_v2_connector_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1014,7 +1385,7 @@ type SkipSyncAnomalyDetection struct { func (x *SkipSyncAnomalyDetection) Reset() { *x = SkipSyncAnomalyDetection{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[10] + mi := &file_c1_connector_v2_connector_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1026,7 +1397,7 @@ func (x *SkipSyncAnomalyDetection) String() string { func (*SkipSyncAnomalyDetection) ProtoMessage() {} func (x *SkipSyncAnomalyDetection) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[10] + mi := &file_c1_connector_v2_connector_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1050,19 +1421,20 @@ func (b0 SkipSyncAnomalyDetection_builder) Build() *SkipSyncAnomalyDetection { } type ResourceTypeCapability struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_ResourceType *ResourceType `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3"` - xxx_hidden_Capabilities []Capability `protobuf:"varint,2,rep,packed,name=capabilities,proto3,enum=c1.connector.v2.Capability"` - xxx_hidden_Permissions *CapabilityPermissions `protobuf:"bytes,3,opt,name=permissions,proto3"` - xxx_hidden_OptInRequired bool `protobuf:"varint,4,opt,name=opt_in_required,json=optInRequired,proto3"` - xxx_hidden_SkipSyncAnomalyDetection bool `protobuf:"varint,5,opt,name=skip_sync_anomaly_detection,json=skipSyncAnomalyDetection,proto3"` + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_ResourceType *ResourceType `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3"` + xxx_hidden_Capabilities []Capability `protobuf:"varint,2,rep,packed,name=capabilities,proto3,enum=c1.connector.v2.Capability"` + xxx_hidden_Permissions *CapabilityPermissions `protobuf:"bytes,3,opt,name=permissions,proto3"` + xxx_hidden_OptInRequired bool `protobuf:"varint,4,opt,name=opt_in_required,json=optInRequired,proto3"` + xxx_hidden_SkipSyncAnomalyDetection bool `protobuf:"varint,5,opt,name=skip_sync_anomaly_detection,json=skipSyncAnomalyDetection,proto3"` + xxx_hidden_CredentialIssue *CredentialDetailsCredentialIssue `protobuf:"bytes,6,opt,name=credential_issue,json=credentialIssue,proto3"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ResourceTypeCapability) Reset() { *x = ResourceTypeCapability{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[11] + mi := &file_c1_connector_v2_connector_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1074,7 +1446,7 @@ func (x *ResourceTypeCapability) String() string { func (*ResourceTypeCapability) ProtoMessage() {} func (x *ResourceTypeCapability) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[11] + mi := &file_c1_connector_v2_connector_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1120,6 +1492,13 @@ func (x *ResourceTypeCapability) GetSkipSyncAnomalyDetection() bool { return false } +func (x *ResourceTypeCapability) GetCredentialIssue() *CredentialDetailsCredentialIssue { + if x != nil { + return x.xxx_hidden_CredentialIssue + } + return nil +} + func (x *ResourceTypeCapability) SetResourceType(v *ResourceType) { x.xxx_hidden_ResourceType = v } @@ -1140,6 +1519,10 @@ func (x *ResourceTypeCapability) SetSkipSyncAnomalyDetection(v bool) { x.xxx_hidden_SkipSyncAnomalyDetection = v } +func (x *ResourceTypeCapability) SetCredentialIssue(v *CredentialDetailsCredentialIssue) { + x.xxx_hidden_CredentialIssue = v +} + func (x *ResourceTypeCapability) HasResourceType() bool { if x == nil { return false @@ -1154,6 +1537,13 @@ func (x *ResourceTypeCapability) HasPermissions() bool { return x.xxx_hidden_Permissions != nil } +func (x *ResourceTypeCapability) HasCredentialIssue() bool { + if x == nil { + return false + } + return x.xxx_hidden_CredentialIssue != nil +} + func (x *ResourceTypeCapability) ClearResourceType() { x.xxx_hidden_ResourceType = nil } @@ -1162,6 +1552,10 @@ func (x *ResourceTypeCapability) ClearPermissions() { x.xxx_hidden_Permissions = nil } +func (x *ResourceTypeCapability) ClearCredentialIssue() { + x.xxx_hidden_CredentialIssue = nil +} + type ResourceTypeCapability_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. @@ -1170,6 +1564,7 @@ type ResourceTypeCapability_builder struct { Permissions *CapabilityPermissions OptInRequired bool SkipSyncAnomalyDetection bool + CredentialIssue *CredentialDetailsCredentialIssue } func (b0 ResourceTypeCapability_builder) Build() *ResourceTypeCapability { @@ -1181,6 +1576,7 @@ func (b0 ResourceTypeCapability_builder) Build() *ResourceTypeCapability { x.xxx_hidden_Permissions = b.Permissions x.xxx_hidden_OptInRequired = b.OptInRequired x.xxx_hidden_SkipSyncAnomalyDetection = b.SkipSyncAnomalyDetection + x.xxx_hidden_CredentialIssue = b.CredentialIssue return m0 } @@ -1192,7 +1588,7 @@ type ConnectorServiceGetMetadataRequest struct { func (x *ConnectorServiceGetMetadataRequest) Reset() { *x = ConnectorServiceGetMetadataRequest{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[12] + mi := &file_c1_connector_v2_connector_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1204,7 +1600,7 @@ func (x *ConnectorServiceGetMetadataRequest) String() string { func (*ConnectorServiceGetMetadataRequest) ProtoMessage() {} func (x *ConnectorServiceGetMetadataRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[12] + mi := &file_c1_connector_v2_connector_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1236,7 +1632,7 @@ type ConnectorServiceGetMetadataResponse struct { func (x *ConnectorServiceGetMetadataResponse) Reset() { *x = ConnectorServiceGetMetadataResponse{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[13] + mi := &file_c1_connector_v2_connector_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1248,7 +1644,7 @@ func (x *ConnectorServiceGetMetadataResponse) String() string { func (*ConnectorServiceGetMetadataResponse) ProtoMessage() {} func (x *ConnectorServiceGetMetadataResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[13] + mi := &file_c1_connector_v2_connector_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1303,7 +1699,7 @@ type ConnectorServiceValidateRequest struct { func (x *ConnectorServiceValidateRequest) Reset() { *x = ConnectorServiceValidateRequest{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[14] + mi := &file_c1_connector_v2_connector_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1315,7 +1711,7 @@ func (x *ConnectorServiceValidateRequest) String() string { func (*ConnectorServiceValidateRequest) ProtoMessage() {} func (x *ConnectorServiceValidateRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[14] + mi := &file_c1_connector_v2_connector_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1350,7 +1746,7 @@ type ConnectorServiceValidateResponse struct { func (x *ConnectorServiceValidateResponse) Reset() { *x = ConnectorServiceValidateResponse{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[15] + mi := &file_c1_connector_v2_connector_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1362,7 +1758,7 @@ func (x *ConnectorServiceValidateResponse) String() string { func (*ConnectorServiceValidateResponse) ProtoMessage() {} func (x *ConnectorServiceValidateResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[15] + mi := &file_c1_connector_v2_connector_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1422,7 +1818,7 @@ type ConnectorAccountCreationSchema struct { func (x *ConnectorAccountCreationSchema) Reset() { *x = ConnectorAccountCreationSchema{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[16] + mi := &file_c1_connector_v2_connector_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1434,7 +1830,7 @@ func (x *ConnectorAccountCreationSchema) String() string { func (*ConnectorAccountCreationSchema) ProtoMessage() {} func (x *ConnectorAccountCreationSchema) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[16] + mi := &file_c1_connector_v2_connector_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1485,7 +1881,7 @@ type ConnectorAccountCreationSchema_Field struct { func (x *ConnectorAccountCreationSchema_Field) Reset() { *x = ConnectorAccountCreationSchema_Field{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[18] + mi := &file_c1_connector_v2_connector_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1497,7 +1893,7 @@ func (x *ConnectorAccountCreationSchema_Field) String() string { func (*ConnectorAccountCreationSchema_Field) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_Field) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[18] + mi := &file_c1_connector_v2_connector_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1816,7 +2212,7 @@ func (b0 ConnectorAccountCreationSchema_Field_builder) Build() *ConnectorAccount type case_ConnectorAccountCreationSchema_Field_Field protoreflect.FieldNumber func (x case_ConnectorAccountCreationSchema_Field_Field) String() string { - md := file_c1_connector_v2_connector_proto_msgTypes[18].Descriptor() + md := file_c1_connector_v2_connector_proto_msgTypes[21].Descriptor() if x == 0 { return "not set" } @@ -1873,7 +2269,7 @@ type ConnectorAccountCreationSchema_StringField struct { func (x *ConnectorAccountCreationSchema_StringField) Reset() { *x = ConnectorAccountCreationSchema_StringField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[19] + mi := &file_c1_connector_v2_connector_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1885,7 +2281,7 @@ func (x *ConnectorAccountCreationSchema_StringField) String() string { func (*ConnectorAccountCreationSchema_StringField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_StringField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[19] + mi := &file_c1_connector_v2_connector_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1951,7 +2347,7 @@ type ConnectorAccountCreationSchema_BoolField struct { func (x *ConnectorAccountCreationSchema_BoolField) Reset() { *x = ConnectorAccountCreationSchema_BoolField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[20] + mi := &file_c1_connector_v2_connector_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1963,7 +2359,7 @@ func (x *ConnectorAccountCreationSchema_BoolField) String() string { func (*ConnectorAccountCreationSchema_BoolField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_BoolField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[20] + mi := &file_c1_connector_v2_connector_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2024,7 +2420,7 @@ type ConnectorAccountCreationSchema_StringListField struct { func (x *ConnectorAccountCreationSchema_StringListField) Reset() { *x = ConnectorAccountCreationSchema_StringListField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[21] + mi := &file_c1_connector_v2_connector_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2036,7 +2432,7 @@ func (x *ConnectorAccountCreationSchema_StringListField) String() string { func (*ConnectorAccountCreationSchema_StringListField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_StringListField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[21] + mi := &file_c1_connector_v2_connector_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2083,7 +2479,7 @@ type ConnectorAccountCreationSchema_IntField struct { func (x *ConnectorAccountCreationSchema_IntField) Reset() { *x = ConnectorAccountCreationSchema_IntField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[22] + mi := &file_c1_connector_v2_connector_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2095,7 +2491,7 @@ func (x *ConnectorAccountCreationSchema_IntField) String() string { func (*ConnectorAccountCreationSchema_IntField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_IntField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[22] + mi := &file_c1_connector_v2_connector_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2156,7 +2552,7 @@ type ConnectorAccountCreationSchema_MapField struct { func (x *ConnectorAccountCreationSchema_MapField) Reset() { *x = ConnectorAccountCreationSchema_MapField{} - mi := &file_c1_connector_v2_connector_proto_msgTypes[23] + mi := &file_c1_connector_v2_connector_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2168,7 +2564,7 @@ func (x *ConnectorAccountCreationSchema_MapField) String() string { func (*ConnectorAccountCreationSchema_MapField) ProtoMessage() {} func (x *ConnectorAccountCreationSchema_MapField) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_connector_proto_msgTypes[23] + mi := &file_c1_connector_v2_connector_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2208,7 +2604,7 @@ var File_c1_connector_v2_connector_proto protoreflect.FileDescriptor const file_c1_connector_v2_connector_proto_rawDesc = "" + "\n" + - "\x1fc1/connector/v2/connector.proto\x12\x0fc1.connector.v2\x1a\x1bc1/connector/v2/asset.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\x8d\x01\n" + + "\x1fc1/connector/v2/connector.proto\x12\x0fc1.connector.v2\x1a\x1bc1/connector/v2/asset.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\x8d\x01\n" + "\x1eConnectorServiceCleanupRequest\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + "\x0eactive_sync_id\x18\x02 \x01(\tB\r\xfaB\n" + @@ -2235,7 +2631,24 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x1bpreferred_credential_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x19preferredCredentialOption\"\x8d\x02\n" + "#CredentialDetailsCredentialRotation\x12s\n" + "\x1csupported_credential_options\x18\x01 \x03(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x1asupportedCredentialOptions\x12q\n" + - "\x1bpreferred_credential_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x19preferredCredentialOption\"\xa5\x02\n" + + "\x1bpreferred_credential_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x19preferredCredentialOption\"\xcc\x01\n" + + " CredentialDetailsCredentialIssue\x12J\n" + + "\aoptions\x18\x01 \x03(\v20.c1.connector.v2.CredentialIssueOptionDescriptorR\aoptions\x12\\\n" + + "\x10preferred_option\x18\x02 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x0fpreferredOption\"\xae\x04\n" + + "\x1fCredentialIssueOptionDescriptor\x12I\n" + + "\x06option\x18\x01 \x01(\x0e21.c1.connector.v2.CapabilityDetailCredentialOptionR\x06option\x12H\n" + + "\fkey_profiles\x18\x02 \x03(\v2%.c1.connector.v2.KeyGenerationProfileR\vkeyProfiles\x12A\n" + + "\x06expiry\x18\x03 \x01(\v2).c1.connector.v2.IssuanceExpiryCapabilityR\x06expiry\x12\x16\n" + + "\x06scopes\x18\x04 \x03(\tR\x06scopes\x122\n" + + "\x15custom_scopes_allowed\x18\x05 \x01(\bR\x13customScopesAllowed\x128\n" + + "\x18custom_audiences_allowed\x18\x06 \x01(\bR\x16customAudiencesAllowed\x12\x1c\n" + + "\taudiences\x18\a \x03(\tR\taudiences\x12L\n" + + "\rresource_mode\x18\b \x01(\x0e2'.c1.connector.v2.CredentialResourceModeR\fresourceMode\x12A\n" + + "\x17secret_resource_type_id\x18\t \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\x14secretResourceTypeId\"t\n" + + "\x18IssuanceExpiryCapability\x12+\n" + + "\x03min\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x03min\x12+\n" + + "\x03max\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x03max\"\xa5\x02\n" + "\x15ConnectorCapabilities\x12e\n" + "\x1aresource_type_capabilities\x18\x01 \x03(\v2'.c1.connector.v2.ResourceTypeCapabilityR\x18resourceTypeCapabilities\x12R\n" + "\x16connector_capabilities\x18\x02 \x03(\x0e2\x1b.c1.connector.v2.CapabilityR\x15connectorCapabilities\x12Q\n" + @@ -2247,13 +2660,14 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x15CapabilityPermissions\x12G\n" + "\vpermissions\x18\x01 \x03(\v2%.c1.connector.v2.CapabilityPermissionR\vpermissions\"\x0f\n" + "\rOptInRequired\"\x1a\n" + - "\x18SkipSyncAnomalyDetection\"\xce\x02\n" + + "\x18SkipSyncAnomalyDetection\"\xac\x03\n" + "\x16ResourceTypeCapability\x12B\n" + "\rresource_type\x18\x01 \x01(\v2\x1d.c1.connector.v2.ResourceTypeR\fresourceType\x12?\n" + "\fcapabilities\x18\x02 \x03(\x0e2\x1b.c1.connector.v2.CapabilityR\fcapabilities\x12H\n" + "\vpermissions\x18\x03 \x01(\v2&.c1.connector.v2.CapabilityPermissionsR\vpermissions\x12&\n" + "\x0fopt_in_required\x18\x04 \x01(\bR\roptInRequired\x12=\n" + - "\x1bskip_sync_anomaly_detection\x18\x05 \x01(\bR\x18skipSyncAnomalyDetection\"$\n" + + "\x1bskip_sync_anomaly_detection\x18\x05 \x01(\bR\x18skipSyncAnomalyDetection\x12\\\n" + + "\x10credential_issue\x18\x06 \x01(\v21.c1.connector.v2.CredentialDetailsCredentialIssueR\x0fcredentialIssue\"$\n" + "\"ConnectorServiceGetMetadataRequest\"e\n" + "#ConnectorServiceGetMetadataResponse\x12>\n" + "\bmetadata\x18\x01 \x01(\v2\".c1.connector.v2.ConnectorMetadataR\bmetadata\"!\n" + @@ -2298,7 +2712,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\rdefault_value\x18\x01 \x03(\v2J.c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntryR\fdefaultValue\x1av\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12K\n" + - "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xb1\x03\n" + + "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xd2\x03\n" + "\n" + "Capability\x12\x1a\n" + "\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\x18\n" + @@ -2315,20 +2729,25 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x12\x1c\n" + "\x18CAPABILITY_TARGETED_SYNC\x10\v\x12\x1c\n" + "\x18CAPABILITY_EVENT_FEED_V2\x10\f\x12)\n" + - "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r*\xae\x02\n" + + "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r\x12\x1f\n" + + "\x1bCAPABILITY_CREDENTIAL_ISSUE\x10\x0e*\xf6\x03\n" + " CapabilityDetailCredentialOption\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED\x10\x00\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD\x10\x01\x127\n" + "3CAPABILITY_DETAIL_CREDENTIAL_OPTION_RANDOM_PASSWORD\x10\x02\x12+\n" + "'CAPABILITY_DETAIL_CREDENTIAL_OPTION_SSO\x10\x03\x12:\n" + - "6CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD\x10\x042\xeb\x02\n" + + "6CAPABILITY_DETAIL_CREDENTIAL_OPTION_ENCRYPTED_PASSWORD\x10\x04\x12/\n" + + "+CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY\x10\x05\x12/\n" + + "+CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR\x10\x06\x12-\n" + + ")CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN\x10\a\x125\n" + + "1CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET\x10\b2\xeb\x02\n" + "\x10ConnectorService\x12x\n" + "\vGetMetadata\x123.c1.connector.v2.ConnectorServiceGetMetadataRequest\x1a4.c1.connector.v2.ConnectorServiceGetMetadataResponse\x12o\n" + "\bValidate\x120.c1.connector.v2.ConnectorServiceValidateRequest\x1a1.c1.connector.v2.ConnectorServiceValidateResponse\x12l\n" + "\aCleanup\x12/.c1.connector.v2.ConnectorServiceCleanupRequest\x1a0.c1.connector.v2.ConnectorServiceCleanupResponseB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" var file_c1_connector_v2_connector_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_connector_v2_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_c1_connector_v2_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_c1_connector_v2_connector_proto_goTypes = []any{ (Capability)(0), // 0: c1.connector.v2.Capability (CapabilityDetailCredentialOption)(0), // 1: c1.connector.v2.CapabilityDetailCredentialOption @@ -2338,74 +2757,89 @@ var file_c1_connector_v2_connector_proto_goTypes = []any{ (*CredentialDetails)(nil), // 5: c1.connector.v2.CredentialDetails (*CredentialDetailsAccountProvisioning)(nil), // 6: c1.connector.v2.CredentialDetailsAccountProvisioning (*CredentialDetailsCredentialRotation)(nil), // 7: c1.connector.v2.CredentialDetailsCredentialRotation - (*ConnectorCapabilities)(nil), // 8: c1.connector.v2.ConnectorCapabilities - (*CapabilityPermission)(nil), // 9: c1.connector.v2.CapabilityPermission - (*CapabilityPermissions)(nil), // 10: c1.connector.v2.CapabilityPermissions - (*OptInRequired)(nil), // 11: c1.connector.v2.OptInRequired - (*SkipSyncAnomalyDetection)(nil), // 12: c1.connector.v2.SkipSyncAnomalyDetection - (*ResourceTypeCapability)(nil), // 13: c1.connector.v2.ResourceTypeCapability - (*ConnectorServiceGetMetadataRequest)(nil), // 14: c1.connector.v2.ConnectorServiceGetMetadataRequest - (*ConnectorServiceGetMetadataResponse)(nil), // 15: c1.connector.v2.ConnectorServiceGetMetadataResponse - (*ConnectorServiceValidateRequest)(nil), // 16: c1.connector.v2.ConnectorServiceValidateRequest - (*ConnectorServiceValidateResponse)(nil), // 17: c1.connector.v2.ConnectorServiceValidateResponse - (*ConnectorAccountCreationSchema)(nil), // 18: c1.connector.v2.ConnectorAccountCreationSchema - nil, // 19: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry - (*ConnectorAccountCreationSchema_Field)(nil), // 20: c1.connector.v2.ConnectorAccountCreationSchema.Field - (*ConnectorAccountCreationSchema_StringField)(nil), // 21: c1.connector.v2.ConnectorAccountCreationSchema.StringField - (*ConnectorAccountCreationSchema_BoolField)(nil), // 22: c1.connector.v2.ConnectorAccountCreationSchema.BoolField - (*ConnectorAccountCreationSchema_StringListField)(nil), // 23: c1.connector.v2.ConnectorAccountCreationSchema.StringListField - (*ConnectorAccountCreationSchema_IntField)(nil), // 24: c1.connector.v2.ConnectorAccountCreationSchema.IntField - (*ConnectorAccountCreationSchema_MapField)(nil), // 25: c1.connector.v2.ConnectorAccountCreationSchema.MapField - nil, // 26: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry - (*anypb.Any)(nil), // 27: google.protobuf.Any - (*AssetRef)(nil), // 28: c1.connector.v2.AssetRef - (*structpb.Struct)(nil), // 29: google.protobuf.Struct - (*ResourceType)(nil), // 30: c1.connector.v2.ResourceType + (*CredentialDetailsCredentialIssue)(nil), // 8: c1.connector.v2.CredentialDetailsCredentialIssue + (*CredentialIssueOptionDescriptor)(nil), // 9: c1.connector.v2.CredentialIssueOptionDescriptor + (*IssuanceExpiryCapability)(nil), // 10: c1.connector.v2.IssuanceExpiryCapability + (*ConnectorCapabilities)(nil), // 11: c1.connector.v2.ConnectorCapabilities + (*CapabilityPermission)(nil), // 12: c1.connector.v2.CapabilityPermission + (*CapabilityPermissions)(nil), // 13: c1.connector.v2.CapabilityPermissions + (*OptInRequired)(nil), // 14: c1.connector.v2.OptInRequired + (*SkipSyncAnomalyDetection)(nil), // 15: c1.connector.v2.SkipSyncAnomalyDetection + (*ResourceTypeCapability)(nil), // 16: c1.connector.v2.ResourceTypeCapability + (*ConnectorServiceGetMetadataRequest)(nil), // 17: c1.connector.v2.ConnectorServiceGetMetadataRequest + (*ConnectorServiceGetMetadataResponse)(nil), // 18: c1.connector.v2.ConnectorServiceGetMetadataResponse + (*ConnectorServiceValidateRequest)(nil), // 19: c1.connector.v2.ConnectorServiceValidateRequest + (*ConnectorServiceValidateResponse)(nil), // 20: c1.connector.v2.ConnectorServiceValidateResponse + (*ConnectorAccountCreationSchema)(nil), // 21: c1.connector.v2.ConnectorAccountCreationSchema + nil, // 22: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry + (*ConnectorAccountCreationSchema_Field)(nil), // 23: c1.connector.v2.ConnectorAccountCreationSchema.Field + (*ConnectorAccountCreationSchema_StringField)(nil), // 24: c1.connector.v2.ConnectorAccountCreationSchema.StringField + (*ConnectorAccountCreationSchema_BoolField)(nil), // 25: c1.connector.v2.ConnectorAccountCreationSchema.BoolField + (*ConnectorAccountCreationSchema_StringListField)(nil), // 26: c1.connector.v2.ConnectorAccountCreationSchema.StringListField + (*ConnectorAccountCreationSchema_IntField)(nil), // 27: c1.connector.v2.ConnectorAccountCreationSchema.IntField + (*ConnectorAccountCreationSchema_MapField)(nil), // 28: c1.connector.v2.ConnectorAccountCreationSchema.MapField + nil, // 29: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry + (*anypb.Any)(nil), // 30: google.protobuf.Any + (*AssetRef)(nil), // 31: c1.connector.v2.AssetRef + (*structpb.Struct)(nil), // 32: google.protobuf.Struct + (*KeyGenerationProfile)(nil), // 33: c1.connector.v2.KeyGenerationProfile + (CredentialResourceMode)(0), // 34: c1.connector.v2.CredentialResourceMode + (*durationpb.Duration)(nil), // 35: google.protobuf.Duration + (*ResourceType)(nil), // 36: c1.connector.v2.ResourceType } var file_c1_connector_v2_connector_proto_depIdxs = []int32{ - 27, // 0: c1.connector.v2.ConnectorServiceCleanupRequest.annotations:type_name -> google.protobuf.Any - 27, // 1: c1.connector.v2.ConnectorServiceCleanupResponse.annotations:type_name -> google.protobuf.Any - 28, // 2: c1.connector.v2.ConnectorMetadata.icon:type_name -> c1.connector.v2.AssetRef - 28, // 3: c1.connector.v2.ConnectorMetadata.logo:type_name -> c1.connector.v2.AssetRef - 29, // 4: c1.connector.v2.ConnectorMetadata.profile:type_name -> google.protobuf.Struct - 27, // 5: c1.connector.v2.ConnectorMetadata.annotations:type_name -> google.protobuf.Any - 8, // 6: c1.connector.v2.ConnectorMetadata.capabilities:type_name -> c1.connector.v2.ConnectorCapabilities - 18, // 7: c1.connector.v2.ConnectorMetadata.account_creation_schema:type_name -> c1.connector.v2.ConnectorAccountCreationSchema + 30, // 0: c1.connector.v2.ConnectorServiceCleanupRequest.annotations:type_name -> google.protobuf.Any + 30, // 1: c1.connector.v2.ConnectorServiceCleanupResponse.annotations:type_name -> google.protobuf.Any + 31, // 2: c1.connector.v2.ConnectorMetadata.icon:type_name -> c1.connector.v2.AssetRef + 31, // 3: c1.connector.v2.ConnectorMetadata.logo:type_name -> c1.connector.v2.AssetRef + 32, // 4: c1.connector.v2.ConnectorMetadata.profile:type_name -> google.protobuf.Struct + 30, // 5: c1.connector.v2.ConnectorMetadata.annotations:type_name -> google.protobuf.Any + 11, // 6: c1.connector.v2.ConnectorMetadata.capabilities:type_name -> c1.connector.v2.ConnectorCapabilities + 21, // 7: c1.connector.v2.ConnectorMetadata.account_creation_schema:type_name -> c1.connector.v2.ConnectorAccountCreationSchema 6, // 8: c1.connector.v2.CredentialDetails.capability_account_provisioning:type_name -> c1.connector.v2.CredentialDetailsAccountProvisioning 7, // 9: c1.connector.v2.CredentialDetails.capability_credential_rotation:type_name -> c1.connector.v2.CredentialDetailsCredentialRotation 1, // 10: c1.connector.v2.CredentialDetailsAccountProvisioning.supported_credential_options:type_name -> c1.connector.v2.CapabilityDetailCredentialOption 1, // 11: c1.connector.v2.CredentialDetailsAccountProvisioning.preferred_credential_option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption 1, // 12: c1.connector.v2.CredentialDetailsCredentialRotation.supported_credential_options:type_name -> c1.connector.v2.CapabilityDetailCredentialOption 1, // 13: c1.connector.v2.CredentialDetailsCredentialRotation.preferred_credential_option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption - 13, // 14: c1.connector.v2.ConnectorCapabilities.resource_type_capabilities:type_name -> c1.connector.v2.ResourceTypeCapability - 0, // 15: c1.connector.v2.ConnectorCapabilities.connector_capabilities:type_name -> c1.connector.v2.Capability - 5, // 16: c1.connector.v2.ConnectorCapabilities.credential_details:type_name -> c1.connector.v2.CredentialDetails - 9, // 17: c1.connector.v2.CapabilityPermissions.permissions:type_name -> c1.connector.v2.CapabilityPermission - 30, // 18: c1.connector.v2.ResourceTypeCapability.resource_type:type_name -> c1.connector.v2.ResourceType - 0, // 19: c1.connector.v2.ResourceTypeCapability.capabilities:type_name -> c1.connector.v2.Capability - 10, // 20: c1.connector.v2.ResourceTypeCapability.permissions:type_name -> c1.connector.v2.CapabilityPermissions - 4, // 21: c1.connector.v2.ConnectorServiceGetMetadataResponse.metadata:type_name -> c1.connector.v2.ConnectorMetadata - 27, // 22: c1.connector.v2.ConnectorServiceValidateResponse.annotations:type_name -> google.protobuf.Any - 19, // 23: c1.connector.v2.ConnectorAccountCreationSchema.field_map:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry - 20, // 24: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field - 21, // 25: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringField - 22, // 26: c1.connector.v2.ConnectorAccountCreationSchema.Field.bool_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.BoolField - 23, // 27: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_list_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringListField - 24, // 28: c1.connector.v2.ConnectorAccountCreationSchema.Field.int_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.IntField - 25, // 29: c1.connector.v2.ConnectorAccountCreationSchema.Field.map_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField - 26, // 30: c1.connector.v2.ConnectorAccountCreationSchema.MapField.default_value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry - 20, // 31: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field - 14, // 32: c1.connector.v2.ConnectorService.GetMetadata:input_type -> c1.connector.v2.ConnectorServiceGetMetadataRequest - 16, // 33: c1.connector.v2.ConnectorService.Validate:input_type -> c1.connector.v2.ConnectorServiceValidateRequest - 2, // 34: c1.connector.v2.ConnectorService.Cleanup:input_type -> c1.connector.v2.ConnectorServiceCleanupRequest - 15, // 35: c1.connector.v2.ConnectorService.GetMetadata:output_type -> c1.connector.v2.ConnectorServiceGetMetadataResponse - 17, // 36: c1.connector.v2.ConnectorService.Validate:output_type -> c1.connector.v2.ConnectorServiceValidateResponse - 3, // 37: c1.connector.v2.ConnectorService.Cleanup:output_type -> c1.connector.v2.ConnectorServiceCleanupResponse - 35, // [35:38] is the sub-list for method output_type - 32, // [32:35] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 9, // 14: c1.connector.v2.CredentialDetailsCredentialIssue.options:type_name -> c1.connector.v2.CredentialIssueOptionDescriptor + 1, // 15: c1.connector.v2.CredentialDetailsCredentialIssue.preferred_option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption + 1, // 16: c1.connector.v2.CredentialIssueOptionDescriptor.option:type_name -> c1.connector.v2.CapabilityDetailCredentialOption + 33, // 17: c1.connector.v2.CredentialIssueOptionDescriptor.key_profiles:type_name -> c1.connector.v2.KeyGenerationProfile + 10, // 18: c1.connector.v2.CredentialIssueOptionDescriptor.expiry:type_name -> c1.connector.v2.IssuanceExpiryCapability + 34, // 19: c1.connector.v2.CredentialIssueOptionDescriptor.resource_mode:type_name -> c1.connector.v2.CredentialResourceMode + 35, // 20: c1.connector.v2.IssuanceExpiryCapability.min:type_name -> google.protobuf.Duration + 35, // 21: c1.connector.v2.IssuanceExpiryCapability.max:type_name -> google.protobuf.Duration + 16, // 22: c1.connector.v2.ConnectorCapabilities.resource_type_capabilities:type_name -> c1.connector.v2.ResourceTypeCapability + 0, // 23: c1.connector.v2.ConnectorCapabilities.connector_capabilities:type_name -> c1.connector.v2.Capability + 5, // 24: c1.connector.v2.ConnectorCapabilities.credential_details:type_name -> c1.connector.v2.CredentialDetails + 12, // 25: c1.connector.v2.CapabilityPermissions.permissions:type_name -> c1.connector.v2.CapabilityPermission + 36, // 26: c1.connector.v2.ResourceTypeCapability.resource_type:type_name -> c1.connector.v2.ResourceType + 0, // 27: c1.connector.v2.ResourceTypeCapability.capabilities:type_name -> c1.connector.v2.Capability + 13, // 28: c1.connector.v2.ResourceTypeCapability.permissions:type_name -> c1.connector.v2.CapabilityPermissions + 8, // 29: c1.connector.v2.ResourceTypeCapability.credential_issue:type_name -> c1.connector.v2.CredentialDetailsCredentialIssue + 4, // 30: c1.connector.v2.ConnectorServiceGetMetadataResponse.metadata:type_name -> c1.connector.v2.ConnectorMetadata + 30, // 31: c1.connector.v2.ConnectorServiceValidateResponse.annotations:type_name -> google.protobuf.Any + 22, // 32: c1.connector.v2.ConnectorAccountCreationSchema.field_map:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry + 23, // 33: c1.connector.v2.ConnectorAccountCreationSchema.FieldMapEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field + 24, // 34: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringField + 25, // 35: c1.connector.v2.ConnectorAccountCreationSchema.Field.bool_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.BoolField + 26, // 36: c1.connector.v2.ConnectorAccountCreationSchema.Field.string_list_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.StringListField + 27, // 37: c1.connector.v2.ConnectorAccountCreationSchema.Field.int_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.IntField + 28, // 38: c1.connector.v2.ConnectorAccountCreationSchema.Field.map_field:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField + 29, // 39: c1.connector.v2.ConnectorAccountCreationSchema.MapField.default_value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry + 23, // 40: c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntry.value:type_name -> c1.connector.v2.ConnectorAccountCreationSchema.Field + 17, // 41: c1.connector.v2.ConnectorService.GetMetadata:input_type -> c1.connector.v2.ConnectorServiceGetMetadataRequest + 19, // 42: c1.connector.v2.ConnectorService.Validate:input_type -> c1.connector.v2.ConnectorServiceValidateRequest + 2, // 43: c1.connector.v2.ConnectorService.Cleanup:input_type -> c1.connector.v2.ConnectorServiceCleanupRequest + 18, // 44: c1.connector.v2.ConnectorService.GetMetadata:output_type -> c1.connector.v2.ConnectorServiceGetMetadataResponse + 20, // 45: c1.connector.v2.ConnectorService.Validate:output_type -> c1.connector.v2.ConnectorServiceValidateResponse + 3, // 46: c1.connector.v2.ConnectorService.Cleanup:output_type -> c1.connector.v2.ConnectorServiceCleanupResponse + 44, // [44:47] is the sub-list for method output_type + 41, // [41:44] is the sub-list for method input_type + 41, // [41:41] is the sub-list for extension type_name + 41, // [41:41] is the sub-list for extension extendee + 0, // [0:41] is the sub-list for field type_name } func init() { file_c1_connector_v2_connector_proto_init() } @@ -2415,23 +2849,23 @@ func file_c1_connector_v2_connector_proto_init() { } file_c1_connector_v2_asset_proto_init() file_c1_connector_v2_resource_proto_init() - file_c1_connector_v2_connector_proto_msgTypes[18].OneofWrappers = []any{ + file_c1_connector_v2_connector_proto_msgTypes[21].OneofWrappers = []any{ (*connectorAccountCreationSchema_Field_StringField)(nil), (*connectorAccountCreationSchema_Field_BoolField)(nil), (*connectorAccountCreationSchema_Field_StringListField)(nil), (*connectorAccountCreationSchema_Field_IntField)(nil), (*connectorAccountCreationSchema_Field_MapField)(nil), } - file_c1_connector_v2_connector_proto_msgTypes[19].OneofWrappers = []any{} - file_c1_connector_v2_connector_proto_msgTypes[20].OneofWrappers = []any{} file_c1_connector_v2_connector_proto_msgTypes[22].OneofWrappers = []any{} + file_c1_connector_v2_connector_proto_msgTypes[23].OneofWrappers = []any{} + file_c1_connector_v2_connector_proto_msgTypes[25].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_connector_proto_rawDesc), len(file_c1_connector_v2_connector_proto_rawDesc)), NumEnums: 2, - NumMessages: 25, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, 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 3556a8de..487b0dc5 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 @@ -26,6 +26,53 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type CredentialResourceMode int32 + +const ( + CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED CredentialResourceMode = 0 + // The credential is expected to appear in subsequent resource syncs. + CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_DISCOVERABLE CredentialResourceMode = 1 + // The provider cannot enumerate the credential after issuance. The returned + // Resource remains its stable handle for audit and provider deletion/expiry. + CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_VIRTUAL CredentialResourceMode = 2 +) + +// Enum value maps for CredentialResourceMode. +var ( + CredentialResourceMode_name = map[int32]string{ + 0: "CREDENTIAL_RESOURCE_MODE_UNSPECIFIED", + 1: "CREDENTIAL_RESOURCE_MODE_DISCOVERABLE", + 2: "CREDENTIAL_RESOURCE_MODE_VIRTUAL", + } + CredentialResourceMode_value = map[string]int32{ + "CREDENTIAL_RESOURCE_MODE_UNSPECIFIED": 0, + "CREDENTIAL_RESOURCE_MODE_DISCOVERABLE": 1, + "CREDENTIAL_RESOURCE_MODE_VIRTUAL": 2, + } +) + +func (x CredentialResourceMode) Enum() *CredentialResourceMode { + p := new(CredentialResourceMode) + *p = x + return p +} + +func (x CredentialResourceMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CredentialResourceMode) Descriptor() protoreflect.EnumDescriptor { + return file_c1_connector_v2_resource_proto_enumTypes[0].Descriptor() +} + +func (CredentialResourceMode) Type() protoreflect.EnumType { + return &file_c1_connector_v2_resource_proto_enumTypes[0] +} + +func (x CredentialResourceMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + type ResourceType_Trait int32 const ( @@ -89,11 +136,11 @@ func (x ResourceType_Trait) String() string { } func (ResourceType_Trait) Descriptor() protoreflect.EnumDescriptor { - return file_c1_connector_v2_resource_proto_enumTypes[0].Descriptor() + return file_c1_connector_v2_resource_proto_enumTypes[1].Descriptor() } func (ResourceType_Trait) Type() protoreflect.EnumType { - return &file_c1_connector_v2_resource_proto_enumTypes[0] + return &file_c1_connector_v2_resource_proto_enumTypes[1] } func (x ResourceType_Trait) Number() protoreflect.EnumNumber { @@ -133,11 +180,11 @@ func (x Resource_CreationSource) String() string { } func (Resource_CreationSource) Descriptor() protoreflect.EnumDescriptor { - return file_c1_connector_v2_resource_proto_enumTypes[1].Descriptor() + return file_c1_connector_v2_resource_proto_enumTypes[2].Descriptor() } func (Resource_CreationSource) Type() protoreflect.EnumType { - return &file_c1_connector_v2_resource_proto_enumTypes[1] + return &file_c1_connector_v2_resource_proto_enumTypes[2] } func (x Resource_CreationSource) Number() protoreflect.EnumNumber { @@ -180,11 +227,11 @@ func (x Status_ResourceStatus) String() string { } func (Status_ResourceStatus) Descriptor() protoreflect.EnumDescriptor { - return file_c1_connector_v2_resource_proto_enumTypes[2].Descriptor() + return file_c1_connector_v2_resource_proto_enumTypes[3].Descriptor() } func (Status_ResourceStatus) Type() protoreflect.EnumType { - return &file_c1_connector_v2_resource_proto_enumTypes[2] + return &file_c1_connector_v2_resource_proto_enumTypes[3] } func (x Status_ResourceStatus) Number() protoreflect.EnumNumber { @@ -1069,45 +1116,747 @@ func (x *RotateCredentialRequest) ClearCredentialOptions() { type RotateCredentialRequest_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - ResourceId *ResourceId - CredentialOptions *CredentialOptions - EncryptionConfigs []*EncryptionConfig + ResourceId *ResourceId + CredentialOptions *CredentialOptions + EncryptionConfigs []*EncryptionConfig +} + +func (b0 RotateCredentialRequest_builder) Build() *RotateCredentialRequest { + m0 := &RotateCredentialRequest{} + b, x := &b0, m0 + _, _ = b, x + x.ResourceId = b.ResourceId + x.CredentialOptions = b.CredentialOptions + x.EncryptionConfigs = b.EncryptionConfigs + return m0 +} + +type RotateCredentialResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + EncryptedData []*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` + ResourceId *ResourceId `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RotateCredentialResponse) Reset() { + *x = RotateCredentialResponse{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RotateCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RotateCredentialResponse) ProtoMessage() {} + +func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RotateCredentialResponse) GetEncryptedData() []*EncryptedData { + if x != nil { + return x.EncryptedData + } + return nil +} + +func (x *RotateCredentialResponse) GetResourceId() *ResourceId { + if x != nil { + return x.ResourceId + } + return nil +} + +func (x *RotateCredentialResponse) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *RotateCredentialResponse) SetEncryptedData(v []*EncryptedData) { + x.EncryptedData = v +} + +func (x *RotateCredentialResponse) SetResourceId(v *ResourceId) { + x.ResourceId = v +} + +func (x *RotateCredentialResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *RotateCredentialResponse) HasResourceId() bool { + if x == nil { + return false + } + return x.ResourceId != nil +} + +func (x *RotateCredentialResponse) ClearResourceId() { + x.ResourceId = nil +} + +type RotateCredentialResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + EncryptedData []*EncryptedData + ResourceId *ResourceId + Annotations []*anypb.Any +} + +func (b0 RotateCredentialResponse_builder) Build() *RotateCredentialResponse { + m0 := &RotateCredentialResponse{} + b, x := &b0, m0 + _, _ = b, x + x.EncryptedData = b.EncryptedData + x.ResourceId = b.ResourceId + x.Annotations = b.Annotations + return m0 +} + +type IssueCredentialRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The existing identity (e.g. service account) to mint the credential for. + IdentityId *ResourceId `protobuf:"bytes,1,opt,name=identity_id,json=identityId,proto3" json:"identity_id,omitempty"` + // What kind of credential to mint (api_key / keypair / token / ...). + // Issuance has its own option type so it cannot accidentally expand account + // creation or password rotation. + CredentialOptions *CredentialIssueOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` + // Public keys the connector encrypts the returned material against. + EncryptionConfigs []*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` + // Stable correlation identifier. This does not by itself guarantee provider + // idempotency; callers must not blindly retry an ambiguous issuance. + RequestId string `protobuf:"bytes,4,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // Optional absolute expiry requested by the caller. Absolute time avoids + // extending a credential merely because an approved task waited in queue. + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IssueCredentialRequest) Reset() { + *x = IssueCredentialRequest{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IssueCredentialRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IssueCredentialRequest) ProtoMessage() {} + +func (x *IssueCredentialRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *IssueCredentialRequest) GetIdentityId() *ResourceId { + if x != nil { + return x.IdentityId + } + return nil +} + +func (x *IssueCredentialRequest) GetCredentialOptions() *CredentialIssueOptions { + if x != nil { + return x.CredentialOptions + } + return nil +} + +func (x *IssueCredentialRequest) GetEncryptionConfigs() []*EncryptionConfig { + if x != nil { + return x.EncryptionConfigs + } + return nil +} + +func (x *IssueCredentialRequest) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +func (x *IssueCredentialRequest) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (x *IssueCredentialRequest) SetIdentityId(v *ResourceId) { + x.IdentityId = v +} + +func (x *IssueCredentialRequest) SetCredentialOptions(v *CredentialIssueOptions) { + x.CredentialOptions = v +} + +func (x *IssueCredentialRequest) SetEncryptionConfigs(v []*EncryptionConfig) { + x.EncryptionConfigs = v +} + +func (x *IssueCredentialRequest) SetRequestId(v string) { + x.RequestId = v +} + +func (x *IssueCredentialRequest) SetExpiresAt(v *timestamppb.Timestamp) { + x.ExpiresAt = v +} + +func (x *IssueCredentialRequest) HasIdentityId() bool { + if x == nil { + return false + } + return x.IdentityId != nil +} + +func (x *IssueCredentialRequest) HasCredentialOptions() bool { + if x == nil { + return false + } + return x.CredentialOptions != nil +} + +func (x *IssueCredentialRequest) HasExpiresAt() bool { + if x == nil { + return false + } + return x.ExpiresAt != nil +} + +func (x *IssueCredentialRequest) ClearIdentityId() { + x.IdentityId = nil +} + +func (x *IssueCredentialRequest) ClearCredentialOptions() { + x.CredentialOptions = nil +} + +func (x *IssueCredentialRequest) ClearExpiresAt() { + x.ExpiresAt = nil +} + +type IssueCredentialRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The existing identity (e.g. service account) to mint the credential for. + IdentityId *ResourceId + // What kind of credential to mint (api_key / keypair / token / ...). + // Issuance has its own option type so it cannot accidentally expand account + // creation or password rotation. + CredentialOptions *CredentialIssueOptions + // Public keys the connector encrypts the returned material against. + EncryptionConfigs []*EncryptionConfig + // Stable correlation identifier. This does not by itself guarantee provider + // idempotency; callers must not blindly retry an ambiguous issuance. + RequestId string + // Optional absolute expiry requested by the caller. Absolute time avoids + // extending a credential merely because an approved task waited in queue. + ExpiresAt *timestamppb.Timestamp +} + +func (b0 IssueCredentialRequest_builder) Build() *IssueCredentialRequest { + m0 := &IssueCredentialRequest{} + b, x := &b0, m0 + _, _ = b, x + x.IdentityId = b.IdentityId + x.CredentialOptions = b.CredentialOptions + x.EncryptionConfigs = b.EncryptionConfigs + x.RequestId = b.RequestId + x.ExpiresAt = b.ExpiresAt + return m0 +} + +type IssueCredentialResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The newly minted secret modeled as a resource. Carries SecretTrait, whose + // identity_id back-references the IssueCredentialRequest.identity_id, so the + // platform can link the secret to the identity that owns it. + Secret *Resource `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` + // The minted credential material, encrypted per the request's + // EncryptionConfigs via the same fan-out as CreateAccount/RotateCredential. + EncryptedData []*EncryptedData `protobuf:"bytes,2,rep,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` + ResourceMode CredentialResourceMode `protobuf:"varint,4,opt,name=resource_mode,json=resourceMode,proto3,enum=c1.connector.v2.CredentialResourceMode" json:"resource_mode,omitempty"` + RequestId string `protobuf:"bytes,5,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IssueCredentialResponse) Reset() { + *x = IssueCredentialResponse{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IssueCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IssueCredentialResponse) ProtoMessage() {} + +func (x *IssueCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *IssueCredentialResponse) GetSecret() *Resource { + if x != nil { + return x.Secret + } + return nil +} + +func (x *IssueCredentialResponse) GetEncryptedData() []*EncryptedData { + if x != nil { + return x.EncryptedData + } + return nil +} + +func (x *IssueCredentialResponse) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *IssueCredentialResponse) GetResourceMode() CredentialResourceMode { + if x != nil { + return x.ResourceMode + } + return CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED +} + +func (x *IssueCredentialResponse) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +func (x *IssueCredentialResponse) SetSecret(v *Resource) { + x.Secret = v +} + +func (x *IssueCredentialResponse) SetEncryptedData(v []*EncryptedData) { + x.EncryptedData = v +} + +func (x *IssueCredentialResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *IssueCredentialResponse) SetResourceMode(v CredentialResourceMode) { + x.ResourceMode = v +} + +func (x *IssueCredentialResponse) SetRequestId(v string) { + x.RequestId = v +} + +func (x *IssueCredentialResponse) HasSecret() bool { + if x == nil { + return false + } + return x.Secret != nil +} + +func (x *IssueCredentialResponse) ClearSecret() { + x.Secret = nil +} + +type IssueCredentialResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The newly minted secret modeled as a resource. Carries SecretTrait, whose + // identity_id back-references the IssueCredentialRequest.identity_id, so the + // platform can link the secret to the identity that owns it. + Secret *Resource + // The minted credential material, encrypted per the request's + // EncryptionConfigs via the same fan-out as CreateAccount/RotateCredential. + EncryptedData []*EncryptedData + Annotations []*anypb.Any + ResourceMode CredentialResourceMode + RequestId string +} + +func (b0 IssueCredentialResponse_builder) Build() *IssueCredentialResponse { + m0 := &IssueCredentialResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Secret = b.Secret + x.EncryptedData = b.EncryptedData + x.Annotations = b.Annotations + x.ResourceMode = b.ResourceMode + x.RequestId = b.RequestId + return m0 +} + +type AccountInfo struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Emails []*AccountInfo_Email `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` + // The user's login + Login string `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"` + // Any additional login aliases for the user + LoginAliases []string `protobuf:"bytes,3,rep,name=login_aliases,json=loginAliases,proto3" json:"login_aliases,omitempty"` + Profile *structpb.Struct `protobuf:"bytes,4,opt,name=profile,proto3" json:"profile,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountInfo) Reset() { + *x = AccountInfo{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountInfo) ProtoMessage() {} + +func (x *AccountInfo) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AccountInfo) GetEmails() []*AccountInfo_Email { + if x != nil { + return x.Emails + } + return nil +} + +func (x *AccountInfo) GetLogin() string { + if x != nil { + return x.Login + } + return "" +} + +func (x *AccountInfo) GetLoginAliases() []string { + if x != nil { + return x.LoginAliases + } + return nil +} + +func (x *AccountInfo) GetProfile() *structpb.Struct { + if x != nil { + return x.Profile + } + return nil +} + +func (x *AccountInfo) SetEmails(v []*AccountInfo_Email) { + x.Emails = v +} + +func (x *AccountInfo) SetLogin(v string) { + x.Login = v +} + +func (x *AccountInfo) SetLoginAliases(v []string) { + x.LoginAliases = v +} + +func (x *AccountInfo) SetProfile(v *structpb.Struct) { + x.Profile = v +} + +func (x *AccountInfo) HasProfile() bool { + if x == nil { + return false + } + return x.Profile != nil +} + +func (x *AccountInfo) ClearProfile() { + x.Profile = nil +} + +type AccountInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Emails []*AccountInfo_Email + // The user's login + Login string + // Any additional login aliases for the user + LoginAliases []string + Profile *structpb.Struct +} + +func (b0 AccountInfo_builder) Build() *AccountInfo { + m0 := &AccountInfo{} + b, x := &b0, m0 + _, _ = b, x + x.Emails = b.Emails + x.Login = b.Login + x.LoginAliases = b.LoginAliases + x.Profile = b.Profile + return m0 +} + +type KeyGenerationProfile struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` + // Types that are valid to be assigned to Parameters: + // + // *KeyGenerationProfile_RsaModulusBits + // *KeyGenerationProfile_Crv + Parameters isKeyGenerationProfile_Parameters `protobuf_oneof:"parameters"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *KeyGenerationProfile) Reset() { + *x = KeyGenerationProfile{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *KeyGenerationProfile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyGenerationProfile) ProtoMessage() {} + +func (x *KeyGenerationProfile) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *KeyGenerationProfile) GetKty() string { + if x != nil { + return x.Kty + } + return "" +} + +func (x *KeyGenerationProfile) GetParameters() isKeyGenerationProfile_Parameters { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *KeyGenerationProfile) GetRsaModulusBits() uint32 { + if x != nil { + if x, ok := x.Parameters.(*KeyGenerationProfile_RsaModulusBits); ok { + return x.RsaModulusBits + } + } + return 0 +} + +func (x *KeyGenerationProfile) GetCrv() string { + if x != nil { + if x, ok := x.Parameters.(*KeyGenerationProfile_Crv); ok { + return x.Crv + } + } + return "" +} + +func (x *KeyGenerationProfile) SetKty(v string) { + x.Kty = v +} + +func (x *KeyGenerationProfile) SetRsaModulusBits(v uint32) { + x.Parameters = &KeyGenerationProfile_RsaModulusBits{v} +} + +func (x *KeyGenerationProfile) SetCrv(v string) { + x.Parameters = &KeyGenerationProfile_Crv{v} +} + +func (x *KeyGenerationProfile) HasParameters() bool { + if x == nil { + return false + } + return x.Parameters != nil +} + +func (x *KeyGenerationProfile) HasRsaModulusBits() bool { + if x == nil { + return false + } + _, ok := x.Parameters.(*KeyGenerationProfile_RsaModulusBits) + return ok +} + +func (x *KeyGenerationProfile) HasCrv() bool { + if x == nil { + return false + } + _, ok := x.Parameters.(*KeyGenerationProfile_Crv) + return ok +} + +func (x *KeyGenerationProfile) ClearParameters() { + x.Parameters = nil +} + +func (x *KeyGenerationProfile) ClearRsaModulusBits() { + if _, ok := x.Parameters.(*KeyGenerationProfile_RsaModulusBits); ok { + x.Parameters = nil + } +} + +func (x *KeyGenerationProfile) ClearCrv() { + if _, ok := x.Parameters.(*KeyGenerationProfile_Crv); ok { + x.Parameters = nil + } +} + +const KeyGenerationProfile_Parameters_not_set_case case_KeyGenerationProfile_Parameters = 0 +const KeyGenerationProfile_RsaModulusBits_case case_KeyGenerationProfile_Parameters = 2 +const KeyGenerationProfile_Crv_case case_KeyGenerationProfile_Parameters = 3 + +func (x *KeyGenerationProfile) WhichParameters() case_KeyGenerationProfile_Parameters { + if x == nil { + return KeyGenerationProfile_Parameters_not_set_case + } + switch x.Parameters.(type) { + case *KeyGenerationProfile_RsaModulusBits: + return KeyGenerationProfile_RsaModulusBits_case + case *KeyGenerationProfile_Crv: + return KeyGenerationProfile_Crv_case + default: + return KeyGenerationProfile_Parameters_not_set_case + } +} + +type KeyGenerationProfile_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Kty string + // Fields of oneof Parameters: + RsaModulusBits *uint32 + Crv *string + // -- end of Parameters +} + +func (b0 KeyGenerationProfile_builder) Build() *KeyGenerationProfile { + m0 := &KeyGenerationProfile{} + b, x := &b0, m0 + _, _ = b, x + x.Kty = b.Kty + if b.RsaModulusBits != nil { + x.Parameters = &KeyGenerationProfile_RsaModulusBits{*b.RsaModulusBits} + } + if b.Crv != nil { + x.Parameters = &KeyGenerationProfile_Crv{*b.Crv} + } + return m0 +} + +type case_KeyGenerationProfile_Parameters protoreflect.FieldNumber + +func (x case_KeyGenerationProfile_Parameters) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[14].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isKeyGenerationProfile_Parameters interface { + isKeyGenerationProfile_Parameters() } -func (b0 RotateCredentialRequest_builder) Build() *RotateCredentialRequest { - m0 := &RotateCredentialRequest{} - b, x := &b0, m0 - _, _ = b, x - x.ResourceId = b.ResourceId - x.CredentialOptions = b.CredentialOptions - x.EncryptionConfigs = b.EncryptionConfigs - return m0 +type KeyGenerationProfile_RsaModulusBits struct { + RsaModulusBits uint32 `protobuf:"varint,2,opt,name=rsa_modulus_bits,json=rsaModulusBits,proto3,oneof"` } -type RotateCredentialResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - EncryptedData []*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` - ResourceId *ResourceId `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` +type KeyGenerationProfile_Crv struct { + Crv string `protobuf:"bytes,3,opt,name=crv,proto3,oneof"` +} + +func (*KeyGenerationProfile_RsaModulusBits) isKeyGenerationProfile_Parameters() {} + +func (*KeyGenerationProfile_Crv) isKeyGenerationProfile_Parameters() {} + +// CredentialIssueOptions are intentionally separate from CredentialOptions: +// adding issuance-only arms must not expand account creation or rotation. +type CredentialIssueOptions struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Types that are valid to be assigned to Options: + // + // *CredentialIssueOptions_ApiKey_ + // *CredentialIssueOptions_Keypair_ + // *CredentialIssueOptions_Token_ + // *CredentialIssueOptions_ClientSecret_ + Options isCredentialIssueOptions_Options `protobuf_oneof:"options"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *RotateCredentialResponse) Reset() { - *x = RotateCredentialResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[10] +func (x *CredentialIssueOptions) Reset() { + *x = CredentialIssueOptions{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RotateCredentialResponse) String() string { +func (x *CredentialIssueOptions) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RotateCredentialResponse) ProtoMessage() {} +func (*CredentialIssueOptions) ProtoMessage() {} -func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[10] +func (x *CredentialIssueOptions) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1118,182 +1867,240 @@ func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -func (x *RotateCredentialResponse) GetEncryptedData() []*EncryptedData { +func (x *CredentialIssueOptions) GetOptions() isCredentialIssueOptions_Options { if x != nil { - return x.EncryptedData + return x.Options } return nil } -func (x *RotateCredentialResponse) GetResourceId() *ResourceId { +func (x *CredentialIssueOptions) GetApiKey() *CredentialIssueOptions_ApiKey { if x != nil { - return x.ResourceId + if x, ok := x.Options.(*CredentialIssueOptions_ApiKey_); ok { + return x.ApiKey + } } return nil } -func (x *RotateCredentialResponse) GetAnnotations() []*anypb.Any { +func (x *CredentialIssueOptions) GetKeypair() *CredentialIssueOptions_Keypair { if x != nil { - return x.Annotations + if x, ok := x.Options.(*CredentialIssueOptions_Keypair_); ok { + return x.Keypair + } } return nil } -func (x *RotateCredentialResponse) SetEncryptedData(v []*EncryptedData) { - x.EncryptedData = v +func (x *CredentialIssueOptions) GetToken() *CredentialIssueOptions_Token { + if x != nil { + if x, ok := x.Options.(*CredentialIssueOptions_Token_); ok { + return x.Token + } + } + return nil } -func (x *RotateCredentialResponse) SetResourceId(v *ResourceId) { - x.ResourceId = v +func (x *CredentialIssueOptions) GetClientSecret() *CredentialIssueOptions_ClientSecret { + if x != nil { + if x, ok := x.Options.(*CredentialIssueOptions_ClientSecret_); ok { + return x.ClientSecret + } + } + return nil } -func (x *RotateCredentialResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v +func (x *CredentialIssueOptions) SetApiKey(v *CredentialIssueOptions_ApiKey) { + if v == nil { + x.Options = nil + return + } + x.Options = &CredentialIssueOptions_ApiKey_{v} } -func (x *RotateCredentialResponse) HasResourceId() bool { - if x == nil { - return false +func (x *CredentialIssueOptions) SetKeypair(v *CredentialIssueOptions_Keypair) { + if v == nil { + x.Options = nil + return } - return x.ResourceId != nil + x.Options = &CredentialIssueOptions_Keypair_{v} } -func (x *RotateCredentialResponse) ClearResourceId() { - x.ResourceId = nil +func (x *CredentialIssueOptions) SetToken(v *CredentialIssueOptions_Token) { + if v == nil { + x.Options = nil + return + } + x.Options = &CredentialIssueOptions_Token_{v} } -type RotateCredentialResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. +func (x *CredentialIssueOptions) SetClientSecret(v *CredentialIssueOptions_ClientSecret) { + if v == nil { + x.Options = nil + return + } + x.Options = &CredentialIssueOptions_ClientSecret_{v} +} - EncryptedData []*EncryptedData - ResourceId *ResourceId - Annotations []*anypb.Any +func (x *CredentialIssueOptions) HasOptions() bool { + if x == nil { + return false + } + return x.Options != nil } -func (b0 RotateCredentialResponse_builder) Build() *RotateCredentialResponse { - m0 := &RotateCredentialResponse{} - b, x := &b0, m0 - _, _ = b, x - x.EncryptedData = b.EncryptedData - x.ResourceId = b.ResourceId - x.Annotations = b.Annotations - return m0 +func (x *CredentialIssueOptions) HasApiKey() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialIssueOptions_ApiKey_) + return ok } -type AccountInfo struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Emails []*AccountInfo_Email `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` - // The user's login - Login string `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"` - // Any additional login aliases for the user - LoginAliases []string `protobuf:"bytes,3,rep,name=login_aliases,json=loginAliases,proto3" json:"login_aliases,omitempty"` - Profile *structpb.Struct `protobuf:"bytes,4,opt,name=profile,proto3" json:"profile,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache +func (x *CredentialIssueOptions) HasKeypair() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialIssueOptions_Keypair_) + return ok } -func (x *AccountInfo) Reset() { - *x = AccountInfo{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *CredentialIssueOptions) HasToken() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialIssueOptions_Token_) + return ok } -func (x *AccountInfo) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *CredentialIssueOptions) HasClientSecret() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialIssueOptions_ClientSecret_) + return ok } -func (*AccountInfo) ProtoMessage() {} +func (x *CredentialIssueOptions) ClearOptions() { + x.Options = nil +} -func (x *AccountInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *CredentialIssueOptions) ClearApiKey() { + if _, ok := x.Options.(*CredentialIssueOptions_ApiKey_); ok { + x.Options = nil } - return mi.MessageOf(x) } -func (x *AccountInfo) GetEmails() []*AccountInfo_Email { - if x != nil { - return x.Emails +func (x *CredentialIssueOptions) ClearKeypair() { + if _, ok := x.Options.(*CredentialIssueOptions_Keypair_); ok { + x.Options = nil } - return nil } -func (x *AccountInfo) GetLogin() string { - if x != nil { - return x.Login +func (x *CredentialIssueOptions) ClearToken() { + if _, ok := x.Options.(*CredentialIssueOptions_Token_); ok { + x.Options = nil } - return "" } -func (x *AccountInfo) GetLoginAliases() []string { - if x != nil { - return x.LoginAliases +func (x *CredentialIssueOptions) ClearClientSecret() { + if _, ok := x.Options.(*CredentialIssueOptions_ClientSecret_); ok { + x.Options = nil } - return nil } -func (x *AccountInfo) GetProfile() *structpb.Struct { - if x != nil { - return x.Profile +const CredentialIssueOptions_Options_not_set_case case_CredentialIssueOptions_Options = 0 +const CredentialIssueOptions_ApiKey_case case_CredentialIssueOptions_Options = 100 +const CredentialIssueOptions_Keypair_case case_CredentialIssueOptions_Options = 101 +const CredentialIssueOptions_Token_case case_CredentialIssueOptions_Options = 102 +const CredentialIssueOptions_ClientSecret_case case_CredentialIssueOptions_Options = 103 + +func (x *CredentialIssueOptions) WhichOptions() case_CredentialIssueOptions_Options { + if x == nil { + return CredentialIssueOptions_Options_not_set_case + } + switch x.Options.(type) { + case *CredentialIssueOptions_ApiKey_: + return CredentialIssueOptions_ApiKey_case + case *CredentialIssueOptions_Keypair_: + return CredentialIssueOptions_Keypair_case + case *CredentialIssueOptions_Token_: + return CredentialIssueOptions_Token_case + case *CredentialIssueOptions_ClientSecret_: + return CredentialIssueOptions_ClientSecret_case + default: + return CredentialIssueOptions_Options_not_set_case } - return nil } -func (x *AccountInfo) SetEmails(v []*AccountInfo_Email) { - x.Emails = v -} +type CredentialIssueOptions_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. -func (x *AccountInfo) SetLogin(v string) { - x.Login = v + // Fields of oneof Options: + ApiKey *CredentialIssueOptions_ApiKey + Keypair *CredentialIssueOptions_Keypair + Token *CredentialIssueOptions_Token + ClientSecret *CredentialIssueOptions_ClientSecret + // -- end of Options } -func (x *AccountInfo) SetLoginAliases(v []string) { - x.LoginAliases = v +func (b0 CredentialIssueOptions_builder) Build() *CredentialIssueOptions { + m0 := &CredentialIssueOptions{} + b, x := &b0, m0 + _, _ = b, x + if b.ApiKey != nil { + x.Options = &CredentialIssueOptions_ApiKey_{b.ApiKey} + } + if b.Keypair != nil { + x.Options = &CredentialIssueOptions_Keypair_{b.Keypair} + } + if b.Token != nil { + x.Options = &CredentialIssueOptions_Token_{b.Token} + } + if b.ClientSecret != nil { + x.Options = &CredentialIssueOptions_ClientSecret_{b.ClientSecret} + } + return m0 } -func (x *AccountInfo) SetProfile(v *structpb.Struct) { - x.Profile = v -} +type case_CredentialIssueOptions_Options protoreflect.FieldNumber -func (x *AccountInfo) HasProfile() bool { - if x == nil { - return false +func (x case_CredentialIssueOptions_Options) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[15].Descriptor() + if x == 0 { + return "not set" } - return x.Profile != nil + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) } -func (x *AccountInfo) ClearProfile() { - x.Profile = nil +type isCredentialIssueOptions_Options interface { + isCredentialIssueOptions_Options() } -type AccountInfo_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. +type CredentialIssueOptions_ApiKey_ struct { + ApiKey *CredentialIssueOptions_ApiKey `protobuf:"bytes,100,opt,name=api_key,json=apiKey,proto3,oneof"` +} - Emails []*AccountInfo_Email - // The user's login - Login string - // Any additional login aliases for the user - LoginAliases []string - Profile *structpb.Struct +type CredentialIssueOptions_Keypair_ struct { + Keypair *CredentialIssueOptions_Keypair `protobuf:"bytes,101,opt,name=keypair,proto3,oneof"` } -func (b0 AccountInfo_builder) Build() *AccountInfo { - m0 := &AccountInfo{} - b, x := &b0, m0 - _, _ = b, x - x.Emails = b.Emails - x.Login = b.Login - x.LoginAliases = b.LoginAliases - x.Profile = b.Profile - return m0 +type CredentialIssueOptions_Token_ struct { + Token *CredentialIssueOptions_Token `protobuf:"bytes,102,opt,name=token,proto3,oneof"` +} + +type CredentialIssueOptions_ClientSecret_ struct { + ClientSecret *CredentialIssueOptions_ClientSecret `protobuf:"bytes,103,opt,name=client_secret,json=clientSecret,proto3,oneof"` } +func (*CredentialIssueOptions_ApiKey_) isCredentialIssueOptions_Options() {} + +func (*CredentialIssueOptions_Keypair_) isCredentialIssueOptions_Options() {} + +func (*CredentialIssueOptions_Token_) isCredentialIssueOptions_Options() {} + +func (*CredentialIssueOptions_ClientSecret_) isCredentialIssueOptions_Options() {} + type CredentialOptions struct { state protoimpl.MessageState `protogen:"hybrid.v1"` // Types that are valid to be assigned to Options: @@ -1310,7 +2117,7 @@ type CredentialOptions struct { func (x *CredentialOptions) Reset() { *x = CredentialOptions{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + mi := &file_c1_connector_v2_resource_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1322,7 +2129,7 @@ func (x *CredentialOptions) String() string { func (*CredentialOptions) ProtoMessage() {} func (x *CredentialOptions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + mi := &file_c1_connector_v2_resource_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1545,7 +2352,7 @@ func (b0 CredentialOptions_builder) Build() *CredentialOptions { type case_CredentialOptions_Options protoreflect.FieldNumber func (x case_CredentialOptions_Options) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[12].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[16].Descriptor() if x == 0 { return "not set" } @@ -1597,7 +2404,7 @@ type LocalCredentialOptions struct { func (x *LocalCredentialOptions) Reset() { *x = LocalCredentialOptions{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + mi := &file_c1_connector_v2_resource_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1609,7 +2416,7 @@ func (x *LocalCredentialOptions) String() string { func (*LocalCredentialOptions) ProtoMessage() {} func (x *LocalCredentialOptions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + mi := &file_c1_connector_v2_resource_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1832,7 +2639,7 @@ func (b0 LocalCredentialOptions_builder) Build() *LocalCredentialOptions { type case_LocalCredentialOptions_Options protoreflect.FieldNumber func (x case_LocalCredentialOptions_Options) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[13].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[17].Descriptor() if x == 0 { return "not set" } @@ -1877,7 +2684,7 @@ type PasswordConstraint struct { func (x *PasswordConstraint) Reset() { *x = PasswordConstraint{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + mi := &file_c1_connector_v2_resource_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1889,7 +2696,7 @@ func (x *PasswordConstraint) String() string { func (*PasswordConstraint) ProtoMessage() {} func (x *PasswordConstraint) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + mi := &file_c1_connector_v2_resource_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1950,7 +2757,7 @@ type CreateAccountRequest struct { func (x *CreateAccountRequest) Reset() { *x = CreateAccountRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[15] + mi := &file_c1_connector_v2_resource_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1962,7 +2769,7 @@ func (x *CreateAccountRequest) String() string { func (*CreateAccountRequest) ProtoMessage() {} func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[15] + mi := &file_c1_connector_v2_resource_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2076,7 +2883,7 @@ type CreateAccountResponse struct { func (x *CreateAccountResponse) Reset() { *x = CreateAccountResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[16] + mi := &file_c1_connector_v2_resource_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2088,7 +2895,7 @@ func (x *CreateAccountResponse) String() string { func (*CreateAccountResponse) ProtoMessage() {} func (x *CreateAccountResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[16] + mi := &file_c1_connector_v2_resource_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2324,7 +3131,7 @@ func (b0 CreateAccountResponse_builder) Build() *CreateAccountResponse { type case_CreateAccountResponse_Result protoreflect.FieldNumber func (x case_CreateAccountResponse_Result) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[16].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[20].Descriptor() if x == 0 { return "not set" } @@ -2382,7 +3189,7 @@ type EncryptedData struct { func (x *EncryptedData) Reset() { *x = EncryptedData{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[17] + mi := &file_c1_connector_v2_resource_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2394,7 +3201,7 @@ func (x *EncryptedData) String() string { func (*EncryptedData) ProtoMessage() {} func (x *EncryptedData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[17] + mi := &file_c1_connector_v2_resource_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2533,7 +3340,7 @@ type PlaintextData struct { func (x *PlaintextData) Reset() { *x = PlaintextData{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[18] + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2545,7 +3352,7 @@ func (x *PlaintextData) String() string { func (*PlaintextData) ProtoMessage() {} func (x *PlaintextData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[18] + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2639,7 +3446,7 @@ type EncryptionConfig struct { func (x *EncryptionConfig) Reset() { *x = EncryptionConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[19] + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2651,7 +3458,7 @@ func (x *EncryptionConfig) String() string { func (*EncryptionConfig) ProtoMessage() {} func (x *EncryptionConfig) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[19] + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2835,7 +3642,7 @@ func (b0 EncryptionConfig_builder) Build() *EncryptionConfig { type case_EncryptionConfig_Config protoreflect.FieldNumber func (x case_EncryptionConfig_Config) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[19].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[23].Descriptor() if x == 0 { return "not set" } @@ -2869,7 +3676,7 @@ type ResourceId struct { func (x *ResourceId) Reset() { *x = ResourceId{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[20] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2881,7 +3688,7 @@ func (x *ResourceId) String() string { func (*ResourceId) ProtoMessage() {} func (x *ResourceId) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[20] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2973,7 +3780,7 @@ type Resource struct { func (x *Resource) Reset() { *x = Resource{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[21] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2985,7 +3792,7 @@ func (x *Resource) String() string { func (*Resource) ProtoMessage() {} func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[21] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3268,7 +4075,7 @@ type Status struct { func (x *Status) Reset() { *x = Status{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3280,7 +4087,7 @@ func (x *Status) String() string { func (*Status) ProtoMessage() {} func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3348,7 +4155,7 @@ type ResourcesServiceListResourcesRequest struct { func (x *ResourcesServiceListResourcesRequest) Reset() { *x = ResourcesServiceListResourcesRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3360,7 +4167,7 @@ func (x *ResourcesServiceListResourcesRequest) String() string { func (*ResourcesServiceListResourcesRequest) ProtoMessage() {} func (x *ResourcesServiceListResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3501,7 +4308,7 @@ type ResourcesServiceListResourcesResponse struct { func (x *ResourcesServiceListResourcesResponse) Reset() { *x = ResourcesServiceListResourcesResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3513,7 +4320,7 @@ func (x *ResourcesServiceListResourcesResponse) String() string { func (*ResourcesServiceListResourcesResponse) ProtoMessage() {} func (x *ResourcesServiceListResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3587,7 +4394,7 @@ type ResourceGetterServiceGetResourceRequest struct { func (x *ResourceGetterServiceGetResourceRequest) Reset() { *x = ResourceGetterServiceGetResourceRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3599,7 +4406,7 @@ func (x *ResourceGetterServiceGetResourceRequest) String() string { func (*ResourceGetterServiceGetResourceRequest) ProtoMessage() {} func (x *ResourceGetterServiceGetResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3706,7 +4513,7 @@ type ResourceGetterServiceGetResourceResponse struct { func (x *ResourceGetterServiceGetResourceResponse) Reset() { *x = ResourceGetterServiceGetResourceResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3718,7 +4525,7 @@ func (x *ResourceGetterServiceGetResourceResponse) String() string { func (*ResourceGetterServiceGetResourceResponse) ProtoMessage() {} func (x *ResourceGetterServiceGetResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3789,7 +4596,7 @@ type ExternalId struct { func (x *ExternalId) Reset() { *x = ExternalId{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3801,7 +4608,7 @@ func (x *ExternalId) String() string { func (*ExternalId) ProtoMessage() {} func (x *ExternalId) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3874,7 +4681,7 @@ type AccountInfo_Email struct { func (x *AccountInfo_Email) Reset() { *x = AccountInfo_Email{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3886,7 +4693,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[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3936,6 +4743,245 @@ func (b0 AccountInfo_Email_builder) Build() *AccountInfo_Email { return m0 } +type CredentialIssueOptions_ApiKey struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Scopes []string `protobuf:"bytes,1,rep,name=scopes,proto3" json:"scopes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_ApiKey) Reset() { + *x = CredentialIssueOptions_ApiKey{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_ApiKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_ApiKey) ProtoMessage() {} + +func (x *CredentialIssueOptions_ApiKey) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptions_ApiKey) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *CredentialIssueOptions_ApiKey) SetScopes(v []string) { + x.Scopes = v +} + +type CredentialIssueOptions_ApiKey_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Scopes []string +} + +func (b0 CredentialIssueOptions_ApiKey_builder) Build() *CredentialIssueOptions_ApiKey { + m0 := &CredentialIssueOptions_ApiKey{} + b, x := &b0, m0 + _, _ = b, x + x.Scopes = b.Scopes + return m0 +} + +type CredentialIssueOptions_Keypair struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Profile *KeyGenerationProfile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_Keypair) Reset() { + *x = CredentialIssueOptions_Keypair{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_Keypair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_Keypair) ProtoMessage() {} + +func (x *CredentialIssueOptions_Keypair) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptions_Keypair) GetProfile() *KeyGenerationProfile { + if x != nil { + return x.Profile + } + return nil +} + +func (x *CredentialIssueOptions_Keypair) SetProfile(v *KeyGenerationProfile) { + x.Profile = v +} + +func (x *CredentialIssueOptions_Keypair) HasProfile() bool { + if x == nil { + return false + } + return x.Profile != nil +} + +func (x *CredentialIssueOptions_Keypair) ClearProfile() { + x.Profile = nil +} + +type CredentialIssueOptions_Keypair_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Profile *KeyGenerationProfile +} + +func (b0 CredentialIssueOptions_Keypair_builder) Build() *CredentialIssueOptions_Keypair { + m0 := &CredentialIssueOptions_Keypair{} + b, x := &b0, m0 + _, _ = b, x + x.Profile = b.Profile + return m0 +} + +type CredentialIssueOptions_Token struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Scopes []string `protobuf:"bytes,1,rep,name=scopes,proto3" json:"scopes,omitempty"` + Audiences []string `protobuf:"bytes,2,rep,name=audiences,proto3" json:"audiences,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_Token) Reset() { + *x = CredentialIssueOptions_Token{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_Token) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_Token) ProtoMessage() {} + +func (x *CredentialIssueOptions_Token) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptions_Token) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *CredentialIssueOptions_Token) GetAudiences() []string { + if x != nil { + return x.Audiences + } + return nil +} + +func (x *CredentialIssueOptions_Token) SetScopes(v []string) { + x.Scopes = v +} + +func (x *CredentialIssueOptions_Token) SetAudiences(v []string) { + x.Audiences = v +} + +type CredentialIssueOptions_Token_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Scopes []string + Audiences []string +} + +func (b0 CredentialIssueOptions_Token_builder) Build() *CredentialIssueOptions_Token { + m0 := &CredentialIssueOptions_Token{} + b, x := &b0, m0 + _, _ = b, x + x.Scopes = b.Scopes + x.Audiences = b.Audiences + return m0 +} + +type CredentialIssueOptions_ClientSecret struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_ClientSecret) Reset() { + *x = CredentialIssueOptions_ClientSecret{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_ClientSecret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_ClientSecret) ProtoMessage() {} + +func (x *CredentialIssueOptions_ClientSecret) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type CredentialIssueOptions_ClientSecret_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 CredentialIssueOptions_ClientSecret_builder) Build() *CredentialIssueOptions_ClientSecret { + m0 := &CredentialIssueOptions_ClientSecret{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + type CredentialOptions_RandomPassword struct { state protoimpl.MessageState `protogen:"hybrid.v1"` Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` @@ -3946,7 +4992,7 @@ type CredentialOptions_RandomPassword struct { func (x *CredentialOptions_RandomPassword) Reset() { *x = CredentialOptions_RandomPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3958,7 +5004,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[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4015,7 +5061,7 @@ type CredentialOptions_NoPassword struct { func (x *CredentialOptions_NoPassword) Reset() { *x = CredentialOptions_NoPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[30] + mi := &file_c1_connector_v2_resource_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4027,7 +5073,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[30] + mi := &file_c1_connector_v2_resource_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4059,7 +5105,7 @@ type CredentialOptions_SSO struct { func (x *CredentialOptions_SSO) Reset() { *x = CredentialOptions_SSO{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[31] + mi := &file_c1_connector_v2_resource_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4071,7 +5117,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[31] + mi := &file_c1_connector_v2_resource_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4116,7 +5162,7 @@ type CredentialOptions_EncryptedPassword struct { func (x *CredentialOptions_EncryptedPassword) Reset() { *x = CredentialOptions_EncryptedPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + mi := &file_c1_connector_v2_resource_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4128,7 +5174,7 @@ func (x *CredentialOptions_EncryptedPassword) String() string { func (*CredentialOptions_EncryptedPassword) ProtoMessage() {} func (x *CredentialOptions_EncryptedPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + mi := &file_c1_connector_v2_resource_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4174,7 +5220,7 @@ type LocalCredentialOptions_RandomPassword struct { func (x *LocalCredentialOptions_RandomPassword) Reset() { *x = LocalCredentialOptions_RandomPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + mi := &file_c1_connector_v2_resource_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4186,7 +5232,7 @@ func (x *LocalCredentialOptions_RandomPassword) String() string { func (*LocalCredentialOptions_RandomPassword) ProtoMessage() {} func (x *LocalCredentialOptions_RandomPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + mi := &file_c1_connector_v2_resource_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4243,7 +5289,7 @@ type LocalCredentialOptions_NoPassword struct { func (x *LocalCredentialOptions_NoPassword) Reset() { *x = LocalCredentialOptions_NoPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + mi := &file_c1_connector_v2_resource_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4255,7 +5301,7 @@ func (x *LocalCredentialOptions_NoPassword) String() string { func (*LocalCredentialOptions_NoPassword) ProtoMessage() {} func (x *LocalCredentialOptions_NoPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + mi := &file_c1_connector_v2_resource_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4287,7 +5333,7 @@ type LocalCredentialOptions_SSO struct { func (x *LocalCredentialOptions_SSO) Reset() { *x = LocalCredentialOptions_SSO{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + mi := &file_c1_connector_v2_resource_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4299,7 +5345,7 @@ func (x *LocalCredentialOptions_SSO) String() string { func (*LocalCredentialOptions_SSO) ProtoMessage() {} func (x *LocalCredentialOptions_SSO) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + mi := &file_c1_connector_v2_resource_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4344,7 +5390,7 @@ type LocalCredentialOptions_PlaintextPassword struct { func (x *LocalCredentialOptions_PlaintextPassword) Reset() { *x = LocalCredentialOptions_PlaintextPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + mi := &file_c1_connector_v2_resource_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4356,7 +5402,7 @@ func (x *LocalCredentialOptions_PlaintextPassword) String() string { func (*LocalCredentialOptions_PlaintextPassword) ProtoMessage() {} func (x *LocalCredentialOptions_PlaintextPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + mi := &file_c1_connector_v2_resource_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4412,7 +5458,7 @@ type CreateAccountResponse_SuccessResult struct { func (x *CreateAccountResponse_SuccessResult) Reset() { *x = CreateAccountResponse_SuccessResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[37] + mi := &file_c1_connector_v2_resource_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4424,7 +5470,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[37] + mi := &file_c1_connector_v2_resource_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4528,7 +5574,7 @@ type CreateAccountResponse_ActionRequiredResult struct { func (x *CreateAccountResponse_ActionRequiredResult) Reset() { *x = CreateAccountResponse_ActionRequiredResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[38] + mi := &file_c1_connector_v2_resource_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4540,7 +5586,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[38] + mi := &file_c1_connector_v2_resource_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4623,7 +5669,7 @@ type CreateAccountResponse_AlreadyExistsResult struct { func (x *CreateAccountResponse_AlreadyExistsResult) Reset() { *x = CreateAccountResponse_AlreadyExistsResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[39] + mi := &file_c1_connector_v2_resource_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4635,7 +5681,7 @@ func (x *CreateAccountResponse_AlreadyExistsResult) String() string { func (*CreateAccountResponse_AlreadyExistsResult) ProtoMessage() {} func (x *CreateAccountResponse_AlreadyExistsResult) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[39] + mi := &file_c1_connector_v2_resource_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4705,7 +5751,7 @@ type CreateAccountResponse_InProgressResult struct { func (x *CreateAccountResponse_InProgressResult) Reset() { *x = CreateAccountResponse_InProgressResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[40] + mi := &file_c1_connector_v2_resource_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4717,7 +5763,7 @@ func (x *CreateAccountResponse_InProgressResult) String() string { func (*CreateAccountResponse_InProgressResult) ProtoMessage() {} func (x *CreateAccountResponse_InProgressResult) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[40] + mi := &file_c1_connector_v2_resource_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4786,7 +5832,7 @@ type EncryptionConfig_JWKPublicKeyConfig struct { func (x *EncryptionConfig_JWKPublicKeyConfig) Reset() { *x = EncryptionConfig_JWKPublicKeyConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[41] + mi := &file_c1_connector_v2_resource_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4798,7 +5844,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[41] + mi := &file_c1_connector_v2_resource_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4854,7 +5900,7 @@ type EncryptionConfig_AgeRecipientConfig struct { func (x *EncryptionConfig_AgeRecipientConfig) Reset() { *x = EncryptionConfig_AgeRecipientConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[42] + mi := &file_c1_connector_v2_resource_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4866,7 +5912,7 @@ func (x *EncryptionConfig_AgeRecipientConfig) String() string { func (*EncryptionConfig_AgeRecipientConfig) ProtoMessage() {} func (x *EncryptionConfig_AgeRecipientConfig) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[42] + mi := &file_c1_connector_v2_resource_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4973,7 +6019,23 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\x0eencrypted_data\x18\x01 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x12<\n" + "\vresource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + "resourceId\x126\n" + - "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\x82\x02\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xf8\x02\n" + + "\x16IssueCredentialRequest\x12<\n" + + "\videntity_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "identityId\x12V\n" + + "\x12credential_options\x18\x02 \x01(\v2'.c1.connector.v2.CredentialIssueOptionsR\x11credentialOptions\x12P\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x12;\n" + + "\n" + + "request_id\x18\x04 \x01(\tB\x1c\xfaB\x19r\x17 \x01(\x80\x012\x10^[A-Za-z0-9_-]+$R\trequestId\x129\n" + + "\n" + + "expires_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\"\xb8\x02\n" + + "\x17IssueCredentialResponse\x121\n" + + "\x06secret\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06secret\x12E\n" + + "\x0eencrypted_data\x18\x02 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x126\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12L\n" + + "\rresource_mode\x18\x04 \x01(\x0e2'.c1.connector.v2.CredentialResourceModeR\fresourceMode\x12\x1d\n" + + "\n" + + "request_id\x18\x05 \x01(\tR\trequestId\"\x82\x02\n" + "\vAccountInfo\x12:\n" + "\x06emails\x18\x01 \x03(\v2\".c1.connector.v2.AccountInfo.EmailR\x06emails\x12\x14\n" + "\x05login\x18\x02 \x01(\tR\x05login\x12#\n" + @@ -4982,7 +6044,27 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\x05Email\x12!\n" + "\aaddress\x18\x01 \x01(\tB\a\xfaB\x04r\x02`\x01R\aaddress\x12\x1d\n" + "\n" + - "is_primary\x18\x02 \x01(\bR\tisPrimary\"\xd1\x05\n" + + "is_primary\x18\x02 \x01(\bR\tisPrimary\"\x8a\x01\n" + + "\x14KeyGenerationProfile\x12\x1b\n" + + "\x03kty\x18\x01 \x01(\tB\t\xfaB\x06r\x04 \x01( R\x03kty\x12*\n" + + "\x10rsa_modulus_bits\x18\x02 \x01(\rH\x00R\x0ersaModulusBits\x12\x1b\n" + + "\x03crv\x18\x03 \x01(\tB\a\xfaB\x04r\x02(@H\x00R\x03crvB\f\n" + + "\n" + + "parameters\"\x9c\x04\n" + + "\x16CredentialIssueOptions\x12I\n" + + "\aapi_key\x18d \x01(\v2..c1.connector.v2.CredentialIssueOptions.ApiKeyH\x00R\x06apiKey\x12K\n" + + "\akeypair\x18e \x01(\v2/.c1.connector.v2.CredentialIssueOptions.KeypairH\x00R\akeypair\x12E\n" + + "\x05token\x18f \x01(\v2-.c1.connector.v2.CredentialIssueOptions.TokenH\x00R\x05token\x12[\n" + + "\rclient_secret\x18g \x01(\v24.c1.connector.v2.CredentialIssueOptions.ClientSecretH\x00R\fclientSecret\x1a \n" + + "\x06ApiKey\x12\x16\n" + + "\x06scopes\x18\x01 \x03(\tR\x06scopes\x1aJ\n" + + "\aKeypair\x12?\n" + + "\aprofile\x18\x01 \x01(\v2%.c1.connector.v2.KeyGenerationProfileR\aprofile\x1a=\n" + + "\x05Token\x12\x16\n" + + "\x06scopes\x18\x01 \x03(\tR\x06scopes\x12\x1c\n" + + "\taudiences\x18\x02 \x03(\tR\taudiences\x1a\x0e\n" + + "\fClientSecretB\t\n" + + "\aoptions\"\xd1\x05\n" + "\x11CredentialOptions\x12\\\n" + "\x0frandom_password\x18d \x01(\v21.c1.connector.v2.CredentialOptions.RandomPasswordH\x00R\x0erandomPassword\x12P\n" + "\vno_password\x18e \x01(\v2-.c1.connector.v2.CredentialOptions.NoPasswordH\x00R\n" + @@ -5142,7 +6224,11 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "ExternalId\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04link\x18\x02 \x01(\tR\x04link\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription2\xab\x01\n" + + "\vdescription\x18\x03 \x01(\tR\vdescription*\x93\x01\n" + + "\x16CredentialResourceMode\x12(\n" + + "$CREDENTIAL_RESOURCE_MODE_UNSPECIFIED\x10\x00\x12)\n" + + "%CREDENTIAL_RESOURCE_MODE_DISCOVERABLE\x10\x01\x12$\n" + + " CREDENTIAL_RESOURCE_MODE_VIRTUAL\x10\x022\xab\x01\n" + "\x14ResourceTypesService\x12\x92\x01\n" + "\x11ListResourceTypes\x12=.c1.connector.v2.ResourceTypesServiceListResourceTypesRequest\x1a>.c1.connector.v2.ResourceTypesServiceListResourceTypesResponse2\x92\x01\n" + "\x10ResourcesService\x12~\n" + @@ -5153,159 +6239,184 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\x0eCreateResource\x12&.c1.connector.v2.CreateResourceRequest\x1a'.c1.connector.v2.CreateResourceResponse\x12a\n" + "\x0eDeleteResource\x12&.c1.connector.v2.DeleteResourceRequest\x1a'.c1.connector.v2.DeleteResourceResponse2\x81\x01\n" + "\x16ResourceDeleterService\x12g\n" + - "\x10DeleteResourceV2\x12(.c1.connector.v2.DeleteResourceV2Request\x1a).c1.connector.v2.DeleteResourceV2Response2\x83\x01\n" + + "\x10DeleteResourceV2\x12(.c1.connector.v2.DeleteResourceV2Request\x1a).c1.connector.v2.DeleteResourceV2Response2\xe9\x01\n" + "\x18CredentialManagerService\x12g\n" + - "\x10RotateCredential\x12(.c1.connector.v2.RotateCredentialRequest\x1a).c1.connector.v2.RotateCredentialResponse2w\n" + + "\x10RotateCredential\x12(.c1.connector.v2.RotateCredentialRequest\x1a).c1.connector.v2.RotateCredentialResponse\x12d\n" + + "\x0fIssueCredential\x12'.c1.connector.v2.IssueCredentialRequest\x1a(.c1.connector.v2.IssueCredentialResponse2w\n" + "\x15AccountManagerService\x12^\n" + "\rCreateAccount\x12%.c1.connector.v2.CreateAccountRequest\x1a&.c1.connector.v2.CreateAccountResponseB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" -var file_c1_connector_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_c1_connector_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 51) 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 - (Status_ResourceStatus)(0), // 2: c1.connector.v2.Status.ResourceStatus - (*ResourceType)(nil), // 3: c1.connector.v2.ResourceType - (*ResourceTypesServiceListResourceTypesRequest)(nil), // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest - (*ResourceTypesServiceListResourceTypesResponse)(nil), // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse - (*CreateResourceRequest)(nil), // 6: c1.connector.v2.CreateResourceRequest - (*CreateResourceResponse)(nil), // 7: c1.connector.v2.CreateResourceResponse - (*DeleteResourceRequest)(nil), // 8: c1.connector.v2.DeleteResourceRequest - (*DeleteResourceResponse)(nil), // 9: c1.connector.v2.DeleteResourceResponse - (*DeleteResourceV2Request)(nil), // 10: c1.connector.v2.DeleteResourceV2Request - (*DeleteResourceV2Response)(nil), // 11: c1.connector.v2.DeleteResourceV2Response - (*RotateCredentialRequest)(nil), // 12: c1.connector.v2.RotateCredentialRequest - (*RotateCredentialResponse)(nil), // 13: c1.connector.v2.RotateCredentialResponse - (*AccountInfo)(nil), // 14: c1.connector.v2.AccountInfo - (*CredentialOptions)(nil), // 15: c1.connector.v2.CredentialOptions - (*LocalCredentialOptions)(nil), // 16: c1.connector.v2.LocalCredentialOptions - (*PasswordConstraint)(nil), // 17: c1.connector.v2.PasswordConstraint - (*CreateAccountRequest)(nil), // 18: c1.connector.v2.CreateAccountRequest - (*CreateAccountResponse)(nil), // 19: c1.connector.v2.CreateAccountResponse - (*EncryptedData)(nil), // 20: c1.connector.v2.EncryptedData - (*PlaintextData)(nil), // 21: c1.connector.v2.PlaintextData - (*EncryptionConfig)(nil), // 22: c1.connector.v2.EncryptionConfig - (*ResourceId)(nil), // 23: c1.connector.v2.ResourceId - (*Resource)(nil), // 24: c1.connector.v2.Resource - (*Status)(nil), // 25: c1.connector.v2.Status - (*ResourcesServiceListResourcesRequest)(nil), // 26: c1.connector.v2.ResourcesServiceListResourcesRequest - (*ResourcesServiceListResourcesResponse)(nil), // 27: c1.connector.v2.ResourcesServiceListResourcesResponse - (*ResourceGetterServiceGetResourceRequest)(nil), // 28: c1.connector.v2.ResourceGetterServiceGetResourceRequest - (*ResourceGetterServiceGetResourceResponse)(nil), // 29: c1.connector.v2.ResourceGetterServiceGetResourceResponse - (*ExternalId)(nil), // 30: c1.connector.v2.ExternalId - (*AccountInfo_Email)(nil), // 31: c1.connector.v2.AccountInfo.Email - (*CredentialOptions_RandomPassword)(nil), // 32: c1.connector.v2.CredentialOptions.RandomPassword - (*CredentialOptions_NoPassword)(nil), // 33: c1.connector.v2.CredentialOptions.NoPassword - (*CredentialOptions_SSO)(nil), // 34: c1.connector.v2.CredentialOptions.SSO - (*CredentialOptions_EncryptedPassword)(nil), // 35: c1.connector.v2.CredentialOptions.EncryptedPassword - (*LocalCredentialOptions_RandomPassword)(nil), // 36: c1.connector.v2.LocalCredentialOptions.RandomPassword - (*LocalCredentialOptions_NoPassword)(nil), // 37: c1.connector.v2.LocalCredentialOptions.NoPassword - (*LocalCredentialOptions_SSO)(nil), // 38: c1.connector.v2.LocalCredentialOptions.SSO - (*LocalCredentialOptions_PlaintextPassword)(nil), // 39: c1.connector.v2.LocalCredentialOptions.PlaintextPassword - (*CreateAccountResponse_SuccessResult)(nil), // 40: c1.connector.v2.CreateAccountResponse.SuccessResult - (*CreateAccountResponse_ActionRequiredResult)(nil), // 41: c1.connector.v2.CreateAccountResponse.ActionRequiredResult - (*CreateAccountResponse_AlreadyExistsResult)(nil), // 42: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult - (*CreateAccountResponse_InProgressResult)(nil), // 43: c1.connector.v2.CreateAccountResponse.InProgressResult - (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 44: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig - (*EncryptionConfig_AgeRecipientConfig)(nil), // 45: c1.connector.v2.EncryptionConfig.AgeRecipientConfig - (*anypb.Any)(nil), // 46: google.protobuf.Any - (*structpb.Struct)(nil), // 47: google.protobuf.Struct - (*AssetRef)(nil), // 48: c1.connector.v2.AssetRef - (*timestamppb.Timestamp)(nil), // 49: google.protobuf.Timestamp + (CredentialResourceMode)(0), // 0: c1.connector.v2.CredentialResourceMode + (ResourceType_Trait)(0), // 1: c1.connector.v2.ResourceType.Trait + (Resource_CreationSource)(0), // 2: c1.connector.v2.Resource.CreationSource + (Status_ResourceStatus)(0), // 3: c1.connector.v2.Status.ResourceStatus + (*ResourceType)(nil), // 4: c1.connector.v2.ResourceType + (*ResourceTypesServiceListResourceTypesRequest)(nil), // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest + (*ResourceTypesServiceListResourceTypesResponse)(nil), // 6: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse + (*CreateResourceRequest)(nil), // 7: c1.connector.v2.CreateResourceRequest + (*CreateResourceResponse)(nil), // 8: c1.connector.v2.CreateResourceResponse + (*DeleteResourceRequest)(nil), // 9: c1.connector.v2.DeleteResourceRequest + (*DeleteResourceResponse)(nil), // 10: c1.connector.v2.DeleteResourceResponse + (*DeleteResourceV2Request)(nil), // 11: c1.connector.v2.DeleteResourceV2Request + (*DeleteResourceV2Response)(nil), // 12: c1.connector.v2.DeleteResourceV2Response + (*RotateCredentialRequest)(nil), // 13: c1.connector.v2.RotateCredentialRequest + (*RotateCredentialResponse)(nil), // 14: c1.connector.v2.RotateCredentialResponse + (*IssueCredentialRequest)(nil), // 15: c1.connector.v2.IssueCredentialRequest + (*IssueCredentialResponse)(nil), // 16: c1.connector.v2.IssueCredentialResponse + (*AccountInfo)(nil), // 17: c1.connector.v2.AccountInfo + (*KeyGenerationProfile)(nil), // 18: c1.connector.v2.KeyGenerationProfile + (*CredentialIssueOptions)(nil), // 19: c1.connector.v2.CredentialIssueOptions + (*CredentialOptions)(nil), // 20: c1.connector.v2.CredentialOptions + (*LocalCredentialOptions)(nil), // 21: c1.connector.v2.LocalCredentialOptions + (*PasswordConstraint)(nil), // 22: c1.connector.v2.PasswordConstraint + (*CreateAccountRequest)(nil), // 23: c1.connector.v2.CreateAccountRequest + (*CreateAccountResponse)(nil), // 24: c1.connector.v2.CreateAccountResponse + (*EncryptedData)(nil), // 25: c1.connector.v2.EncryptedData + (*PlaintextData)(nil), // 26: c1.connector.v2.PlaintextData + (*EncryptionConfig)(nil), // 27: c1.connector.v2.EncryptionConfig + (*ResourceId)(nil), // 28: c1.connector.v2.ResourceId + (*Resource)(nil), // 29: c1.connector.v2.Resource + (*Status)(nil), // 30: c1.connector.v2.Status + (*ResourcesServiceListResourcesRequest)(nil), // 31: c1.connector.v2.ResourcesServiceListResourcesRequest + (*ResourcesServiceListResourcesResponse)(nil), // 32: c1.connector.v2.ResourcesServiceListResourcesResponse + (*ResourceGetterServiceGetResourceRequest)(nil), // 33: c1.connector.v2.ResourceGetterServiceGetResourceRequest + (*ResourceGetterServiceGetResourceResponse)(nil), // 34: c1.connector.v2.ResourceGetterServiceGetResourceResponse + (*ExternalId)(nil), // 35: c1.connector.v2.ExternalId + (*AccountInfo_Email)(nil), // 36: c1.connector.v2.AccountInfo.Email + (*CredentialIssueOptions_ApiKey)(nil), // 37: c1.connector.v2.CredentialIssueOptions.ApiKey + (*CredentialIssueOptions_Keypair)(nil), // 38: c1.connector.v2.CredentialIssueOptions.Keypair + (*CredentialIssueOptions_Token)(nil), // 39: c1.connector.v2.CredentialIssueOptions.Token + (*CredentialIssueOptions_ClientSecret)(nil), // 40: c1.connector.v2.CredentialIssueOptions.ClientSecret + (*CredentialOptions_RandomPassword)(nil), // 41: c1.connector.v2.CredentialOptions.RandomPassword + (*CredentialOptions_NoPassword)(nil), // 42: c1.connector.v2.CredentialOptions.NoPassword + (*CredentialOptions_SSO)(nil), // 43: c1.connector.v2.CredentialOptions.SSO + (*CredentialOptions_EncryptedPassword)(nil), // 44: c1.connector.v2.CredentialOptions.EncryptedPassword + (*LocalCredentialOptions_RandomPassword)(nil), // 45: c1.connector.v2.LocalCredentialOptions.RandomPassword + (*LocalCredentialOptions_NoPassword)(nil), // 46: c1.connector.v2.LocalCredentialOptions.NoPassword + (*LocalCredentialOptions_SSO)(nil), // 47: c1.connector.v2.LocalCredentialOptions.SSO + (*LocalCredentialOptions_PlaintextPassword)(nil), // 48: c1.connector.v2.LocalCredentialOptions.PlaintextPassword + (*CreateAccountResponse_SuccessResult)(nil), // 49: c1.connector.v2.CreateAccountResponse.SuccessResult + (*CreateAccountResponse_ActionRequiredResult)(nil), // 50: c1.connector.v2.CreateAccountResponse.ActionRequiredResult + (*CreateAccountResponse_AlreadyExistsResult)(nil), // 51: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult + (*CreateAccountResponse_InProgressResult)(nil), // 52: c1.connector.v2.CreateAccountResponse.InProgressResult + (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 53: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + (*EncryptionConfig_AgeRecipientConfig)(nil), // 54: c1.connector.v2.EncryptionConfig.AgeRecipientConfig + (*anypb.Any)(nil), // 55: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 56: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 57: google.protobuf.Struct + (*AssetRef)(nil), // 58: c1.connector.v2.AssetRef } var file_c1_connector_v2_resource_proto_depIdxs = []int32{ - 0, // 0: c1.connector.v2.ResourceType.traits:type_name -> c1.connector.v2.ResourceType.Trait - 46, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any - 24, // 2: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.parent:type_name -> c1.connector.v2.Resource - 46, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any - 3, // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.list:type_name -> c1.connector.v2.ResourceType - 46, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any - 24, // 6: c1.connector.v2.CreateResourceRequest.resource:type_name -> c1.connector.v2.Resource - 24, // 7: c1.connector.v2.CreateResourceResponse.created:type_name -> c1.connector.v2.Resource - 46, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any - 23, // 9: c1.connector.v2.DeleteResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 23, // 10: c1.connector.v2.DeleteResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 11: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any - 23, // 12: c1.connector.v2.DeleteResourceV2Request.resource_id:type_name -> c1.connector.v2.ResourceId - 23, // 13: c1.connector.v2.DeleteResourceV2Request.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 14: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any - 23, // 15: c1.connector.v2.RotateCredentialRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 15, // 16: c1.connector.v2.RotateCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions - 22, // 17: c1.connector.v2.RotateCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 20, // 18: c1.connector.v2.RotateCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData - 23, // 19: c1.connector.v2.RotateCredentialResponse.resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 20: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any - 31, // 21: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email - 47, // 22: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct - 32, // 23: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword - 33, // 24: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword - 34, // 25: c1.connector.v2.CredentialOptions.sso:type_name -> c1.connector.v2.CredentialOptions.SSO - 35, // 26: c1.connector.v2.CredentialOptions.encrypted_password:type_name -> c1.connector.v2.CredentialOptions.EncryptedPassword - 36, // 27: c1.connector.v2.LocalCredentialOptions.random_password:type_name -> c1.connector.v2.LocalCredentialOptions.RandomPassword - 37, // 28: c1.connector.v2.LocalCredentialOptions.no_password:type_name -> c1.connector.v2.LocalCredentialOptions.NoPassword - 38, // 29: c1.connector.v2.LocalCredentialOptions.sso:type_name -> c1.connector.v2.LocalCredentialOptions.SSO - 39, // 30: c1.connector.v2.LocalCredentialOptions.plaintext_password:type_name -> c1.connector.v2.LocalCredentialOptions.PlaintextPassword - 14, // 31: c1.connector.v2.CreateAccountRequest.account_info:type_name -> c1.connector.v2.AccountInfo - 15, // 32: c1.connector.v2.CreateAccountRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions - 22, // 33: c1.connector.v2.CreateAccountRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 40, // 34: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult - 41, // 35: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult - 42, // 36: c1.connector.v2.CreateAccountResponse.already_exists:type_name -> c1.connector.v2.CreateAccountResponse.AlreadyExistsResult - 43, // 37: c1.connector.v2.CreateAccountResponse.in_progress:type_name -> c1.connector.v2.CreateAccountResponse.InProgressResult - 20, // 38: c1.connector.v2.CreateAccountResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData - 46, // 39: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any - 24, // 40: c1.connector.v2.EncryptionConfig.principal:type_name -> c1.connector.v2.Resource - 44, // 41: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig - 45, // 42: c1.connector.v2.EncryptionConfig.age_recipient_config:type_name -> c1.connector.v2.EncryptionConfig.AgeRecipientConfig - 23, // 43: c1.connector.v2.Resource.id:type_name -> c1.connector.v2.ResourceId - 23, // 44: c1.connector.v2.Resource.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 45: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any - 30, // 46: c1.connector.v2.Resource.external_id:type_name -> c1.connector.v2.ExternalId - 1, // 47: c1.connector.v2.Resource.creation_source:type_name -> c1.connector.v2.Resource.CreationSource - 47, // 48: c1.connector.v2.Resource.profile:type_name -> google.protobuf.Struct - 48, // 49: c1.connector.v2.Resource.icon:type_name -> c1.connector.v2.AssetRef - 25, // 50: c1.connector.v2.Resource.status:type_name -> c1.connector.v2.Status - 49, // 51: c1.connector.v2.Resource.created_at:type_name -> google.protobuf.Timestamp - 2, // 52: c1.connector.v2.Status.status:type_name -> c1.connector.v2.Status.ResourceStatus - 23, // 53: c1.connector.v2.ResourcesServiceListResourcesRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 54: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any - 0, // 55: c1.connector.v2.ResourcesServiceListResourcesRequest.trait:type_name -> c1.connector.v2.ResourceType.Trait - 24, // 56: c1.connector.v2.ResourcesServiceListResourcesResponse.list:type_name -> c1.connector.v2.Resource - 46, // 57: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any - 23, // 58: c1.connector.v2.ResourceGetterServiceGetResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 23, // 59: c1.connector.v2.ResourceGetterServiceGetResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 60: c1.connector.v2.ResourceGetterServiceGetResourceRequest.annotations:type_name -> google.protobuf.Any - 24, // 61: c1.connector.v2.ResourceGetterServiceGetResourceResponse.resource:type_name -> c1.connector.v2.Resource - 46, // 62: c1.connector.v2.ResourceGetterServiceGetResourceResponse.annotations:type_name -> google.protobuf.Any - 17, // 63: c1.connector.v2.CredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint - 20, // 64: c1.connector.v2.CredentialOptions.EncryptedPassword.encrypted_passwords:type_name -> c1.connector.v2.EncryptedData - 17, // 65: c1.connector.v2.LocalCredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint - 24, // 66: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource - 49, // 67: c1.connector.v2.CreateAccountResponse.SuccessResult.invitation_expires_at:type_name -> google.protobuf.Timestamp - 24, // 68: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource - 24, // 69: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult.resource:type_name -> c1.connector.v2.Resource - 24, // 70: c1.connector.v2.CreateAccountResponse.InProgressResult.resource:type_name -> c1.connector.v2.Resource - 4, // 71: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest - 26, // 72: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest - 28, // 73: c1.connector.v2.ResourceGetterService.GetResource:input_type -> c1.connector.v2.ResourceGetterServiceGetResourceRequest - 6, // 74: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest - 8, // 75: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest - 10, // 76: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request - 12, // 77: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest - 18, // 78: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest - 5, // 79: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse - 27, // 80: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse - 29, // 81: c1.connector.v2.ResourceGetterService.GetResource:output_type -> c1.connector.v2.ResourceGetterServiceGetResourceResponse - 7, // 82: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse - 9, // 83: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse - 11, // 84: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response - 13, // 85: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse - 19, // 86: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse - 79, // [79:87] is the sub-list for method output_type - 71, // [71:79] is the sub-list for method input_type - 71, // [71:71] is the sub-list for extension type_name - 71, // [71:71] is the sub-list for extension extendee - 0, // [0:71] is the sub-list for field type_name + 1, // 0: c1.connector.v2.ResourceType.traits:type_name -> c1.connector.v2.ResourceType.Trait + 55, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any + 29, // 2: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.parent:type_name -> c1.connector.v2.Resource + 55, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any + 4, // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.list:type_name -> c1.connector.v2.ResourceType + 55, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any + 29, // 6: c1.connector.v2.CreateResourceRequest.resource:type_name -> c1.connector.v2.Resource + 29, // 7: c1.connector.v2.CreateResourceResponse.created:type_name -> c1.connector.v2.Resource + 55, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any + 28, // 9: c1.connector.v2.DeleteResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 28, // 10: c1.connector.v2.DeleteResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 11: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any + 28, // 12: c1.connector.v2.DeleteResourceV2Request.resource_id:type_name -> c1.connector.v2.ResourceId + 28, // 13: c1.connector.v2.DeleteResourceV2Request.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 14: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any + 28, // 15: c1.connector.v2.RotateCredentialRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 20, // 16: c1.connector.v2.RotateCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions + 27, // 17: c1.connector.v2.RotateCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 25, // 18: c1.connector.v2.RotateCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 28, // 19: c1.connector.v2.RotateCredentialResponse.resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 20: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any + 28, // 21: c1.connector.v2.IssueCredentialRequest.identity_id:type_name -> c1.connector.v2.ResourceId + 19, // 22: c1.connector.v2.IssueCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialIssueOptions + 27, // 23: c1.connector.v2.IssueCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 56, // 24: c1.connector.v2.IssueCredentialRequest.expires_at:type_name -> google.protobuf.Timestamp + 29, // 25: c1.connector.v2.IssueCredentialResponse.secret:type_name -> c1.connector.v2.Resource + 25, // 26: c1.connector.v2.IssueCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 55, // 27: c1.connector.v2.IssueCredentialResponse.annotations:type_name -> google.protobuf.Any + 0, // 28: c1.connector.v2.IssueCredentialResponse.resource_mode:type_name -> c1.connector.v2.CredentialResourceMode + 36, // 29: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email + 57, // 30: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct + 37, // 31: c1.connector.v2.CredentialIssueOptions.api_key:type_name -> c1.connector.v2.CredentialIssueOptions.ApiKey + 38, // 32: c1.connector.v2.CredentialIssueOptions.keypair:type_name -> c1.connector.v2.CredentialIssueOptions.Keypair + 39, // 33: c1.connector.v2.CredentialIssueOptions.token:type_name -> c1.connector.v2.CredentialIssueOptions.Token + 40, // 34: c1.connector.v2.CredentialIssueOptions.client_secret:type_name -> c1.connector.v2.CredentialIssueOptions.ClientSecret + 41, // 35: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword + 42, // 36: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword + 43, // 37: c1.connector.v2.CredentialOptions.sso:type_name -> c1.connector.v2.CredentialOptions.SSO + 44, // 38: c1.connector.v2.CredentialOptions.encrypted_password:type_name -> c1.connector.v2.CredentialOptions.EncryptedPassword + 45, // 39: c1.connector.v2.LocalCredentialOptions.random_password:type_name -> c1.connector.v2.LocalCredentialOptions.RandomPassword + 46, // 40: c1.connector.v2.LocalCredentialOptions.no_password:type_name -> c1.connector.v2.LocalCredentialOptions.NoPassword + 47, // 41: c1.connector.v2.LocalCredentialOptions.sso:type_name -> c1.connector.v2.LocalCredentialOptions.SSO + 48, // 42: c1.connector.v2.LocalCredentialOptions.plaintext_password:type_name -> c1.connector.v2.LocalCredentialOptions.PlaintextPassword + 17, // 43: c1.connector.v2.CreateAccountRequest.account_info:type_name -> c1.connector.v2.AccountInfo + 20, // 44: c1.connector.v2.CreateAccountRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions + 27, // 45: c1.connector.v2.CreateAccountRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 49, // 46: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult + 50, // 47: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult + 51, // 48: c1.connector.v2.CreateAccountResponse.already_exists:type_name -> c1.connector.v2.CreateAccountResponse.AlreadyExistsResult + 52, // 49: c1.connector.v2.CreateAccountResponse.in_progress:type_name -> c1.connector.v2.CreateAccountResponse.InProgressResult + 25, // 50: c1.connector.v2.CreateAccountResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 55, // 51: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any + 29, // 52: c1.connector.v2.EncryptionConfig.principal:type_name -> c1.connector.v2.Resource + 53, // 53: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + 54, // 54: c1.connector.v2.EncryptionConfig.age_recipient_config:type_name -> c1.connector.v2.EncryptionConfig.AgeRecipientConfig + 28, // 55: c1.connector.v2.Resource.id:type_name -> c1.connector.v2.ResourceId + 28, // 56: c1.connector.v2.Resource.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 57: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any + 35, // 58: c1.connector.v2.Resource.external_id:type_name -> c1.connector.v2.ExternalId + 2, // 59: c1.connector.v2.Resource.creation_source:type_name -> c1.connector.v2.Resource.CreationSource + 57, // 60: c1.connector.v2.Resource.profile:type_name -> google.protobuf.Struct + 58, // 61: c1.connector.v2.Resource.icon:type_name -> c1.connector.v2.AssetRef + 30, // 62: c1.connector.v2.Resource.status:type_name -> c1.connector.v2.Status + 56, // 63: c1.connector.v2.Resource.created_at:type_name -> google.protobuf.Timestamp + 3, // 64: c1.connector.v2.Status.status:type_name -> c1.connector.v2.Status.ResourceStatus + 28, // 65: c1.connector.v2.ResourcesServiceListResourcesRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 66: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any + 1, // 67: c1.connector.v2.ResourcesServiceListResourcesRequest.trait:type_name -> c1.connector.v2.ResourceType.Trait + 29, // 68: c1.connector.v2.ResourcesServiceListResourcesResponse.list:type_name -> c1.connector.v2.Resource + 55, // 69: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any + 28, // 70: c1.connector.v2.ResourceGetterServiceGetResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 28, // 71: c1.connector.v2.ResourceGetterServiceGetResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 72: c1.connector.v2.ResourceGetterServiceGetResourceRequest.annotations:type_name -> google.protobuf.Any + 29, // 73: c1.connector.v2.ResourceGetterServiceGetResourceResponse.resource:type_name -> c1.connector.v2.Resource + 55, // 74: c1.connector.v2.ResourceGetterServiceGetResourceResponse.annotations:type_name -> google.protobuf.Any + 18, // 75: c1.connector.v2.CredentialIssueOptions.Keypair.profile:type_name -> c1.connector.v2.KeyGenerationProfile + 22, // 76: c1.connector.v2.CredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint + 25, // 77: c1.connector.v2.CredentialOptions.EncryptedPassword.encrypted_passwords:type_name -> c1.connector.v2.EncryptedData + 22, // 78: c1.connector.v2.LocalCredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint + 29, // 79: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource + 56, // 80: c1.connector.v2.CreateAccountResponse.SuccessResult.invitation_expires_at:type_name -> google.protobuf.Timestamp + 29, // 81: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource + 29, // 82: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult.resource:type_name -> c1.connector.v2.Resource + 29, // 83: c1.connector.v2.CreateAccountResponse.InProgressResult.resource:type_name -> c1.connector.v2.Resource + 5, // 84: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest + 31, // 85: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest + 33, // 86: c1.connector.v2.ResourceGetterService.GetResource:input_type -> c1.connector.v2.ResourceGetterServiceGetResourceRequest + 7, // 87: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest + 9, // 88: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest + 11, // 89: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request + 13, // 90: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest + 15, // 91: c1.connector.v2.CredentialManagerService.IssueCredential:input_type -> c1.connector.v2.IssueCredentialRequest + 23, // 92: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest + 6, // 93: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse + 32, // 94: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse + 34, // 95: c1.connector.v2.ResourceGetterService.GetResource:output_type -> c1.connector.v2.ResourceGetterServiceGetResourceResponse + 8, // 96: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse + 10, // 97: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse + 12, // 98: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response + 14, // 99: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse + 16, // 100: c1.connector.v2.CredentialManagerService.IssueCredential:output_type -> c1.connector.v2.IssueCredentialResponse + 24, // 101: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse + 93, // [93:102] is the sub-list for method output_type + 84, // [84:93] is the sub-list for method input_type + 84, // [84:84] is the sub-list for extension type_name + 84, // [84:84] is the sub-list for extension extendee + 0, // [0:84] is the sub-list for field type_name } func init() { file_c1_connector_v2_resource_proto_init() } @@ -5314,25 +6425,35 @@ func file_c1_connector_v2_resource_proto_init() { return } file_c1_connector_v2_asset_proto_init() - file_c1_connector_v2_resource_proto_msgTypes[12].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[14].OneofWrappers = []any{ + (*KeyGenerationProfile_RsaModulusBits)(nil), + (*KeyGenerationProfile_Crv)(nil), + } + file_c1_connector_v2_resource_proto_msgTypes[15].OneofWrappers = []any{ + (*CredentialIssueOptions_ApiKey_)(nil), + (*CredentialIssueOptions_Keypair_)(nil), + (*CredentialIssueOptions_Token_)(nil), + (*CredentialIssueOptions_ClientSecret_)(nil), + } + file_c1_connector_v2_resource_proto_msgTypes[16].OneofWrappers = []any{ (*CredentialOptions_RandomPassword_)(nil), (*CredentialOptions_NoPassword_)(nil), (*CredentialOptions_Sso)(nil), (*CredentialOptions_EncryptedPassword_)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[13].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[17].OneofWrappers = []any{ (*LocalCredentialOptions_RandomPassword_)(nil), (*LocalCredentialOptions_NoPassword_)(nil), (*LocalCredentialOptions_Sso)(nil), (*LocalCredentialOptions_PlaintextPassword_)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[16].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[20].OneofWrappers = []any{ (*CreateAccountResponse_Success)(nil), (*CreateAccountResponse_ActionRequired)(nil), (*CreateAccountResponse_AlreadyExists)(nil), (*CreateAccountResponse_InProgress)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[19].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[23].OneofWrappers = []any{ (*EncryptionConfig_JwkPublicKeyConfig)(nil), (*EncryptionConfig_AgeRecipientConfig_)(nil), } @@ -5341,8 +6462,8 @@ func file_c1_connector_v2_resource_proto_init() { File: protoimpl.DescBuilder{ 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: 3, - NumMessages: 43, + NumEnums: 4, + NumMessages: 51, NumExtensions: 0, NumServices: 7, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.validate.go index 0e91d54f..d91b716a 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 @@ -1930,45 +1930,103 @@ var _ interface { ErrorName() string } = RotateCredentialResponseValidationError{} -// Validate checks the field values on AccountInfo 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 *AccountInfo) Validate() error { +// Validate checks the field values on IssueCredentialRequest 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 *IssueCredentialRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on AccountInfo 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 AccountInfoMultiError, or -// nil if none found. -func (m *AccountInfo) ValidateAll() error { +// ValidateAll checks the field values on IssueCredentialRequest 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 +// IssueCredentialRequestMultiError, or nil if none found. +func (m *IssueCredentialRequest) ValidateAll() error { return m.validate(true) } -func (m *AccountInfo) validate(all bool) error { +func (m *IssueCredentialRequest) validate(all bool) error { if m == nil { return nil } var errors []error - for idx, item := range m.GetEmails() { + if all { + switch v := interface{}(m.GetIdentityId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, IssueCredentialRequestValidationError{ + field: "IdentityId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, IssueCredentialRequestValidationError{ + field: "IdentityId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetIdentityId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IssueCredentialRequestValidationError{ + field: "IdentityId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCredentialOptions()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, IssueCredentialRequestValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, IssueCredentialRequestValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCredentialOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IssueCredentialRequestValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetEncryptionConfigs() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, AccountInfoValidationError{ - field: fmt.Sprintf("Emails[%v]", idx), + errors = append(errors, IssueCredentialRequestValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, AccountInfoValidationError{ - field: fmt.Sprintf("Emails[%v]", idx), + errors = append(errors, IssueCredentialRequestValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), reason: "embedded message failed validation", cause: err, }) @@ -1976,8 +2034,8 @@ func (m *AccountInfo) validate(all bool) error { } } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return AccountInfoValidationError{ - field: fmt.Sprintf("Emails[%v]", idx), + return IssueCredentialRequestValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), reason: "embedded message failed validation", cause: err, } @@ -1986,31 +2044,51 @@ func (m *AccountInfo) validate(all bool) error { } - // no validation rules for Login + if l := len(m.GetRequestId()); l < 1 || l > 128 { + err := IssueCredentialRequestValidationError{ + field: "RequestId", + reason: "value length must be between 1 and 128 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if !_IssueCredentialRequest_RequestId_Pattern.MatchString(m.GetRequestId()) { + err := IssueCredentialRequestValidationError{ + field: "RequestId", + reason: "value does not match regex pattern \"^[A-Za-z0-9_-]+$\"", + } + if !all { + return err + } + errors = append(errors, err) + } if all { - switch v := interface{}(m.GetProfile()).(type) { + switch v := interface{}(m.GetExpiresAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, AccountInfoValidationError{ - field: "Profile", + errors = append(errors, IssueCredentialRequestValidationError{ + field: "ExpiresAt", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, AccountInfoValidationError{ - field: "Profile", + errors = append(errors, IssueCredentialRequestValidationError{ + field: "ExpiresAt", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetProfile()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetExpiresAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return AccountInfoValidationError{ - field: "Profile", + return IssueCredentialRequestValidationError{ + field: "ExpiresAt", reason: "embedded message failed validation", cause: err, } @@ -2018,18 +2096,19 @@ func (m *AccountInfo) validate(all bool) error { } if len(errors) > 0 { - return AccountInfoMultiError(errors) + return IssueCredentialRequestMultiError(errors) } return nil } -// AccountInfoMultiError is an error wrapping multiple validation errors -// returned by AccountInfo.ValidateAll() if the designated constraints aren't met. -type AccountInfoMultiError []error +// IssueCredentialRequestMultiError is an error wrapping multiple validation +// errors returned by IssueCredentialRequest.ValidateAll() if the designated +// constraints aren't met. +type IssueCredentialRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m AccountInfoMultiError) Error() string { +func (m IssueCredentialRequestMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -2038,11 +2117,11 @@ func (m AccountInfoMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m AccountInfoMultiError) AllErrors() []error { return m } +func (m IssueCredentialRequestMultiError) AllErrors() []error { return m } -// AccountInfoValidationError is the validation error returned by -// AccountInfo.Validate if the designated constraints aren't met. -type AccountInfoValidationError struct { +// IssueCredentialRequestValidationError is the validation error returned by +// IssueCredentialRequest.Validate if the designated constraints aren't met. +type IssueCredentialRequestValidationError struct { field string reason string cause error @@ -2050,22 +2129,24 @@ type AccountInfoValidationError struct { } // Field function returns field value. -func (e AccountInfoValidationError) Field() string { return e.field } +func (e IssueCredentialRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e AccountInfoValidationError) Reason() string { return e.reason } +func (e IssueCredentialRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e AccountInfoValidationError) Cause() error { return e.cause } +func (e IssueCredentialRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e AccountInfoValidationError) Key() bool { return e.key } +func (e IssueCredentialRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e AccountInfoValidationError) ErrorName() string { return "AccountInfoValidationError" } +func (e IssueCredentialRequestValidationError) ErrorName() string { + return "IssueCredentialRequestValidationError" +} // Error satisfies the builtin error interface -func (e AccountInfoValidationError) Error() string { +func (e IssueCredentialRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2077,14 +2158,14 @@ func (e AccountInfoValidationError) Error() string { } return fmt.Sprintf( - "invalid %sAccountInfo.%s: %s%s", + "invalid %sIssueCredentialRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = AccountInfoValidationError{} +var _ error = IssueCredentialRequestValidationError{} var _ interface { Field() string @@ -2092,215 +2173,147 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = AccountInfoValidationError{} +} = IssueCredentialRequestValidationError{} -// Validate checks the field values on CredentialOptions with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *CredentialOptions) Validate() error { +var _IssueCredentialRequest_RequestId_Pattern = regexp.MustCompile("^[A-Za-z0-9_-]+$") + +// Validate checks the field values on IssueCredentialResponse 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 *IssueCredentialResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on CredentialOptions with the rules -// defined in the proto definition for this message. If any rules are +// ValidateAll checks the field values on IssueCredentialResponse 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 -// CredentialOptionsMultiError, or nil if none found. -func (m *CredentialOptions) ValidateAll() error { +// IssueCredentialResponseMultiError, or nil if none found. +func (m *IssueCredentialResponse) ValidateAll() error { return m.validate(true) } -func (m *CredentialOptions) validate(all bool) error { +func (m *IssueCredentialResponse) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for ForceChangeAtNextLogin - - switch v := m.Options.(type) { - case *CredentialOptions_RandomPassword_: - if v == nil { - err := CredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRandomPassword()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CredentialOptionsValidationError{ - field: "RandomPassword", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CredentialOptionsValidationError{ - field: "RandomPassword", - reason: "embedded message failed validation", - cause: err, - }) - } + if all { + switch v := interface{}(m.GetSecret()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, IssueCredentialResponseValidationError{ + field: "Secret", + reason: "embedded message failed validation", + cause: err, + }) } - } else if v, ok := interface{}(m.GetRandomPassword()).(interface{ Validate() error }); ok { + case interface{ Validate() error }: if err := v.Validate(); err != nil { - return CredentialOptionsValidationError{ - field: "RandomPassword", + errors = append(errors, IssueCredentialResponseValidationError{ + field: "Secret", reason: "embedded message failed validation", cause: err, - } + }) } } - - case *CredentialOptions_NoPassword_: - if v == nil { - err := CredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err + } else if v, ok := interface{}(m.GetSecret()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IssueCredentialResponseValidationError{ + field: "Secret", + reason: "embedded message failed validation", + cause: err, } - errors = append(errors, err) } + } + + for idx, item := range m.GetEncryptedData() { + _, _ = idx, item if all { - switch v := interface{}(m.GetNoPassword()).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CredentialOptionsValidationError{ - field: "NoPassword", + errors = append(errors, IssueCredentialResponseValidationError{ + field: fmt.Sprintf("EncryptedData[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CredentialOptionsValidationError{ - field: "NoPassword", + errors = append(errors, IssueCredentialResponseValidationError{ + field: fmt.Sprintf("EncryptedData[%v]", idx), reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetNoPassword()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CredentialOptionsValidationError{ - field: "NoPassword", + return IssueCredentialResponseValidationError{ + field: fmt.Sprintf("EncryptedData[%v]", idx), reason: "embedded message failed validation", cause: err, } } } - case *CredentialOptions_Sso: - if v == nil { - err := CredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } + } + + for idx, item := range m.GetAnnotations() { + _, _ = idx, item if all { - switch v := interface{}(m.GetSso()).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CredentialOptionsValidationError{ - field: "Sso", + errors = append(errors, IssueCredentialResponseValidationError{ + 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, CredentialOptionsValidationError{ - field: "Sso", + errors = append(errors, IssueCredentialResponseValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetSso()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CredentialOptionsValidationError{ - field: "Sso", + return IssueCredentialResponseValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), reason: "embedded message failed validation", cause: err, } } } - case *CredentialOptions_EncryptedPassword_: - if v == nil { - err := CredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } + } - if all { - switch v := interface{}(m.GetEncryptedPassword()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CredentialOptionsValidationError{ - field: "EncryptedPassword", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CredentialOptionsValidationError{ - field: "EncryptedPassword", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEncryptedPassword()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CredentialOptionsValidationError{ - field: "EncryptedPassword", - reason: "embedded message failed validation", - cause: err, - } - } - } + // no validation rules for ResourceMode - default: - _ = v // ensures v is used - } + // no validation rules for RequestId if len(errors) > 0 { - return CredentialOptionsMultiError(errors) + return IssueCredentialResponseMultiError(errors) } return nil } -// CredentialOptionsMultiError is an error wrapping multiple validation errors -// returned by CredentialOptions.ValidateAll() if the designated constraints -// aren't met. -type CredentialOptionsMultiError []error +// IssueCredentialResponseMultiError is an error wrapping multiple validation +// errors returned by IssueCredentialResponse.ValidateAll() if the designated +// constraints aren't met. +type IssueCredentialResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m CredentialOptionsMultiError) Error() string { +func (m IssueCredentialResponseMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -2309,11 +2322,11 @@ func (m CredentialOptionsMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m CredentialOptionsMultiError) AllErrors() []error { return m } +func (m IssueCredentialResponseMultiError) AllErrors() []error { return m } -// CredentialOptionsValidationError is the validation error returned by -// CredentialOptions.Validate if the designated constraints aren't met. -type CredentialOptionsValidationError struct { +// IssueCredentialResponseValidationError is the validation error returned by +// IssueCredentialResponse.Validate if the designated constraints aren't met. +type IssueCredentialResponseValidationError struct { field string reason string cause error @@ -2321,24 +2334,24 @@ type CredentialOptionsValidationError struct { } // Field function returns field value. -func (e CredentialOptionsValidationError) Field() string { return e.field } +func (e IssueCredentialResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e CredentialOptionsValidationError) Reason() string { return e.reason } +func (e IssueCredentialResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e CredentialOptionsValidationError) Cause() error { return e.cause } +func (e IssueCredentialResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e CredentialOptionsValidationError) Key() bool { return e.key } +func (e IssueCredentialResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e CredentialOptionsValidationError) ErrorName() string { - return "CredentialOptionsValidationError" +func (e IssueCredentialResponseValidationError) ErrorName() string { + return "IssueCredentialResponseValidationError" } // Error satisfies the builtin error interface -func (e CredentialOptionsValidationError) Error() string { +func (e IssueCredentialResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2350,14 +2363,14 @@ func (e CredentialOptionsValidationError) Error() string { } return fmt.Sprintf( - "invalid %sCredentialOptions.%s: %s%s", + "invalid %sIssueCredentialResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = CredentialOptionsValidationError{} +var _ error = IssueCredentialResponseValidationError{} var _ interface { Field() string @@ -2365,215 +2378,108 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = CredentialOptionsValidationError{} +} = IssueCredentialResponseValidationError{} -// Validate checks the field values on LocalCredentialOptions with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *LocalCredentialOptions) Validate() error { +// Validate checks the field values on AccountInfo 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 *AccountInfo) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on LocalCredentialOptions with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// LocalCredentialOptionsMultiError, or nil if none found. -func (m *LocalCredentialOptions) ValidateAll() error { +// ValidateAll checks the field values on AccountInfo 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 AccountInfoMultiError, or +// nil if none found. +func (m *AccountInfo) ValidateAll() error { return m.validate(true) } -func (m *LocalCredentialOptions) validate(all bool) error { +func (m *AccountInfo) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for ForceChangeAtNextLogin - - switch v := m.Options.(type) { - case *LocalCredentialOptions_RandomPassword_: - if v == nil { - err := LocalCredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } + for idx, item := range m.GetEmails() { + _, _ = idx, item if all { - switch v := interface{}(m.GetRandomPassword()).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "RandomPassword", + errors = append(errors, AccountInfoValidationError{ + field: fmt.Sprintf("Emails[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "RandomPassword", + errors = append(errors, AccountInfoValidationError{ + field: fmt.Sprintf("Emails[%v]", idx), reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetRandomPassword()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return LocalCredentialOptionsValidationError{ - field: "RandomPassword", + return AccountInfoValidationError{ + field: fmt.Sprintf("Emails[%v]", idx), reason: "embedded message failed validation", cause: err, } } } - case *LocalCredentialOptions_NoPassword_: - if v == nil { - err := LocalCredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } + } - if all { - switch v := interface{}(m.GetNoPassword()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "NoPassword", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "NoPassword", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetNoPassword()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return LocalCredentialOptionsValidationError{ - field: "NoPassword", + // no validation rules for Login + + if all { + switch v := interface{}(m.GetProfile()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AccountInfoValidationError{ + field: "Profile", reason: "embedded message failed validation", cause: err, - } - } - } - - case *LocalCredentialOptions_Sso: - if v == nil { - err := LocalCredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetSso()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "Sso", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "Sso", - reason: "embedded message failed validation", - cause: err, - }) - } + }) } - } else if v, ok := interface{}(m.GetSso()).(interface{ Validate() error }); ok { + case interface{ Validate() error }: if err := v.Validate(); err != nil { - return LocalCredentialOptionsValidationError{ - field: "Sso", + errors = append(errors, AccountInfoValidationError{ + field: "Profile", reason: "embedded message failed validation", cause: err, - } - } - } - - case *LocalCredentialOptions_PlaintextPassword_: - if v == nil { - err := LocalCredentialOptionsValidationError{ - field: "Options", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err + }) } - errors = append(errors, err) } - - if all { - switch v := interface{}(m.GetPlaintextPassword()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "PlaintextPassword", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, LocalCredentialOptionsValidationError{ - field: "PlaintextPassword", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPlaintextPassword()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return LocalCredentialOptionsValidationError{ - field: "PlaintextPassword", - reason: "embedded message failed validation", - cause: err, - } + } else if v, ok := interface{}(m.GetProfile()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccountInfoValidationError{ + field: "Profile", + reason: "embedded message failed validation", + cause: err, } } - - default: - _ = v // ensures v is used } if len(errors) > 0 { - return LocalCredentialOptionsMultiError(errors) + return AccountInfoMultiError(errors) } return nil } -// LocalCredentialOptionsMultiError is an error wrapping multiple validation -// errors returned by LocalCredentialOptions.ValidateAll() if the designated -// constraints aren't met. -type LocalCredentialOptionsMultiError []error +// AccountInfoMultiError is an error wrapping multiple validation errors +// returned by AccountInfo.ValidateAll() if the designated constraints aren't met. +type AccountInfoMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m LocalCredentialOptionsMultiError) Error() string { +func (m AccountInfoMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -2582,11 +2488,11 @@ func (m LocalCredentialOptionsMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m LocalCredentialOptionsMultiError) AllErrors() []error { return m } +func (m AccountInfoMultiError) AllErrors() []error { return m } -// LocalCredentialOptionsValidationError is the validation error returned by -// LocalCredentialOptions.Validate if the designated constraints aren't met. -type LocalCredentialOptionsValidationError struct { +// AccountInfoValidationError is the validation error returned by +// AccountInfo.Validate if the designated constraints aren't met. +type AccountInfoValidationError struct { field string reason string cause error @@ -2594,24 +2500,22 @@ type LocalCredentialOptionsValidationError struct { } // Field function returns field value. -func (e LocalCredentialOptionsValidationError) Field() string { return e.field } +func (e AccountInfoValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e LocalCredentialOptionsValidationError) Reason() string { return e.reason } +func (e AccountInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e LocalCredentialOptionsValidationError) Cause() error { return e.cause } +func (e AccountInfoValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e LocalCredentialOptionsValidationError) Key() bool { return e.key } +func (e AccountInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e LocalCredentialOptionsValidationError) ErrorName() string { - return "LocalCredentialOptionsValidationError" -} +func (e AccountInfoValidationError) ErrorName() string { return "AccountInfoValidationError" } // Error satisfies the builtin error interface -func (e LocalCredentialOptionsValidationError) Error() string { +func (e AccountInfoValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2623,14 +2527,14 @@ func (e LocalCredentialOptionsValidationError) Error() string { } return fmt.Sprintf( - "invalid %sLocalCredentialOptions.%s: %s%s", + "invalid %sAccountInfo.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = LocalCredentialOptionsValidationError{} +var _ error = AccountInfoValidationError{} var _ interface { Field() string @@ -2638,48 +2542,95 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = LocalCredentialOptionsValidationError{} +} = AccountInfoValidationError{} -// Validate checks the field values on PasswordConstraint with the rules +// Validate checks the field values on KeyGenerationProfile with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. -func (m *PasswordConstraint) Validate() error { +func (m *KeyGenerationProfile) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on PasswordConstraint with the rules +// ValidateAll checks the field values on KeyGenerationProfile with the rules // defined in the proto definition for this message. If any rules are // violated, the result is a list of violation errors wrapped in -// PasswordConstraintMultiError, or nil if none found. -func (m *PasswordConstraint) ValidateAll() error { +// KeyGenerationProfileMultiError, or nil if none found. +func (m *KeyGenerationProfile) ValidateAll() error { return m.validate(true) } -func (m *PasswordConstraint) validate(all bool) error { +func (m *KeyGenerationProfile) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for CharSet + if l := len(m.GetKty()); l < 1 || l > 32 { + err := KeyGenerationProfileValidationError{ + field: "Kty", + reason: "value length must be between 1 and 32 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } - // no validation rules for MinCount + switch v := m.Parameters.(type) { + case *KeyGenerationProfile_RsaModulusBits: + if v == nil { + err := KeyGenerationProfileValidationError{ + field: "Parameters", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + // no validation rules for RsaModulusBits + case *KeyGenerationProfile_Crv: + if v == nil { + err := KeyGenerationProfileValidationError{ + field: "Parameters", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(m.GetCrv()) > 64 { + err := KeyGenerationProfileValidationError{ + field: "Crv", + reason: "value length must be at most 64 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + default: + _ = v // ensures v is used + } if len(errors) > 0 { - return PasswordConstraintMultiError(errors) + return KeyGenerationProfileMultiError(errors) } return nil } -// PasswordConstraintMultiError is an error wrapping multiple validation errors -// returned by PasswordConstraint.ValidateAll() if the designated constraints -// aren't met. -type PasswordConstraintMultiError []error +// KeyGenerationProfileMultiError is an error wrapping multiple validation +// errors returned by KeyGenerationProfile.ValidateAll() if the designated +// constraints aren't met. +type KeyGenerationProfileMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m PasswordConstraintMultiError) Error() string { +func (m KeyGenerationProfileMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -2688,11 +2639,11 @@ func (m PasswordConstraintMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m PasswordConstraintMultiError) AllErrors() []error { return m } +func (m KeyGenerationProfileMultiError) AllErrors() []error { return m } -// PasswordConstraintValidationError is the validation error returned by -// PasswordConstraint.Validate if the designated constraints aren't met. -type PasswordConstraintValidationError struct { +// KeyGenerationProfileValidationError is the validation error returned by +// KeyGenerationProfile.Validate if the designated constraints aren't met. +type KeyGenerationProfileValidationError struct { field string reason string cause error @@ -2700,24 +2651,24 @@ type PasswordConstraintValidationError struct { } // Field function returns field value. -func (e PasswordConstraintValidationError) Field() string { return e.field } +func (e KeyGenerationProfileValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e PasswordConstraintValidationError) Reason() string { return e.reason } +func (e KeyGenerationProfileValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e PasswordConstraintValidationError) Cause() error { return e.cause } +func (e KeyGenerationProfileValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e PasswordConstraintValidationError) Key() bool { return e.key } +func (e KeyGenerationProfileValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e PasswordConstraintValidationError) ErrorName() string { - return "PasswordConstraintValidationError" +func (e KeyGenerationProfileValidationError) ErrorName() string { + return "KeyGenerationProfileValidationError" } // Error satisfies the builtin error interface -func (e PasswordConstraintValidationError) Error() string { +func (e KeyGenerationProfileValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2729,14 +2680,14 @@ func (e PasswordConstraintValidationError) Error() string { } return fmt.Sprintf( - "invalid %sPasswordConstraint.%s: %s%s", + "invalid %sKeyGenerationProfile.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = PasswordConstraintValidationError{} +var _ error = KeyGenerationProfileValidationError{} var _ interface { Field() string @@ -2744,128 +2695,159 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = PasswordConstraintValidationError{} +} = KeyGenerationProfileValidationError{} -// Validate checks the field values on CreateAccountRequest with the rules +// Validate checks the field values on CredentialIssueOptions 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 *CreateAccountRequest) Validate() error { +func (m *CredentialIssueOptions) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on CreateAccountRequest with the rules +// ValidateAll checks the field values on CredentialIssueOptions 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 -// CreateAccountRequestMultiError, or nil if none found. -func (m *CreateAccountRequest) ValidateAll() error { +// CredentialIssueOptionsMultiError, or nil if none found. +func (m *CredentialIssueOptions) ValidateAll() error { return m.validate(true) } -func (m *CreateAccountRequest) validate(all bool) error { +func (m *CredentialIssueOptions) validate(all bool) error { if m == nil { return nil } var errors []error - if all { - switch v := interface{}(m.GetAccountInfo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountRequestValidationError{ - field: "AccountInfo", - reason: "embedded message failed validation", - cause: err, - }) + switch v := m.Options.(type) { + case *CredentialIssueOptions_ApiKey_: + if v == nil { + err := CredentialIssueOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", } - case interface{ Validate() error }: + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetApiKey()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetApiKey()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountRequestValidationError{ - field: "AccountInfo", + return CredentialIssueOptionsValidationError{ + field: "ApiKey", reason: "embedded message failed validation", cause: err, - }) + } } } - } else if v, ok := interface{}(m.GetAccountInfo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateAccountRequestValidationError{ - field: "AccountInfo", - reason: "embedded message failed validation", - cause: err, + + case *CredentialIssueOptions_Keypair_: + if v == nil { + err := CredentialIssueOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err } + errors = append(errors, err) } - } - if all { - switch v := interface{}(m.GetCredentialOptions()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountRequestValidationError{ - field: "CredentialOptions", - reason: "embedded message failed validation", - cause: err, - }) + if all { + switch v := interface{}(m.GetKeypair()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "Keypair", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "Keypair", + reason: "embedded message failed validation", + cause: err, + }) + } } - case interface{ Validate() error }: + } else if v, ok := interface{}(m.GetKeypair()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountRequestValidationError{ - field: "CredentialOptions", + return CredentialIssueOptionsValidationError{ + field: "Keypair", reason: "embedded message failed validation", cause: err, - }) + } } } - } else if v, ok := interface{}(m.GetCredentialOptions()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreateAccountRequestValidationError{ - field: "CredentialOptions", - reason: "embedded message failed validation", - cause: err, + + case *CredentialIssueOptions_Token_: + if v == nil { + err := CredentialIssueOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err } + errors = append(errors, err) } - } - - for idx, item := range m.GetEncryptionConfigs() { - _, _ = idx, item if all { - switch v := interface{}(item).(type) { + switch v := interface{}(m.GetToken()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountRequestValidationError{ - field: fmt.Sprintf("EncryptionConfigs[%v]", idx), + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "Token", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountRequestValidationError{ - field: fmt.Sprintf("EncryptionConfigs[%v]", idx), + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "Token", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetToken()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CreateAccountRequestValidationError{ - field: fmt.Sprintf("EncryptionConfigs[%v]", idx), + return CredentialIssueOptionsValidationError{ + field: "Token", reason: "embedded message failed validation", cause: err, } } } - } - - if m.GetResourceTypeId() != "" { - - if l := len(m.GetResourceTypeId()); l < 1 || l > 1024 { - err := CreateAccountRequestValidationError{ - field: "ResourceTypeId", - reason: "value length must be between 1 and 1024 bytes, inclusive", + case *CredentialIssueOptions_ClientSecret_: + if v == nil { + err := CredentialIssueOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", } if !all { return err @@ -2873,22 +2855,53 @@ func (m *CreateAccountRequest) validate(all bool) error { errors = append(errors, err) } + if all { + switch v := interface{}(m.GetClientSecret()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "ClientSecret", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CredentialIssueOptionsValidationError{ + field: "ClientSecret", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetClientSecret()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CredentialIssueOptionsValidationError{ + field: "ClientSecret", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used } if len(errors) > 0 { - return CreateAccountRequestMultiError(errors) + return CredentialIssueOptionsMultiError(errors) } return nil } -// CreateAccountRequestMultiError is an error wrapping multiple validation -// errors returned by CreateAccountRequest.ValidateAll() if the designated +// CredentialIssueOptionsMultiError is an error wrapping multiple validation +// errors returned by CredentialIssueOptions.ValidateAll() if the designated // constraints aren't met. -type CreateAccountRequestMultiError []error +type CredentialIssueOptionsMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m CreateAccountRequestMultiError) Error() string { +func (m CredentialIssueOptionsMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -2897,11 +2910,11 @@ func (m CreateAccountRequestMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m CreateAccountRequestMultiError) AllErrors() []error { return m } +func (m CredentialIssueOptionsMultiError) AllErrors() []error { return m } -// CreateAccountRequestValidationError is the validation error returned by -// CreateAccountRequest.Validate if the designated constraints aren't met. -type CreateAccountRequestValidationError struct { +// CredentialIssueOptionsValidationError is the validation error returned by +// CredentialIssueOptions.Validate if the designated constraints aren't met. +type CredentialIssueOptionsValidationError struct { field string reason string cause error @@ -2909,24 +2922,24 @@ type CreateAccountRequestValidationError struct { } // Field function returns field value. -func (e CreateAccountRequestValidationError) Field() string { return e.field } +func (e CredentialIssueOptionsValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e CreateAccountRequestValidationError) Reason() string { return e.reason } +func (e CredentialIssueOptionsValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e CreateAccountRequestValidationError) Cause() error { return e.cause } +func (e CredentialIssueOptionsValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e CreateAccountRequestValidationError) Key() bool { return e.key } +func (e CredentialIssueOptionsValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e CreateAccountRequestValidationError) ErrorName() string { - return "CreateAccountRequestValidationError" +func (e CredentialIssueOptionsValidationError) ErrorName() string { + return "CredentialIssueOptionsValidationError" } // Error satisfies the builtin error interface -func (e CreateAccountRequestValidationError) Error() string { +func (e CredentialIssueOptionsValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2938,14 +2951,14 @@ func (e CreateAccountRequestValidationError) Error() string { } return fmt.Sprintf( - "invalid %sCreateAccountRequest.%s: %s%s", + "invalid %sCredentialIssueOptions.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = CreateAccountRequestValidationError{} +var _ error = CredentialIssueOptionsValidationError{} var _ interface { Field() string @@ -2953,103 +2966,37 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = CreateAccountRequestValidationError{} +} = CredentialIssueOptionsValidationError{} -// Validate checks the field values on CreateAccountResponse 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 *CreateAccountResponse) Validate() error { +// Validate checks the field values on CredentialOptions with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CredentialOptions) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on CreateAccountResponse with the rules +// ValidateAll checks the field values on CredentialOptions 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 -// CreateAccountResponseMultiError, or nil if none found. -func (m *CreateAccountResponse) ValidateAll() error { +// CredentialOptionsMultiError, or nil if none found. +func (m *CredentialOptions) ValidateAll() error { return m.validate(true) } -func (m *CreateAccountResponse) validate(all bool) error { +func (m *CredentialOptions) validate(all bool) error { if m == nil { return nil } var errors []error - for idx, item := range m.GetEncryptedData() { - _, _ = idx, item + // no validation rules for ForceChangeAtNextLogin - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: fmt.Sprintf("EncryptedData[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: fmt.Sprintf("EncryptedData[%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 CreateAccountResponseValidationError{ - field: fmt.Sprintf("EncryptedData[%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, CreateAccountResponseValidationError{ - 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, CreateAccountResponseValidationError{ - 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 CreateAccountResponseValidationError{ - field: fmt.Sprintf("Annotations[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - switch v := m.Result.(type) { - case *CreateAccountResponse_Success: + switch v := m.Options.(type) { + case *CredentialOptions_RandomPassword_: if v == nil { - err := CreateAccountResponseValidationError{ - field: "Result", + err := CredentialOptionsValidationError{ + field: "Options", reason: "oneof value cannot be a typed-nil", } if !all { @@ -3059,38 +3006,38 @@ func (m *CreateAccountResponse) validate(all bool) error { } if all { - switch v := interface{}(m.GetSuccess()).(type) { + switch v := interface{}(m.GetRandomPassword()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "Success", + errors = append(errors, CredentialOptionsValidationError{ + field: "RandomPassword", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "Success", + errors = append(errors, CredentialOptionsValidationError{ + field: "RandomPassword", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetSuccess()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetRandomPassword()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CreateAccountResponseValidationError{ - field: "Success", + return CredentialOptionsValidationError{ + field: "RandomPassword", reason: "embedded message failed validation", cause: err, } } } - case *CreateAccountResponse_ActionRequired: + case *CredentialOptions_NoPassword_: if v == nil { - err := CreateAccountResponseValidationError{ - field: "Result", + err := CredentialOptionsValidationError{ + field: "Options", reason: "oneof value cannot be a typed-nil", } if !all { @@ -3100,38 +3047,38 @@ func (m *CreateAccountResponse) validate(all bool) error { } if all { - switch v := interface{}(m.GetActionRequired()).(type) { + switch v := interface{}(m.GetNoPassword()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "ActionRequired", + errors = append(errors, CredentialOptionsValidationError{ + field: "NoPassword", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "ActionRequired", + errors = append(errors, CredentialOptionsValidationError{ + field: "NoPassword", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetActionRequired()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetNoPassword()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CreateAccountResponseValidationError{ - field: "ActionRequired", + return CredentialOptionsValidationError{ + field: "NoPassword", reason: "embedded message failed validation", cause: err, } } } - case *CreateAccountResponse_AlreadyExists: + case *CredentialOptions_Sso: if v == nil { - err := CreateAccountResponseValidationError{ - field: "Result", + err := CredentialOptionsValidationError{ + field: "Options", reason: "oneof value cannot be a typed-nil", } if !all { @@ -3141,38 +3088,38 @@ func (m *CreateAccountResponse) validate(all bool) error { } if all { - switch v := interface{}(m.GetAlreadyExists()).(type) { + switch v := interface{}(m.GetSso()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "AlreadyExists", + errors = append(errors, CredentialOptionsValidationError{ + field: "Sso", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "AlreadyExists", + errors = append(errors, CredentialOptionsValidationError{ + field: "Sso", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetAlreadyExists()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetSso()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CreateAccountResponseValidationError{ - field: "AlreadyExists", + return CredentialOptionsValidationError{ + field: "Sso", reason: "embedded message failed validation", cause: err, } } } - case *CreateAccountResponse_InProgress: + case *CredentialOptions_EncryptedPassword_: if v == nil { - err := CreateAccountResponseValidationError{ - field: "Result", + err := CredentialOptionsValidationError{ + field: "Options", reason: "oneof value cannot be a typed-nil", } if !all { @@ -3182,28 +3129,28 @@ func (m *CreateAccountResponse) validate(all bool) error { } if all { - switch v := interface{}(m.GetInProgress()).(type) { + switch v := interface{}(m.GetEncryptedPassword()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "InProgress", + errors = append(errors, CredentialOptionsValidationError{ + field: "EncryptedPassword", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CreateAccountResponseValidationError{ - field: "InProgress", + errors = append(errors, CredentialOptionsValidationError{ + field: "EncryptedPassword", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetInProgress()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetEncryptedPassword()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CreateAccountResponseValidationError{ - field: "InProgress", + return CredentialOptionsValidationError{ + field: "EncryptedPassword", reason: "embedded message failed validation", cause: err, } @@ -3215,19 +3162,19 @@ func (m *CreateAccountResponse) validate(all bool) error { } if len(errors) > 0 { - return CreateAccountResponseMultiError(errors) + return CredentialOptionsMultiError(errors) } return nil } -// CreateAccountResponseMultiError is an error wrapping multiple validation -// errors returned by CreateAccountResponse.ValidateAll() if the designated -// constraints aren't met. -type CreateAccountResponseMultiError []error +// CredentialOptionsMultiError is an error wrapping multiple validation errors +// returned by CredentialOptions.ValidateAll() if the designated constraints +// aren't met. +type CredentialOptionsMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m CreateAccountResponseMultiError) Error() string { +func (m CredentialOptionsMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -3236,11 +3183,11 @@ func (m CreateAccountResponseMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m CreateAccountResponseMultiError) AllErrors() []error { return m } +func (m CredentialOptionsMultiError) AllErrors() []error { return m } -// CreateAccountResponseValidationError is the validation error returned by -// CreateAccountResponse.Validate if the designated constraints aren't met. -type CreateAccountResponseValidationError struct { +// CredentialOptionsValidationError is the validation error returned by +// CredentialOptions.Validate if the designated constraints aren't met. +type CredentialOptionsValidationError struct { field string reason string cause error @@ -3248,24 +3195,24 @@ type CreateAccountResponseValidationError struct { } // Field function returns field value. -func (e CreateAccountResponseValidationError) Field() string { return e.field } +func (e CredentialOptionsValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e CreateAccountResponseValidationError) Reason() string { return e.reason } +func (e CredentialOptionsValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e CreateAccountResponseValidationError) Cause() error { return e.cause } +func (e CredentialOptionsValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e CreateAccountResponseValidationError) Key() bool { return e.key } +func (e CredentialOptionsValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e CreateAccountResponseValidationError) ErrorName() string { - return "CreateAccountResponseValidationError" +func (e CredentialOptionsValidationError) ErrorName() string { + return "CredentialOptionsValidationError" } // Error satisfies the builtin error interface -func (e CreateAccountResponseValidationError) Error() string { +func (e CredentialOptionsValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3277,14 +3224,14 @@ func (e CreateAccountResponseValidationError) Error() string { } return fmt.Sprintf( - "invalid %sCreateAccountResponse.%s: %s%s", + "invalid %sCredentialOptions.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = CreateAccountResponseValidationError{} +var _ error = CredentialOptionsValidationError{} var _ interface { Field() string @@ -3292,56 +3239,215 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = CreateAccountResponseValidationError{} +} = CredentialOptionsValidationError{} -// Validate checks the field values on EncryptedData 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 *EncryptedData) Validate() error { +// Validate checks the field values on LocalCredentialOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *LocalCredentialOptions) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on EncryptedData 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 EncryptedDataMultiError, or -// nil if none found. -func (m *EncryptedData) ValidateAll() error { +// ValidateAll checks the field values on LocalCredentialOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// LocalCredentialOptionsMultiError, or nil if none found. +func (m *LocalCredentialOptions) ValidateAll() error { return m.validate(true) } -func (m *EncryptedData) validate(all bool) error { +func (m *LocalCredentialOptions) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Provider + // no validation rules for ForceChangeAtNextLogin - // no validation rules for KeyId + switch v := m.Options.(type) { + case *LocalCredentialOptions_RandomPassword_: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } - // no validation rules for Name + if all { + switch v := interface{}(m.GetRandomPassword()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "RandomPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "RandomPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRandomPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "RandomPassword", + reason: "embedded message failed validation", + cause: err, + } + } + } - // no validation rules for Description + case *LocalCredentialOptions_NoPassword_: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } - // no validation rules for Schema + if all { + switch v := interface{}(m.GetNoPassword()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "NoPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "NoPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNoPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "NoPassword", + reason: "embedded message failed validation", + cause: err, + } + } + } - // no validation rules for EncryptedBytes + case *LocalCredentialOptions_Sso: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetSso()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "Sso", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "Sso", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetSso()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "Sso", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *LocalCredentialOptions_PlaintextPassword_: + if v == nil { + err := LocalCredentialOptionsValidationError{ + field: "Options", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPlaintextPassword()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "PlaintextPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, LocalCredentialOptionsValidationError{ + field: "PlaintextPassword", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPlaintextPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalCredentialOptionsValidationError{ + field: "PlaintextPassword", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } if len(errors) > 0 { - return EncryptedDataMultiError(errors) + return LocalCredentialOptionsMultiError(errors) } return nil } -// EncryptedDataMultiError is an error wrapping multiple validation errors -// returned by EncryptedData.ValidateAll() if the designated constraints -// aren't met. -type EncryptedDataMultiError []error +// LocalCredentialOptionsMultiError is an error wrapping multiple validation +// errors returned by LocalCredentialOptions.ValidateAll() if the designated +// constraints aren't met. +type LocalCredentialOptionsMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m EncryptedDataMultiError) Error() string { +func (m LocalCredentialOptionsMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -3350,11 +3456,11 @@ func (m EncryptedDataMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m EncryptedDataMultiError) AllErrors() []error { return m } +func (m LocalCredentialOptionsMultiError) AllErrors() []error { return m } -// EncryptedDataValidationError is the validation error returned by -// EncryptedData.Validate if the designated constraints aren't met. -type EncryptedDataValidationError struct { +// LocalCredentialOptionsValidationError is the validation error returned by +// LocalCredentialOptions.Validate if the designated constraints aren't met. +type LocalCredentialOptionsValidationError struct { field string reason string cause error @@ -3362,22 +3468,24 @@ type EncryptedDataValidationError struct { } // Field function returns field value. -func (e EncryptedDataValidationError) Field() string { return e.field } +func (e LocalCredentialOptionsValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e EncryptedDataValidationError) Reason() string { return e.reason } +func (e LocalCredentialOptionsValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e EncryptedDataValidationError) Cause() error { return e.cause } +func (e LocalCredentialOptionsValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e EncryptedDataValidationError) Key() bool { return e.key } +func (e LocalCredentialOptionsValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e EncryptedDataValidationError) ErrorName() string { return "EncryptedDataValidationError" } +func (e LocalCredentialOptionsValidationError) ErrorName() string { + return "LocalCredentialOptionsValidationError" +} // Error satisfies the builtin error interface -func (e EncryptedDataValidationError) Error() string { +func (e LocalCredentialOptionsValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3389,14 +3497,14 @@ func (e EncryptedDataValidationError) Error() string { } return fmt.Sprintf( - "invalid %sEncryptedData.%s: %s%s", + "invalid %sLocalCredentialOptions.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = EncryptedDataValidationError{} +var _ error = LocalCredentialOptionsValidationError{} var _ interface { Field() string @@ -3404,52 +3512,48 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = EncryptedDataValidationError{} +} = LocalCredentialOptionsValidationError{} -// Validate checks the field values on PlaintextData 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 *PlaintextData) Validate() error { +// Validate checks the field values on PasswordConstraint with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *PasswordConstraint) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on PlaintextData 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 PlaintextDataMultiError, or -// nil if none found. -func (m *PlaintextData) ValidateAll() error { +// ValidateAll checks the field values on PasswordConstraint with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// PasswordConstraintMultiError, or nil if none found. +func (m *PasswordConstraint) ValidateAll() error { return m.validate(true) } -func (m *PlaintextData) validate(all bool) error { +func (m *PasswordConstraint) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Name - - // no validation rules for Description - - // no validation rules for Schema + // no validation rules for CharSet - // no validation rules for Bytes + // no validation rules for MinCount if len(errors) > 0 { - return PlaintextDataMultiError(errors) + return PasswordConstraintMultiError(errors) } return nil } -// PlaintextDataMultiError is an error wrapping multiple validation errors -// returned by PlaintextData.ValidateAll() if the designated constraints +// PasswordConstraintMultiError is an error wrapping multiple validation errors +// returned by PasswordConstraint.ValidateAll() if the designated constraints // aren't met. -type PlaintextDataMultiError []error +type PasswordConstraintMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m PlaintextDataMultiError) Error() string { +func (m PasswordConstraintMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -3458,11 +3562,11 @@ func (m PlaintextDataMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m PlaintextDataMultiError) AllErrors() []error { return m } +func (m PasswordConstraintMultiError) AllErrors() []error { return m } -// PlaintextDataValidationError is the validation error returned by -// PlaintextData.Validate if the designated constraints aren't met. -type PlaintextDataValidationError struct { +// PasswordConstraintValidationError is the validation error returned by +// PasswordConstraint.Validate if the designated constraints aren't met. +type PasswordConstraintValidationError struct { field string reason string cause error @@ -3470,22 +3574,24 @@ type PlaintextDataValidationError struct { } // Field function returns field value. -func (e PlaintextDataValidationError) Field() string { return e.field } +func (e PasswordConstraintValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e PlaintextDataValidationError) Reason() string { return e.reason } +func (e PasswordConstraintValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e PlaintextDataValidationError) Cause() error { return e.cause } +func (e PasswordConstraintValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e PlaintextDataValidationError) Key() bool { return e.key } +func (e PasswordConstraintValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e PlaintextDataValidationError) ErrorName() string { return "PlaintextDataValidationError" } +func (e PasswordConstraintValidationError) ErrorName() string { + return "PasswordConstraintValidationError" +} // Error satisfies the builtin error interface -func (e PlaintextDataValidationError) Error() string { +func (e PasswordConstraintValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3497,14 +3603,14 @@ func (e PlaintextDataValidationError) Error() string { } return fmt.Sprintf( - "invalid %sPlaintextData.%s: %s%s", + "invalid %sPasswordConstraint.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = PlaintextDataValidationError{} +var _ error = PasswordConstraintValidationError{} var _ interface { Field() string @@ -3512,24 +3618,24 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = PlaintextDataValidationError{} +} = PasswordConstraintValidationError{} -// Validate checks the field values on EncryptionConfig 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 *EncryptionConfig) Validate() error { +// Validate checks the field values on CreateAccountRequest 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 *CreateAccountRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on EncryptionConfig with the rules +// ValidateAll checks the field values on CreateAccountRequest 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 -// EncryptionConfigMultiError, or nil if none found. -func (m *EncryptionConfig) ValidateAll() error { +// CreateAccountRequestMultiError, or nil if none found. +func (m *CreateAccountRequest) ValidateAll() error { return m.validate(true) } -func (m *EncryptionConfig) validate(all bool) error { +func (m *CreateAccountRequest) validate(all bool) error { if m == nil { return nil } @@ -3537,85 +3643,103 @@ func (m *EncryptionConfig) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetPrincipal()).(type) { + switch v := interface{}(m.GetAccountInfo()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, EncryptionConfigValidationError{ - field: "Principal", + errors = append(errors, CreateAccountRequestValidationError{ + field: "AccountInfo", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, EncryptionConfigValidationError{ - field: "Principal", + errors = append(errors, CreateAccountRequestValidationError{ + field: "AccountInfo", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetPrincipal()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetAccountInfo()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return EncryptionConfigValidationError{ - field: "Principal", + return CreateAccountRequestValidationError{ + field: "AccountInfo", reason: "embedded message failed validation", cause: err, } } } - // no validation rules for Provider - - // no validation rules for KeyId - - switch v := m.Config.(type) { - case *EncryptionConfig_JwkPublicKeyConfig: - if v == nil { - err := EncryptionConfigValidationError{ - field: "Config", - reason: "oneof value cannot be a typed-nil", + if all { + switch v := interface{}(m.GetCredentialOptions()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountRequestValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + }) } - if !all { - return err + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountRequestValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCredentialOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAccountRequestValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, } - errors = append(errors, err) } + } + + for idx, item := range m.GetEncryptionConfigs() { + _, _ = idx, item if all { - switch v := interface{}(m.GetJwkPublicKeyConfig()).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, EncryptionConfigValidationError{ - field: "JwkPublicKeyConfig", + errors = append(errors, CreateAccountRequestValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, EncryptionConfigValidationError{ - field: "JwkPublicKeyConfig", + errors = append(errors, CreateAccountRequestValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetJwkPublicKeyConfig()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return EncryptionConfigValidationError{ - field: "JwkPublicKeyConfig", + return CreateAccountRequestValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), reason: "embedded message failed validation", cause: err, } } } - case *EncryptionConfig_AgeRecipientConfig_: - if v == nil { - err := EncryptionConfigValidationError{ - field: "Config", - reason: "oneof value cannot be a typed-nil", + } + + if m.GetResourceTypeId() != "" { + + if l := len(m.GetResourceTypeId()); l < 1 || l > 1024 { + err := CreateAccountRequestValidationError{ + field: "ResourceTypeId", + reason: "value length must be between 1 and 1024 bytes, inclusive", } if !all { return err @@ -3623,53 +3747,22 @@ func (m *EncryptionConfig) validate(all bool) error { errors = append(errors, err) } - if all { - switch v := interface{}(m.GetAgeRecipientConfig()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, EncryptionConfigValidationError{ - field: "AgeRecipientConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, EncryptionConfigValidationError{ - field: "AgeRecipientConfig", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAgeRecipientConfig()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return EncryptionConfigValidationError{ - field: "AgeRecipientConfig", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used } if len(errors) > 0 { - return EncryptionConfigMultiError(errors) + return CreateAccountRequestMultiError(errors) } return nil } -// EncryptionConfigMultiError is an error wrapping multiple validation errors -// returned by EncryptionConfig.ValidateAll() if the designated constraints -// aren't met. -type EncryptionConfigMultiError []error +// CreateAccountRequestMultiError is an error wrapping multiple validation +// errors returned by CreateAccountRequest.ValidateAll() if the designated +// constraints aren't met. +type CreateAccountRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m EncryptionConfigMultiError) Error() string { +func (m CreateAccountRequestMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -3678,11 +3771,11 @@ func (m EncryptionConfigMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m EncryptionConfigMultiError) AllErrors() []error { return m } +func (m CreateAccountRequestMultiError) AllErrors() []error { return m } -// EncryptionConfigValidationError is the validation error returned by -// EncryptionConfig.Validate if the designated constraints aren't met. -type EncryptionConfigValidationError struct { +// CreateAccountRequestValidationError is the validation error returned by +// CreateAccountRequest.Validate if the designated constraints aren't met. +type CreateAccountRequestValidationError struct { field string reason string cause error @@ -3690,22 +3783,24 @@ type EncryptionConfigValidationError struct { } // Field function returns field value. -func (e EncryptionConfigValidationError) Field() string { return e.field } +func (e CreateAccountRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e EncryptionConfigValidationError) Reason() string { return e.reason } +func (e CreateAccountRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e EncryptionConfigValidationError) Cause() error { return e.cause } +func (e CreateAccountRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e EncryptionConfigValidationError) Key() bool { return e.key } +func (e CreateAccountRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e EncryptionConfigValidationError) ErrorName() string { return "EncryptionConfigValidationError" } +func (e CreateAccountRequestValidationError) ErrorName() string { + return "CreateAccountRequestValidationError" +} // Error satisfies the builtin error interface -func (e EncryptionConfigValidationError) Error() string { +func (e CreateAccountRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3717,14 +3812,14 @@ func (e EncryptionConfigValidationError) Error() string { } return fmt.Sprintf( - "invalid %sEncryptionConfig.%s: %s%s", + "invalid %sCreateAccountRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = EncryptionConfigValidationError{} +var _ error = CreateAccountRequestValidationError{} var _ interface { Field() string @@ -3732,67 +3827,281 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = EncryptionConfigValidationError{} +} = CreateAccountRequestValidationError{} -// Validate checks the field values on ResourceId 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 *ResourceId) Validate() error { +// Validate checks the field values on CreateAccountResponse 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 *CreateAccountResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on ResourceId 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 ResourceIdMultiError, or -// nil if none found. -func (m *ResourceId) ValidateAll() error { +// ValidateAll checks the field values on CreateAccountResponse 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 +// CreateAccountResponseMultiError, or nil if none found. +func (m *CreateAccountResponse) ValidateAll() error { return m.validate(true) } -func (m *ResourceId) validate(all bool) error { +func (m *CreateAccountResponse) validate(all bool) error { if m == nil { return nil } var errors []error - if l := len(m.GetResourceType()); l < 1 || l > 1024 { - err := ResourceIdValidationError{ - field: "ResourceType", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } + for idx, item := range m.GetEncryptedData() { + _, _ = idx, item - if l := len(m.GetResource()); l < 1 || l > 1024 { - err := ResourceIdValidationError{ - field: "Resource", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: fmt.Sprintf("EncryptedData[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: fmt.Sprintf("EncryptedData[%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 CreateAccountResponseValidationError{ + field: fmt.Sprintf("EncryptedData[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } } - errors = append(errors, err) + } - // no validation rules for BatonResource + for idx, item := range m.GetAnnotations() { + _, _ = idx, item - if len(errors) > 0 { - return ResourceIdMultiError(errors) - } + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + 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, CreateAccountResponseValidationError{ + 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 CreateAccountResponseValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } - return nil -} + } -// ResourceIdMultiError is an error wrapping multiple validation errors -// returned by ResourceId.ValidateAll() if the designated constraints aren't met. -type ResourceIdMultiError []error + switch v := m.Result.(type) { + case *CreateAccountResponse_Success: + if v == nil { + err := CreateAccountResponseValidationError{ + field: "Result", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetSuccess()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "Success", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "Success", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetSuccess()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAccountResponseValidationError{ + field: "Success", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *CreateAccountResponse_ActionRequired: + if v == nil { + err := CreateAccountResponseValidationError{ + field: "Result", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetActionRequired()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "ActionRequired", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "ActionRequired", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetActionRequired()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAccountResponseValidationError{ + field: "ActionRequired", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *CreateAccountResponse_AlreadyExists: + if v == nil { + err := CreateAccountResponseValidationError{ + field: "Result", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAlreadyExists()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "AlreadyExists", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "AlreadyExists", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAlreadyExists()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAccountResponseValidationError{ + field: "AlreadyExists", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *CreateAccountResponse_InProgress: + if v == nil { + err := CreateAccountResponseValidationError{ + field: "Result", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetInProgress()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "InProgress", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountResponseValidationError{ + field: "InProgress", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetInProgress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAccountResponseValidationError{ + field: "InProgress", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return CreateAccountResponseMultiError(errors) + } + + return nil +} + +// CreateAccountResponseMultiError is an error wrapping multiple validation +// errors returned by CreateAccountResponse.ValidateAll() if the designated +// constraints aren't met. +type CreateAccountResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ResourceIdMultiError) Error() string { +func (m CreateAccountResponseMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -3801,11 +4110,11 @@ func (m ResourceIdMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ResourceIdMultiError) AllErrors() []error { return m } +func (m CreateAccountResponseMultiError) AllErrors() []error { return m } -// ResourceIdValidationError is the validation error returned by -// ResourceId.Validate if the designated constraints aren't met. -type ResourceIdValidationError struct { +// CreateAccountResponseValidationError is the validation error returned by +// CreateAccountResponse.Validate if the designated constraints aren't met. +type CreateAccountResponseValidationError struct { field string reason string cause error @@ -3813,22 +4122,24 @@ type ResourceIdValidationError struct { } // Field function returns field value. -func (e ResourceIdValidationError) Field() string { return e.field } +func (e CreateAccountResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ResourceIdValidationError) Reason() string { return e.reason } +func (e CreateAccountResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ResourceIdValidationError) Cause() error { return e.cause } +func (e CreateAccountResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ResourceIdValidationError) Key() bool { return e.key } +func (e CreateAccountResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ResourceIdValidationError) ErrorName() string { return "ResourceIdValidationError" } +func (e CreateAccountResponseValidationError) ErrorName() string { + return "CreateAccountResponseValidationError" +} // Error satisfies the builtin error interface -func (e ResourceIdValidationError) Error() string { +func (e CreateAccountResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3840,14 +4151,14 @@ func (e ResourceIdValidationError) Error() string { } return fmt.Sprintf( - "invalid %sResourceId.%s: %s%s", + "invalid %sCreateAccountResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ResourceIdValidationError{} +var _ error = CreateAccountResponseValidationError{} var _ interface { Field() string @@ -3855,94 +4166,1354 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ResourceIdValidationError{} +} = CreateAccountResponseValidationError{} -// Validate checks the field values on Resource with the rules defined in the -// proto definition for this message. If any rules are violated, the first +// Validate checks the field values on EncryptedData 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 *Resource) Validate() error { +func (m *EncryptedData) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on EncryptedData 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 EncryptedDataMultiError, or +// nil if none found. +func (m *EncryptedData) ValidateAll() error { + return m.validate(true) +} + +func (m *EncryptedData) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Provider + + // no validation rules for KeyId + + // no validation rules for Name + + // no validation rules for Description + + // no validation rules for Schema + + // no validation rules for EncryptedBytes + + if len(errors) > 0 { + return EncryptedDataMultiError(errors) + } + + return nil +} + +// EncryptedDataMultiError is an error wrapping multiple validation errors +// returned by EncryptedData.ValidateAll() if the designated constraints +// aren't met. +type EncryptedDataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m EncryptedDataMultiError) 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 EncryptedDataMultiError) AllErrors() []error { return m } + +// EncryptedDataValidationError is the validation error returned by +// EncryptedData.Validate if the designated constraints aren't met. +type EncryptedDataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EncryptedDataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EncryptedDataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EncryptedDataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EncryptedDataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EncryptedDataValidationError) ErrorName() string { return "EncryptedDataValidationError" } + +// Error satisfies the builtin error interface +func (e EncryptedDataValidationError) 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 %sEncryptedData.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EncryptedDataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EncryptedDataValidationError{} + +// Validate checks the field values on PlaintextData 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 *PlaintextData) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PlaintextData 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 PlaintextDataMultiError, or +// nil if none found. +func (m *PlaintextData) ValidateAll() error { + return m.validate(true) +} + +func (m *PlaintextData) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Name + + // no validation rules for Description + + // no validation rules for Schema + + // no validation rules for Bytes + + if len(errors) > 0 { + return PlaintextDataMultiError(errors) + } + + return nil +} + +// PlaintextDataMultiError is an error wrapping multiple validation errors +// returned by PlaintextData.ValidateAll() if the designated constraints +// aren't met. +type PlaintextDataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PlaintextDataMultiError) 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 PlaintextDataMultiError) AllErrors() []error { return m } + +// PlaintextDataValidationError is the validation error returned by +// PlaintextData.Validate if the designated constraints aren't met. +type PlaintextDataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PlaintextDataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PlaintextDataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PlaintextDataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PlaintextDataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PlaintextDataValidationError) ErrorName() string { return "PlaintextDataValidationError" } + +// Error satisfies the builtin error interface +func (e PlaintextDataValidationError) 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 %sPlaintextData.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PlaintextDataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PlaintextDataValidationError{} + +// Validate checks the field values on EncryptionConfig 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 *EncryptionConfig) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on EncryptionConfig 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 +// EncryptionConfigMultiError, or nil if none found. +func (m *EncryptionConfig) ValidateAll() error { + return m.validate(true) +} + +func (m *EncryptionConfig) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetPrincipal()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, EncryptionConfigValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, EncryptionConfigValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPrincipal()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EncryptionConfigValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Provider + + // no validation rules for KeyId + + switch v := m.Config.(type) { + case *EncryptionConfig_JwkPublicKeyConfig: + if v == nil { + err := EncryptionConfigValidationError{ + field: "Config", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetJwkPublicKeyConfig()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, EncryptionConfigValidationError{ + field: "JwkPublicKeyConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, EncryptionConfigValidationError{ + field: "JwkPublicKeyConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetJwkPublicKeyConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EncryptionConfigValidationError{ + field: "JwkPublicKeyConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *EncryptionConfig_AgeRecipientConfig_: + if v == nil { + err := EncryptionConfigValidationError{ + field: "Config", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAgeRecipientConfig()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, EncryptionConfigValidationError{ + field: "AgeRecipientConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, EncryptionConfigValidationError{ + field: "AgeRecipientConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAgeRecipientConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EncryptionConfigValidationError{ + field: "AgeRecipientConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return EncryptionConfigMultiError(errors) + } + + return nil +} + +// EncryptionConfigMultiError is an error wrapping multiple validation errors +// returned by EncryptionConfig.ValidateAll() if the designated constraints +// aren't met. +type EncryptionConfigMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m EncryptionConfigMultiError) 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 EncryptionConfigMultiError) AllErrors() []error { return m } + +// EncryptionConfigValidationError is the validation error returned by +// EncryptionConfig.Validate if the designated constraints aren't met. +type EncryptionConfigValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EncryptionConfigValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EncryptionConfigValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EncryptionConfigValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EncryptionConfigValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EncryptionConfigValidationError) ErrorName() string { return "EncryptionConfigValidationError" } + +// Error satisfies the builtin error interface +func (e EncryptionConfigValidationError) 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 %sEncryptionConfig.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EncryptionConfigValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EncryptionConfigValidationError{} + +// Validate checks the field values on ResourceId 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 *ResourceId) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ResourceId 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 ResourceIdMultiError, or +// nil if none found. +func (m *ResourceId) ValidateAll() error { + return m.validate(true) +} + +func (m *ResourceId) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if l := len(m.GetResourceType()); l < 1 || l > 1024 { + err := ResourceIdValidationError{ + field: "ResourceType", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := len(m.GetResource()); l < 1 || l > 1024 { + err := ResourceIdValidationError{ + field: "Resource", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for BatonResource + + if len(errors) > 0 { + return ResourceIdMultiError(errors) + } + + return nil +} + +// ResourceIdMultiError is an error wrapping multiple validation errors +// returned by ResourceId.ValidateAll() if the designated constraints aren't met. +type ResourceIdMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ResourceIdMultiError) 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 ResourceIdMultiError) AllErrors() []error { return m } + +// ResourceIdValidationError is the validation error returned by +// ResourceId.Validate if the designated constraints aren't met. +type ResourceIdValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourceIdValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourceIdValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourceIdValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourceIdValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourceIdValidationError) ErrorName() string { return "ResourceIdValidationError" } + +// Error satisfies the builtin error interface +func (e ResourceIdValidationError) 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 %sResourceId.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourceIdValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResourceIdValidationError{} + +// Validate checks the field values on Resource 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 *Resource) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Resource 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 ResourceMultiError, or nil +// if none found. +func (m *Resource) ValidateAll() error { + return m.validate(true) +} + +func (m *Resource) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Id", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Id", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: "Id", + 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, ResourceValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + 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 ResourceValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetDisplayName() != "" { + + if l := len(m.GetDisplayName()); l < 1 || l > 1024 { + err := ResourceValidationError{ + field: "DisplayName", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, 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, ResourceValidationError{ + 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, ResourceValidationError{ + 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 ResourceValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if m.GetDescription() != "" { + + if l := len(m.GetDescription()); l < 1 || l > 2048 { + err := ResourceValidationError{ + field: "Description", + reason: "value length must be between 1 and 2048 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + // no validation rules for BatonResource + + if all { + switch v := interface{}(m.GetExternalId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "ExternalId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "ExternalId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetExternalId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: "ExternalId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for CreationSource + + if all { + switch v := interface{}(m.GetProfile()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Profile", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Profile", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetProfile()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: "Profile", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetIcon()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Icon", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Icon", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetIcon()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: "Icon", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetStatus()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: "Status", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCreatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ResourceMultiError(errors) + } + + return nil +} + +// ResourceMultiError is an error wrapping multiple validation errors returned +// by Resource.ValidateAll() if the designated constraints aren't met. +type ResourceMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ResourceMultiError) 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 ResourceMultiError) AllErrors() []error { return m } + +// ResourceValidationError is the validation error returned by +// Resource.Validate if the designated constraints aren't met. +type ResourceValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourceValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourceValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourceValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourceValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourceValidationError) ErrorName() string { return "ResourceValidationError" } + +// Error satisfies the builtin error interface +func (e ResourceValidationError) 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 %sResource.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourceValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResourceValidationError{} + +// Validate checks the field values on Status 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 *Status) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Status 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 StatusMultiError, or nil if none found. +func (m *Status) ValidateAll() error { + return m.validate(true) +} + +func (m *Status) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := Status_ResourceStatus_name[int32(m.GetStatus())]; !ok { + err := StatusValidationError{ + field: "Status", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetDetails() != "" { + + if l := len(m.GetDetails()); l < 1 || l > 1024 { + err := StatusValidationError{ + field: "Details", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if len(errors) > 0 { + return StatusMultiError(errors) + } + + return nil +} + +// StatusMultiError is an error wrapping multiple validation errors returned by +// Status.ValidateAll() if the designated constraints aren't met. +type StatusMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StatusMultiError) 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 StatusMultiError) AllErrors() []error { return m } + +// StatusValidationError is the validation error returned by Status.Validate if +// the designated constraints aren't met. +type StatusValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StatusValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StatusValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StatusValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StatusValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StatusValidationError) ErrorName() string { return "StatusValidationError" } + +// Error satisfies the builtin error interface +func (e StatusValidationError) 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 %sStatus.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StatusValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StatusValidationError{} + +// Validate checks the field values on ResourcesServiceListResourcesRequest +// 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 *ResourcesServiceListResourcesRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ResourcesServiceListResourcesRequest +// 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 +// ResourcesServiceListResourcesRequestMultiError, or nil if none found. +func (m *ResourcesServiceListResourcesRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ResourcesServiceListResourcesRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if l := len(m.GetResourceTypeId()); l < 1 || l > 1024 { + err := ResourcesServiceListResourcesRequestValidationError{ + field: "ResourceTypeId", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetParentResourceId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourcesServiceListResourcesRequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourcesServiceListResourcesRequestValidationError{ + 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 ResourcesServiceListResourcesRequestValidationError{ + field: "ParentResourceId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetPageSize() != 0 { + + if m.GetPageSize() > 250 { + err := ResourcesServiceListResourcesRequestValidationError{ + field: "PageSize", + reason: "value must be less than or equal to 250", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if m.GetPageToken() != "" { + + if l := len(m.GetPageToken()); l < 1 || l > 1048576 { + err := ResourcesServiceListResourcesRequestValidationError{ + field: "PageToken", + reason: "value length must be between 1 and 1048576 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, 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, ResourcesServiceListResourcesRequestValidationError{ + 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, ResourcesServiceListResourcesRequestValidationError{ + 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 ResourcesServiceListResourcesRequestValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if m.GetActiveSyncId() != "" { + + if l := len(m.GetActiveSyncId()); l < 1 || l > 1024 { + err := ResourcesServiceListResourcesRequestValidationError{ + field: "ActiveSyncId", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + // no validation rules for Trait + + if len(errors) > 0 { + return ResourcesServiceListResourcesRequestMultiError(errors) + } + + return nil +} + +// ResourcesServiceListResourcesRequestMultiError is an error wrapping multiple +// validation errors returned by +// ResourcesServiceListResourcesRequest.ValidateAll() if the designated +// constraints aren't met. +type ResourcesServiceListResourcesRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ResourcesServiceListResourcesRequestMultiError) 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 ResourcesServiceListResourcesRequestMultiError) AllErrors() []error { return m } + +// ResourcesServiceListResourcesRequestValidationError is the validation error +// returned by ResourcesServiceListResourcesRequest.Validate if the designated +// constraints aren't met. +type ResourcesServiceListResourcesRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourcesServiceListResourcesRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourcesServiceListResourcesRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourcesServiceListResourcesRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourcesServiceListResourcesRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourcesServiceListResourcesRequestValidationError) ErrorName() string { + return "ResourcesServiceListResourcesRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ResourcesServiceListResourcesRequestValidationError) 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 %sResourcesServiceListResourcesRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourcesServiceListResourcesRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ResourcesServiceListResourcesRequestValidationError{} + +// Validate checks the field values on ResourcesServiceListResourcesResponse +// 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 *ResourcesServiceListResourcesResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Resource 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 ResourceMultiError, or nil -// if none found. -func (m *Resource) ValidateAll() error { +// ValidateAll checks the field values on ResourcesServiceListResourcesResponse +// 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 +// ResourcesServiceListResourcesResponseMultiError, or nil if none found. +func (m *ResourcesServiceListResourcesResponse) ValidateAll() error { return m.validate(true) } -func (m *Resource) validate(all bool) error { +func (m *ResourcesServiceListResourcesResponse) validate(all bool) error { if m == nil { return nil } var errors []error - if all { - switch v := interface{}(m.GetId()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "Id", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "Id", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetId()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ResourceValidationError{ - field: "Id", - reason: "embedded message failed validation", - cause: err, - } - } - } + for idx, item := range m.GetList() { + _, _ = idx, item - if all { - switch v := interface{}(m.GetParentResourceId()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "ParentResourceId", - reason: "embedded message failed validation", - cause: err, - }) + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourcesServiceListResourcesResponseValidationError{ + 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, ResourcesServiceListResourcesResponseValidationError{ + field: fmt.Sprintf("List[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } } - case interface{ Validate() error }: + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "ParentResourceId", + return ResourcesServiceListResourcesResponseValidationError{ + field: fmt.Sprintf("List[%v]", idx), 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 ResourceValidationError{ - field: "ParentResourceId", - reason: "embedded message failed validation", - cause: err, + } } } + } - if m.GetDisplayName() != "" { + if m.GetNextPageToken() != "" { - if l := len(m.GetDisplayName()); l < 1 || l > 1024 { - err := ResourceValidationError{ - field: "DisplayName", - reason: "value length must be between 1 and 1024 bytes, inclusive", + if l := len(m.GetNextPageToken()); l < 1 || l > 1048576 { + err := ResourcesServiceListResourcesResponseValidationError{ + field: "NextPageToken", + reason: "value length must be between 1 and 1048576 bytes, inclusive", } if !all { return err @@ -3959,7 +5530,7 @@ func (m *Resource) validate(all bool) error { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ + errors = append(errors, ResourcesServiceListResourcesResponseValidationError{ field: fmt.Sprintf("Annotations[%v]", idx), reason: "embedded message failed validation", cause: err, @@ -3967,7 +5538,7 @@ func (m *Resource) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, ResourceValidationError{ + errors = append(errors, ResourcesServiceListResourcesResponseValidationError{ field: fmt.Sprintf("Annotations[%v]", idx), reason: "embedded message failed validation", cause: err, @@ -3976,7 +5547,7 @@ func (m *Resource) validate(all bool) error { } } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return ResourceValidationError{ + return ResourcesServiceListResourcesResponseValidationError{ field: fmt.Sprintf("Annotations[%v]", idx), reason: "embedded message failed validation", cause: err, @@ -3986,106 +5557,135 @@ func (m *Resource) validate(all bool) error { } - if m.GetDescription() != "" { + if len(errors) > 0 { + return ResourcesServiceListResourcesResponseMultiError(errors) + } - if l := len(m.GetDescription()); l < 1 || l > 2048 { - err := ResourceValidationError{ - field: "Description", - reason: "value length must be between 1 and 2048 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } + return nil +} + +// ResourcesServiceListResourcesResponseMultiError is an error wrapping +// multiple validation errors returned by +// ResourcesServiceListResourcesResponse.ValidateAll() if the designated +// constraints aren't met. +type ResourcesServiceListResourcesResponseMultiError []error +// Error returns a concatenation of all the error messages it wraps. +func (m ResourcesServiceListResourcesResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) } + return strings.Join(msgs, "; ") +} - // no validation rules for BatonResource +// AllErrors returns a list of validation violation errors. +func (m ResourcesServiceListResourcesResponseMultiError) AllErrors() []error { return m } - if all { - switch v := interface{}(m.GetExternalId()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "ExternalId", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "ExternalId", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExternalId()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ResourceValidationError{ - field: "ExternalId", - reason: "embedded message failed validation", - cause: err, - } - } +// ResourcesServiceListResourcesResponseValidationError is the validation error +// returned by ResourcesServiceListResourcesResponse.Validate if the +// designated constraints aren't met. +type ResourcesServiceListResourcesResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ResourcesServiceListResourcesResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ResourcesServiceListResourcesResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ResourcesServiceListResourcesResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ResourcesServiceListResourcesResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ResourcesServiceListResourcesResponseValidationError) ErrorName() string { + return "ResourcesServiceListResourcesResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ResourcesServiceListResourcesResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) } - // no validation rules for CreationSource + key := "" + if e.key { + key = "key for " + } - if all { - switch v := interface{}(m.GetProfile()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "Profile", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "Profile", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProfile()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ResourceValidationError{ - field: "Profile", - reason: "embedded message failed validation", - cause: err, - } - } + return fmt.Sprintf( + "invalid %sResourcesServiceListResourcesResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ResourcesServiceListResourcesResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + 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.GetIcon()).(type) { + switch v := interface{}(m.GetResourceId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "Icon", + 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, ResourceValidationError{ - field: "Icon", + errors = append(errors, ResourceGetterServiceGetResourceRequestValidationError{ + field: "ResourceId", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetIcon()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetResourceId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return ResourceValidationError{ - field: "Icon", + return ResourceGetterServiceGetResourceRequestValidationError{ + field: "ResourceId", reason: "embedded message failed validation", cause: err, } @@ -4093,76 +5693,98 @@ func (m *Resource) validate(all bool) error { } if all { - switch v := interface{}(m.GetStatus()).(type) { + switch v := interface{}(m.GetParentResourceId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "Status", + 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, ResourceValidationError{ - field: "Status", + errors = append(errors, ResourceGetterServiceGetResourceRequestValidationError{ + field: "ParentResourceId", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetParentResourceId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return ResourceValidationError{ - field: "Status", + return ResourceGetterServiceGetResourceRequestValidationError{ + field: "ParentResourceId", reason: "embedded message failed validation", cause: err, } } } - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "CreatedAt", - 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, + }) + } } - case interface{ Validate() error }: + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - errors = append(errors, ResourceValidationError{ - field: "CreatedAt", + return ResourceGetterServiceGetResourceRequestValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), reason: "embedded message failed validation", cause: err, - }) + } } } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ResourceValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, + + } + + if m.GetActiveSyncId() != "" { + + if l := len(m.GetActiveSyncId()); l < 1 || l > 1024 { + err := ResourceGetterServiceGetResourceRequestValidationError{ + field: "ActiveSyncId", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err } + errors = append(errors, err) } + } if len(errors) > 0 { - return ResourceMultiError(errors) + return ResourceGetterServiceGetResourceRequestMultiError(errors) } return nil } -// ResourceMultiError is an error wrapping multiple validation errors returned -// by Resource.ValidateAll() if the designated constraints aren't met. -type ResourceMultiError []error +// 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 ResourceMultiError) Error() string { +func (m ResourceGetterServiceGetResourceRequestMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -4171,11 +5793,12 @@ func (m ResourceMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ResourceMultiError) AllErrors() []error { return m } +func (m ResourceGetterServiceGetResourceRequestMultiError) AllErrors() []error { return m } -// ResourceValidationError is the validation error returned by -// Resource.Validate if the designated constraints aren't met. -type ResourceValidationError struct { +// 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 @@ -4183,22 +5806,24 @@ type ResourceValidationError struct { } // Field function returns field value. -func (e ResourceValidationError) Field() string { return e.field } +func (e ResourceGetterServiceGetResourceRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ResourceValidationError) Reason() string { return e.reason } +func (e ResourceGetterServiceGetResourceRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ResourceValidationError) Cause() error { return e.cause } +func (e ResourceGetterServiceGetResourceRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ResourceValidationError) Key() bool { return e.key } +func (e ResourceGetterServiceGetResourceRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ResourceValidationError) ErrorName() string { return "ResourceValidationError" } +func (e ResourceGetterServiceGetResourceRequestValidationError) ErrorName() string { + return "ResourceGetterServiceGetResourceRequestValidationError" +} // Error satisfies the builtin error interface -func (e ResourceValidationError) Error() string { +func (e ResourceGetterServiceGetResourceRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -4210,14 +5835,14 @@ func (e ResourceValidationError) Error() string { } return fmt.Sprintf( - "invalid %sResource.%s: %s%s", + "invalid %sResourceGetterServiceGetResourceRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ResourceValidationError{} +var _ error = ResourceGetterServiceGetResourceRequestValidationError{} var _ interface { Field() string @@ -4225,68 +5850,110 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ResourceValidationError{} +} = ResourceGetterServiceGetResourceRequestValidationError{} -// Validate checks the field values on Status 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 *Status) Validate() error { +// 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 Status with the rules defined in the +// 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 StatusMultiError, or nil if none found. -func (m *Status) ValidateAll() error { +// a list of violation errors wrapped in +// ResourceGetterServiceGetResourceResponseMultiError, or nil if none found. +func (m *ResourceGetterServiceGetResourceResponse) ValidateAll() error { return m.validate(true) } -func (m *Status) validate(all bool) error { +func (m *ResourceGetterServiceGetResourceResponse) validate(all bool) error { if m == nil { return nil } var errors []error - if _, ok := Status_ResourceStatus_name[int32(m.GetStatus())]; !ok { - err := StatusValidationError{ - field: "Status", - reason: "value must be one of the defined enum values", + 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, + }) + } } - if !all { - return 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, + } } - errors = append(errors, err) } - if m.GetDetails() != "" { + for idx, item := range m.GetAnnotations() { + _, _ = idx, item - if l := len(m.GetDetails()); l < 1 || l > 1024 { - err := StatusValidationError{ - field: "Details", - reason: "value length must be between 1 and 1024 bytes, inclusive", + 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, + }) + } } - if !all { - return 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, + } } - errors = append(errors, err) } } if len(errors) > 0 { - return StatusMultiError(errors) + return ResourceGetterServiceGetResourceResponseMultiError(errors) } return nil } -// StatusMultiError is an error wrapping multiple validation errors returned by -// Status.ValidateAll() if the designated constraints aren't met. -type StatusMultiError []error +// 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 StatusMultiError) Error() string { +func (m ResourceGetterServiceGetResourceResponseMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -4295,11 +5962,12 @@ func (m StatusMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m StatusMultiError) AllErrors() []error { return m } +func (m ResourceGetterServiceGetResourceResponseMultiError) AllErrors() []error { return m } -// StatusValidationError is the validation error returned by Status.Validate if -// the designated constraints aren't met. -type StatusValidationError struct { +// 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 @@ -4307,22 +5975,24 @@ type StatusValidationError struct { } // Field function returns field value. -func (e StatusValidationError) Field() string { return e.field } +func (e ResourceGetterServiceGetResourceResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e StatusValidationError) Reason() string { return e.reason } +func (e ResourceGetterServiceGetResourceResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e StatusValidationError) Cause() error { return e.cause } +func (e ResourceGetterServiceGetResourceResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e StatusValidationError) Key() bool { return e.key } +func (e ResourceGetterServiceGetResourceResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e StatusValidationError) ErrorName() string { return "StatusValidationError" } +func (e ResourceGetterServiceGetResourceResponseValidationError) ErrorName() string { + return "ResourceGetterServiceGetResourceResponseValidationError" +} // Error satisfies the builtin error interface -func (e StatusValidationError) Error() string { +func (e ResourceGetterServiceGetResourceResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -4334,14 +6004,14 @@ func (e StatusValidationError) Error() string { } return fmt.Sprintf( - "invalid %sStatus.%s: %s%s", + "invalid %sResourceGetterServiceGetResourceResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = StatusValidationError{} +var _ error = ResourceGetterServiceGetResourceResponseValidationError{} var _ interface { Field() string @@ -4349,167 +6019,49 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = StatusValidationError{} +} = ResourceGetterServiceGetResourceResponseValidationError{} -// Validate checks the field values on ResourcesServiceListResourcesRequest -// 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 *ResourcesServiceListResourcesRequest) Validate() error { +// 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. +func (m *ExternalId) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on ResourcesServiceListResourcesRequest -// 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 -// ResourcesServiceListResourcesRequestMultiError, or nil if none found. -func (m *ResourcesServiceListResourcesRequest) ValidateAll() error { +// ValidateAll checks the field values on ExternalId 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 ExternalIdMultiError, or +// nil if none found. +func (m *ExternalId) ValidateAll() error { return m.validate(true) } -func (m *ResourcesServiceListResourcesRequest) validate(all bool) error { +func (m *ExternalId) validate(all bool) error { if m == nil { return nil } var errors []error - if l := len(m.GetResourceTypeId()); l < 1 || l > 1024 { - err := ResourcesServiceListResourcesRequestValidationError{ - field: "ResourceTypeId", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetParentResourceId()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourcesServiceListResourcesRequestValidationError{ - field: "ParentResourceId", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ResourcesServiceListResourcesRequestValidationError{ - 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 ResourcesServiceListResourcesRequestValidationError{ - field: "ParentResourceId", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.GetPageSize() != 0 { - - if m.GetPageSize() > 250 { - err := ResourcesServiceListResourcesRequestValidationError{ - field: "PageSize", - reason: "value must be less than or equal to 250", - } - if !all { - return err - } - errors = append(errors, err) - } - - } - - if m.GetPageToken() != "" { - - if l := len(m.GetPageToken()); l < 1 || l > 1048576 { - err := ResourcesServiceListResourcesRequestValidationError{ - field: "PageToken", - reason: "value length must be between 1 and 1048576 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, 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, ResourcesServiceListResourcesRequestValidationError{ - 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, ResourcesServiceListResourcesRequestValidationError{ - 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 ResourcesServiceListResourcesRequestValidationError{ - field: fmt.Sprintf("Annotations[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if m.GetActiveSyncId() != "" { - - if l := len(m.GetActiveSyncId()); l < 1 || l > 1024 { - err := ResourcesServiceListResourcesRequestValidationError{ - field: "ActiveSyncId", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for Id - } + // no validation rules for Link - // no validation rules for Trait + // no validation rules for Description if len(errors) > 0 { - return ResourcesServiceListResourcesRequestMultiError(errors) + return ExternalIdMultiError(errors) } return nil } -// ResourcesServiceListResourcesRequestMultiError is an error wrapping multiple -// validation errors returned by -// ResourcesServiceListResourcesRequest.ValidateAll() if the designated -// constraints aren't met. -type ResourcesServiceListResourcesRequestMultiError []error +// ExternalIdMultiError is an error wrapping multiple validation errors +// returned by ExternalId.ValidateAll() if the designated constraints aren't met. +type ExternalIdMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ResourcesServiceListResourcesRequestMultiError) Error() string { +func (m ExternalIdMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -4518,12 +6070,11 @@ func (m ResourcesServiceListResourcesRequestMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ResourcesServiceListResourcesRequestMultiError) AllErrors() []error { return m } +func (m ExternalIdMultiError) AllErrors() []error { return m } -// ResourcesServiceListResourcesRequestValidationError is the validation error -// returned by ResourcesServiceListResourcesRequest.Validate if the designated -// constraints aren't met. -type ResourcesServiceListResourcesRequestValidationError struct { +// ExternalIdValidationError is the validation error returned by +// ExternalId.Validate if the designated constraints aren't met. +type ExternalIdValidationError struct { field string reason string cause error @@ -4531,24 +6082,22 @@ type ResourcesServiceListResourcesRequestValidationError struct { } // Field function returns field value. -func (e ResourcesServiceListResourcesRequestValidationError) Field() string { return e.field } +func (e ExternalIdValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ResourcesServiceListResourcesRequestValidationError) Reason() string { return e.reason } +func (e ExternalIdValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ResourcesServiceListResourcesRequestValidationError) Cause() error { return e.cause } +func (e ExternalIdValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ResourcesServiceListResourcesRequestValidationError) Key() bool { return e.key } +func (e ExternalIdValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ResourcesServiceListResourcesRequestValidationError) ErrorName() string { - return "ResourcesServiceListResourcesRequestValidationError" -} +func (e ExternalIdValidationError) ErrorName() string { return "ExternalIdValidationError" } // Error satisfies the builtin error interface -func (e ResourcesServiceListResourcesRequestValidationError) Error() string { +func (e ExternalIdValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -4560,14 +6109,14 @@ func (e ResourcesServiceListResourcesRequestValidationError) Error() string { } return fmt.Sprintf( - "invalid %sResourcesServiceListResourcesRequest.%s: %s%s", + "invalid %sExternalId.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ResourcesServiceListResourcesRequestValidationError{} +var _ error = ExternalIdValidationError{} var _ interface { Field() string @@ -4575,129 +6124,108 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ResourcesServiceListResourcesRequestValidationError{} +} = ExternalIdValidationError{} -// Validate checks the field values on ResourcesServiceListResourcesResponse -// 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 *ResourcesServiceListResourcesResponse) Validate() error { +// Validate checks the field values on AccountInfo_Email 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 *AccountInfo_Email) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on ResourcesServiceListResourcesResponse -// 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 -// ResourcesServiceListResourcesResponseMultiError, or nil if none found. -func (m *ResourcesServiceListResourcesResponse) ValidateAll() error { +// ValidateAll checks the field values on AccountInfo_Email 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 +// AccountInfo_EmailMultiError, or nil if none found. +func (m *AccountInfo_Email) ValidateAll() error { return m.validate(true) } -func (m *ResourcesServiceListResourcesResponse) validate(all bool) error { +func (m *AccountInfo_Email) 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, ResourcesServiceListResourcesResponseValidationError{ - 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, ResourcesServiceListResourcesResponseValidationError{ - 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 ResourcesServiceListResourcesResponseValidationError{ - field: fmt.Sprintf("List[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } + if err := m._validateEmail(m.GetAddress()); err != nil { + err = AccountInfo_EmailValidationError{ + field: "Address", + reason: "value must be a valid email address", + cause: err, + } + if !all { + return err } + errors = append(errors, err) + } + // no validation rules for IsPrimary + + if len(errors) > 0 { + return AccountInfo_EmailMultiError(errors) } - if m.GetNextPageToken() != "" { + return nil +} - if l := len(m.GetNextPageToken()); l < 1 || l > 1048576 { - err := ResourcesServiceListResourcesResponseValidationError{ - field: "NextPageToken", - reason: "value length must be between 1 and 1048576 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } +func (m *AccountInfo_Email) _validateHostname(host string) error { + s := strings.ToLower(strings.TrimSuffix(host, ".")) + if len(host) > 253 { + return errors.New("hostname cannot exceed 253 characters") } - for idx, item := range m.GetAnnotations() { - _, _ = idx, item + for _, part := range strings.Split(s, ".") { + if l := len(part); l == 0 || l > 63 { + return errors.New("hostname part must be non-empty and cannot exceed 63 characters") + } - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourcesServiceListResourcesResponseValidationError{ - 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, ResourcesServiceListResourcesResponseValidationError{ - 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 ResourcesServiceListResourcesResponseValidationError{ - field: fmt.Sprintf("Annotations[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } + if part[0] == '-' { + return errors.New("hostname parts cannot begin with hyphens") + } + + if part[len(part)-1] == '-' { + return errors.New("hostname parts cannot end with hyphens") + } + + for _, r := range part { + if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' { + return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r)) } } + } + + return nil +} +func (m *AccountInfo_Email) _validateEmail(addr string) error { + a, err := mail.ParseAddress(addr) + if err != nil { + return err } + addr = a.Address - if len(errors) > 0 { - return ResourcesServiceListResourcesResponseMultiError(errors) + if len(addr) > 254 { + return errors.New("email addresses cannot exceed 254 characters") } - return nil + parts := strings.SplitN(addr, "@", 2) + + if len(parts[0]) > 64 { + return errors.New("email address local phrase cannot exceed 64 characters") + } + + return m._validateHostname(parts[1]) } -// ResourcesServiceListResourcesResponseMultiError is an error wrapping -// multiple validation errors returned by -// ResourcesServiceListResourcesResponse.ValidateAll() if the designated -// constraints aren't met. -type ResourcesServiceListResourcesResponseMultiError []error +// AccountInfo_EmailMultiError is an error wrapping multiple validation errors +// returned by AccountInfo_Email.ValidateAll() if the designated constraints +// aren't met. +type AccountInfo_EmailMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ResourcesServiceListResourcesResponseMultiError) Error() string { +func (m AccountInfo_EmailMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -4706,12 +6234,11 @@ func (m ResourcesServiceListResourcesResponseMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ResourcesServiceListResourcesResponseMultiError) AllErrors() []error { return m } +func (m AccountInfo_EmailMultiError) AllErrors() []error { return m } -// ResourcesServiceListResourcesResponseValidationError is the validation error -// returned by ResourcesServiceListResourcesResponse.Validate if the -// designated constraints aren't met. -type ResourcesServiceListResourcesResponseValidationError struct { +// AccountInfo_EmailValidationError is the validation error returned by +// AccountInfo_Email.Validate if the designated constraints aren't met. +type AccountInfo_EmailValidationError struct { field string reason string cause error @@ -4719,24 +6246,24 @@ type ResourcesServiceListResourcesResponseValidationError struct { } // Field function returns field value. -func (e ResourcesServiceListResourcesResponseValidationError) Field() string { return e.field } +func (e AccountInfo_EmailValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ResourcesServiceListResourcesResponseValidationError) Reason() string { return e.reason } +func (e AccountInfo_EmailValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ResourcesServiceListResourcesResponseValidationError) Cause() error { return e.cause } +func (e AccountInfo_EmailValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ResourcesServiceListResourcesResponseValidationError) Key() bool { return e.key } +func (e AccountInfo_EmailValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ResourcesServiceListResourcesResponseValidationError) ErrorName() string { - return "ResourcesServiceListResourcesResponseValidationError" +func (e AccountInfo_EmailValidationError) ErrorName() string { + return "AccountInfo_EmailValidationError" } // Error satisfies the builtin error interface -func (e ResourcesServiceListResourcesResponseValidationError) Error() string { +func (e AccountInfo_EmailValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -4748,14 +6275,14 @@ func (e ResourcesServiceListResourcesResponseValidationError) Error() string { } return fmt.Sprintf( - "invalid %sResourcesServiceListResourcesResponse.%s: %s%s", + "invalid %sAccountInfo_Email.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ResourcesServiceListResourcesResponseValidationError{} +var _ error = AccountInfo_EmailValidationError{} var _ interface { Field() string @@ -4763,154 +6290,44 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ResourcesServiceListResourcesResponseValidationError{} +} = AccountInfo_EmailValidationError{} -// 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 { +// Validate checks the field values on CredentialIssueOptions_ApiKey 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 *CredentialIssueOptions_ApiKey) 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 { +// ValidateAll checks the field values on CredentialIssueOptions_ApiKey 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 +// CredentialIssueOptions_ApiKeyMultiError, or nil if none found. +func (m *CredentialIssueOptions_ApiKey) 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 m.GetActiveSyncId() != "" { - - if l := len(m.GetActiveSyncId()); l < 1 || l > 1024 { - err := ResourceGetterServiceGetResourceRequestValidationError{ - field: "ActiveSyncId", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - +func (m *CredentialIssueOptions_ApiKey) validate(all bool) error { + if m == nil { + return nil } + var errors []error + if len(errors) > 0 { - return ResourceGetterServiceGetResourceRequestMultiError(errors) + return CredentialIssueOptions_ApiKeyMultiError(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 +// CredentialIssueOptions_ApiKeyMultiError is an error wrapping multiple +// validation errors returned by CredentialIssueOptions_ApiKey.ValidateAll() +// if the designated constraints aren't met. +type CredentialIssueOptions_ApiKeyMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ResourceGetterServiceGetResourceRequestMultiError) Error() string { +func (m CredentialIssueOptions_ApiKeyMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -4919,12 +6336,12 @@ func (m ResourceGetterServiceGetResourceRequestMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ResourceGetterServiceGetResourceRequestMultiError) AllErrors() []error { return m } +func (m CredentialIssueOptions_ApiKeyMultiError) AllErrors() []error { return m } -// ResourceGetterServiceGetResourceRequestValidationError is the validation -// error returned by ResourceGetterServiceGetResourceRequest.Validate if the -// designated constraints aren't met. -type ResourceGetterServiceGetResourceRequestValidationError struct { +// CredentialIssueOptions_ApiKeyValidationError is the validation error +// returned by CredentialIssueOptions_ApiKey.Validate if the designated +// constraints aren't met. +type CredentialIssueOptions_ApiKeyValidationError struct { field string reason string cause error @@ -4932,24 +6349,24 @@ type ResourceGetterServiceGetResourceRequestValidationError struct { } // Field function returns field value. -func (e ResourceGetterServiceGetResourceRequestValidationError) Field() string { return e.field } +func (e CredentialIssueOptions_ApiKeyValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ResourceGetterServiceGetResourceRequestValidationError) Reason() string { return e.reason } +func (e CredentialIssueOptions_ApiKeyValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ResourceGetterServiceGetResourceRequestValidationError) Cause() error { return e.cause } +func (e CredentialIssueOptions_ApiKeyValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ResourceGetterServiceGetResourceRequestValidationError) Key() bool { return e.key } +func (e CredentialIssueOptions_ApiKeyValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ResourceGetterServiceGetResourceRequestValidationError) ErrorName() string { - return "ResourceGetterServiceGetResourceRequestValidationError" +func (e CredentialIssueOptions_ApiKeyValidationError) ErrorName() string { + return "CredentialIssueOptions_ApiKeyValidationError" } // Error satisfies the builtin error interface -func (e ResourceGetterServiceGetResourceRequestValidationError) Error() string { +func (e CredentialIssueOptions_ApiKeyValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -4961,14 +6378,14 @@ func (e ResourceGetterServiceGetResourceRequestValidationError) Error() string { } return fmt.Sprintf( - "invalid %sResourceGetterServiceGetResourceRequest.%s: %s%s", + "invalid %sCredentialIssueOptions_ApiKey.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ResourceGetterServiceGetResourceRequestValidationError{} +var _ error = CredentialIssueOptions_ApiKeyValidationError{} var _ interface { Field() string @@ -4976,26 +6393,24 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ResourceGetterServiceGetResourceRequestValidationError{} +} = CredentialIssueOptions_ApiKeyValidationError{} -// 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 { +// Validate checks the field values on CredentialIssueOptions_Keypair 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 *CredentialIssueOptions_Keypair) 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 { +// ValidateAll checks the field values on CredentialIssueOptions_Keypair 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 +// CredentialIssueOptions_KeypairMultiError, or nil if none found. +func (m *CredentialIssueOptions_Keypair) ValidateAll() error { return m.validate(true) } -func (m *ResourceGetterServiceGetResourceResponse) validate(all bool) error { +func (m *CredentialIssueOptions_Keypair) validate(all bool) error { if m == nil { return nil } @@ -5003,83 +6418,48 @@ func (m *ResourceGetterServiceGetResourceResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResource()).(type) { + switch v := interface{}(m.GetProfile()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, ResourceGetterServiceGetResourceResponseValidationError{ - field: "Resource", + errors = append(errors, CredentialIssueOptions_KeypairValidationError{ + field: "Profile", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, ResourceGetterServiceGetResourceResponseValidationError{ - field: "Resource", + errors = append(errors, CredentialIssueOptions_KeypairValidationError{ + field: "Profile", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetProfile()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return ResourceGetterServiceGetResourceResponseValidationError{ - field: "Resource", + return CredentialIssueOptions_KeypairValidationError{ + field: "Profile", 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 CredentialIssueOptions_KeypairMultiError(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 +// CredentialIssueOptions_KeypairMultiError is an error wrapping multiple +// validation errors returned by CredentialIssueOptions_Keypair.ValidateAll() +// if the designated constraints aren't met. +type CredentialIssueOptions_KeypairMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ResourceGetterServiceGetResourceResponseMultiError) Error() string { +func (m CredentialIssueOptions_KeypairMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -5088,12 +6468,12 @@ func (m ResourceGetterServiceGetResourceResponseMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ResourceGetterServiceGetResourceResponseMultiError) AllErrors() []error { return m } +func (m CredentialIssueOptions_KeypairMultiError) AllErrors() []error { return m } -// ResourceGetterServiceGetResourceResponseValidationError is the validation -// error returned by ResourceGetterServiceGetResourceResponse.Validate if the -// designated constraints aren't met. -type ResourceGetterServiceGetResourceResponseValidationError struct { +// CredentialIssueOptions_KeypairValidationError is the validation error +// returned by CredentialIssueOptions_Keypair.Validate if the designated +// constraints aren't met. +type CredentialIssueOptions_KeypairValidationError struct { field string reason string cause error @@ -5101,24 +6481,24 @@ type ResourceGetterServiceGetResourceResponseValidationError struct { } // Field function returns field value. -func (e ResourceGetterServiceGetResourceResponseValidationError) Field() string { return e.field } +func (e CredentialIssueOptions_KeypairValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ResourceGetterServiceGetResourceResponseValidationError) Reason() string { return e.reason } +func (e CredentialIssueOptions_KeypairValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ResourceGetterServiceGetResourceResponseValidationError) Cause() error { return e.cause } +func (e CredentialIssueOptions_KeypairValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ResourceGetterServiceGetResourceResponseValidationError) Key() bool { return e.key } +func (e CredentialIssueOptions_KeypairValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ResourceGetterServiceGetResourceResponseValidationError) ErrorName() string { - return "ResourceGetterServiceGetResourceResponseValidationError" +func (e CredentialIssueOptions_KeypairValidationError) ErrorName() string { + return "CredentialIssueOptions_KeypairValidationError" } // Error satisfies the builtin error interface -func (e ResourceGetterServiceGetResourceResponseValidationError) Error() string { +func (e CredentialIssueOptions_KeypairValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -5130,14 +6510,14 @@ func (e ResourceGetterServiceGetResourceResponseValidationError) Error() string } return fmt.Sprintf( - "invalid %sResourceGetterServiceGetResourceResponse.%s: %s%s", + "invalid %sCredentialIssueOptions_Keypair.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ResourceGetterServiceGetResourceResponseValidationError{} +var _ error = CredentialIssueOptions_KeypairValidationError{} var _ interface { Field() string @@ -5145,49 +6525,44 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ResourceGetterServiceGetResourceResponseValidationError{} +} = CredentialIssueOptions_KeypairValidationError{} -// 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. -func (m *ExternalId) Validate() error { +// Validate checks the field values on CredentialIssueOptions_Token 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 *CredentialIssueOptions_Token) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on ExternalId 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 ExternalIdMultiError, or -// nil if none found. -func (m *ExternalId) ValidateAll() error { +// ValidateAll checks the field values on CredentialIssueOptions_Token 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 +// CredentialIssueOptions_TokenMultiError, or nil if none found. +func (m *CredentialIssueOptions_Token) ValidateAll() error { return m.validate(true) } -func (m *ExternalId) validate(all bool) error { +func (m *CredentialIssueOptions_Token) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Id - - // no validation rules for Link - - // no validation rules for Description - if len(errors) > 0 { - return ExternalIdMultiError(errors) + return CredentialIssueOptions_TokenMultiError(errors) } return nil } -// ExternalIdMultiError is an error wrapping multiple validation errors -// returned by ExternalId.ValidateAll() if the designated constraints aren't met. -type ExternalIdMultiError []error +// CredentialIssueOptions_TokenMultiError is an error wrapping multiple +// validation errors returned by CredentialIssueOptions_Token.ValidateAll() if +// the designated constraints aren't met. +type CredentialIssueOptions_TokenMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ExternalIdMultiError) Error() string { +func (m CredentialIssueOptions_TokenMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -5196,11 +6571,12 @@ func (m ExternalIdMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ExternalIdMultiError) AllErrors() []error { return m } +func (m CredentialIssueOptions_TokenMultiError) AllErrors() []error { return m } -// ExternalIdValidationError is the validation error returned by -// ExternalId.Validate if the designated constraints aren't met. -type ExternalIdValidationError struct { +// CredentialIssueOptions_TokenValidationError is the validation error returned +// by CredentialIssueOptions_Token.Validate if the designated constraints +// aren't met. +type CredentialIssueOptions_TokenValidationError struct { field string reason string cause error @@ -5208,22 +6584,24 @@ type ExternalIdValidationError struct { } // Field function returns field value. -func (e ExternalIdValidationError) Field() string { return e.field } +func (e CredentialIssueOptions_TokenValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ExternalIdValidationError) Reason() string { return e.reason } +func (e CredentialIssueOptions_TokenValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ExternalIdValidationError) Cause() error { return e.cause } +func (e CredentialIssueOptions_TokenValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ExternalIdValidationError) Key() bool { return e.key } +func (e CredentialIssueOptions_TokenValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ExternalIdValidationError) ErrorName() string { return "ExternalIdValidationError" } +func (e CredentialIssueOptions_TokenValidationError) ErrorName() string { + return "CredentialIssueOptions_TokenValidationError" +} // Error satisfies the builtin error interface -func (e ExternalIdValidationError) Error() string { +func (e CredentialIssueOptions_TokenValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -5235,14 +6613,14 @@ func (e ExternalIdValidationError) Error() string { } return fmt.Sprintf( - "invalid %sExternalId.%s: %s%s", + "invalid %sCredentialIssueOptions_Token.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ExternalIdValidationError{} +var _ error = CredentialIssueOptions_TokenValidationError{} var _ interface { Field() string @@ -5250,108 +6628,46 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ExternalIdValidationError{} +} = CredentialIssueOptions_TokenValidationError{} -// Validate checks the field values on AccountInfo_Email 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 *AccountInfo_Email) Validate() error { +// Validate checks the field values on CredentialIssueOptions_ClientSecret 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 *CredentialIssueOptions_ClientSecret) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on AccountInfo_Email 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 -// AccountInfo_EmailMultiError, or nil if none found. -func (m *AccountInfo_Email) ValidateAll() error { +// ValidateAll checks the field values on CredentialIssueOptions_ClientSecret +// 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 +// CredentialIssueOptions_ClientSecretMultiError, or nil if none found. +func (m *CredentialIssueOptions_ClientSecret) ValidateAll() error { return m.validate(true) } -func (m *AccountInfo_Email) validate(all bool) error { +func (m *CredentialIssueOptions_ClientSecret) validate(all bool) error { if m == nil { return nil } var errors []error - if err := m._validateEmail(m.GetAddress()); err != nil { - err = AccountInfo_EmailValidationError{ - field: "Address", - reason: "value must be a valid email address", - cause: err, - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for IsPrimary - if len(errors) > 0 { - return AccountInfo_EmailMultiError(errors) - } - - return nil -} - -func (m *AccountInfo_Email) _validateHostname(host string) error { - s := strings.ToLower(strings.TrimSuffix(host, ".")) - - if len(host) > 253 { - return errors.New("hostname cannot exceed 253 characters") - } - - for _, part := range strings.Split(s, ".") { - if l := len(part); l == 0 || l > 63 { - return errors.New("hostname part must be non-empty and cannot exceed 63 characters") - } - - if part[0] == '-' { - return errors.New("hostname parts cannot begin with hyphens") - } - - if part[len(part)-1] == '-' { - return errors.New("hostname parts cannot end with hyphens") - } - - for _, r := range part { - if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' { - return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r)) - } - } + return CredentialIssueOptions_ClientSecretMultiError(errors) } return nil } -func (m *AccountInfo_Email) _validateEmail(addr string) error { - a, err := mail.ParseAddress(addr) - if err != nil { - return err - } - addr = a.Address - - if len(addr) > 254 { - return errors.New("email addresses cannot exceed 254 characters") - } - - parts := strings.SplitN(addr, "@", 2) - - if len(parts[0]) > 64 { - return errors.New("email address local phrase cannot exceed 64 characters") - } - - return m._validateHostname(parts[1]) -} - -// AccountInfo_EmailMultiError is an error wrapping multiple validation errors -// returned by AccountInfo_Email.ValidateAll() if the designated constraints -// aren't met. -type AccountInfo_EmailMultiError []error +// CredentialIssueOptions_ClientSecretMultiError is an error wrapping multiple +// validation errors returned by +// CredentialIssueOptions_ClientSecret.ValidateAll() if the designated +// constraints aren't met. +type CredentialIssueOptions_ClientSecretMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m AccountInfo_EmailMultiError) Error() string { +func (m CredentialIssueOptions_ClientSecretMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -5360,11 +6676,12 @@ func (m AccountInfo_EmailMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m AccountInfo_EmailMultiError) AllErrors() []error { return m } +func (m CredentialIssueOptions_ClientSecretMultiError) AllErrors() []error { return m } -// AccountInfo_EmailValidationError is the validation error returned by -// AccountInfo_Email.Validate if the designated constraints aren't met. -type AccountInfo_EmailValidationError struct { +// CredentialIssueOptions_ClientSecretValidationError is the validation error +// returned by CredentialIssueOptions_ClientSecret.Validate if the designated +// constraints aren't met. +type CredentialIssueOptions_ClientSecretValidationError struct { field string reason string cause error @@ -5372,24 +6689,24 @@ type AccountInfo_EmailValidationError struct { } // Field function returns field value. -func (e AccountInfo_EmailValidationError) Field() string { return e.field } +func (e CredentialIssueOptions_ClientSecretValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e AccountInfo_EmailValidationError) Reason() string { return e.reason } +func (e CredentialIssueOptions_ClientSecretValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e AccountInfo_EmailValidationError) Cause() error { return e.cause } +func (e CredentialIssueOptions_ClientSecretValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e AccountInfo_EmailValidationError) Key() bool { return e.key } +func (e CredentialIssueOptions_ClientSecretValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e AccountInfo_EmailValidationError) ErrorName() string { - return "AccountInfo_EmailValidationError" +func (e CredentialIssueOptions_ClientSecretValidationError) ErrorName() string { + return "CredentialIssueOptions_ClientSecretValidationError" } // Error satisfies the builtin error interface -func (e AccountInfo_EmailValidationError) Error() string { +func (e CredentialIssueOptions_ClientSecretValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -5401,14 +6718,14 @@ func (e AccountInfo_EmailValidationError) Error() string { } return fmt.Sprintf( - "invalid %sAccountInfo_Email.%s: %s%s", + "invalid %sCredentialIssueOptions_ClientSecret.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = AccountInfo_EmailValidationError{} +var _ error = CredentialIssueOptions_ClientSecretValidationError{} var _ interface { Field() string @@ -5416,7 +6733,7 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = AccountInfo_EmailValidationError{} +} = CredentialIssueOptions_ClientSecretValidationError{} // Validate checks the field values on CredentialOptions_RandomPassword with // the rules defined in the proto definition for this message. If any rules 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 c1fe9d71..405bf79d 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 @@ -558,6 +558,7 @@ var ResourceDeleterService_ServiceDesc = grpc.ServiceDesc{ const ( CredentialManagerService_RotateCredential_FullMethodName = "/c1.connector.v2.CredentialManagerService/RotateCredential" + CredentialManagerService_IssueCredential_FullMethodName = "/c1.connector.v2.CredentialManagerService/IssueCredential" ) // CredentialManagerServiceClient is the client API for CredentialManagerService service. @@ -565,6 +566,13 @@ 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 CredentialManagerServiceClient interface { RotateCredential(ctx context.Context, in *RotateCredentialRequest, opts ...grpc.CallOption) (*RotateCredentialResponse, error) + // IssueCredential mints a NEW credential (key/token) for an EXISTING + // identity, returning the new secret as a first-class Resource plus the + // encrypted material. Unlike RotateCredential — which replaces the single + // credential on a resource in place — IssueCredential models minting an + // additional, distinct secret, so an identity can hold multiple coexisting + // keys (e.g. cloud service-account key #1 and #2). + IssueCredential(ctx context.Context, in *IssueCredentialRequest, opts ...grpc.CallOption) (*IssueCredentialResponse, error) } type credentialManagerServiceClient struct { @@ -585,11 +593,28 @@ func (c *credentialManagerServiceClient) RotateCredential(ctx context.Context, i return out, nil } +func (c *credentialManagerServiceClient) IssueCredential(ctx context.Context, in *IssueCredentialRequest, opts ...grpc.CallOption) (*IssueCredentialResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IssueCredentialResponse) + err := c.cc.Invoke(ctx, CredentialManagerService_IssueCredential_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // CredentialManagerServiceServer is the server API for CredentialManagerService service. // All implementations should embed UnimplementedCredentialManagerServiceServer // for forward compatibility. type CredentialManagerServiceServer interface { RotateCredential(context.Context, *RotateCredentialRequest) (*RotateCredentialResponse, error) + // IssueCredential mints a NEW credential (key/token) for an EXISTING + // identity, returning the new secret as a first-class Resource plus the + // encrypted material. Unlike RotateCredential — which replaces the single + // credential on a resource in place — IssueCredential models minting an + // additional, distinct secret, so an identity can hold multiple coexisting + // keys (e.g. cloud service-account key #1 and #2). + IssueCredential(context.Context, *IssueCredentialRequest) (*IssueCredentialResponse, error) } // UnimplementedCredentialManagerServiceServer should be embedded to have @@ -602,6 +627,9 @@ type UnimplementedCredentialManagerServiceServer struct{} func (UnimplementedCredentialManagerServiceServer) RotateCredential(context.Context, *RotateCredentialRequest) (*RotateCredentialResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RotateCredential not implemented") } +func (UnimplementedCredentialManagerServiceServer) IssueCredential(context.Context, *IssueCredentialRequest) (*IssueCredentialResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IssueCredential not implemented") +} func (UnimplementedCredentialManagerServiceServer) testEmbeddedByValue() {} // UnsafeCredentialManagerServiceServer may be embedded to opt out of forward compatibility for this service. @@ -640,6 +668,24 @@ func _CredentialManagerService_RotateCredential_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _CredentialManagerService_IssueCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IssueCredentialRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CredentialManagerServiceServer).IssueCredential(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CredentialManagerService_IssueCredential_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CredentialManagerServiceServer).IssueCredential(ctx, req.(*IssueCredentialRequest)) + } + return interceptor(ctx, in, info, handler) +} + // CredentialManagerService_ServiceDesc is the grpc.ServiceDesc for CredentialManagerService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -651,6 +697,10 @@ var CredentialManagerService_ServiceDesc = grpc.ServiceDesc{ MethodName: "RotateCredential", Handler: _CredentialManagerService_RotateCredential_Handler, }, + { + MethodName: "IssueCredential", + Handler: _CredentialManagerService_IssueCredential_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "c1/connector/v2/resource.proto", diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go index e27815bd..d3c999ee 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go @@ -26,6 +26,53 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type CredentialResourceMode int32 + +const ( + CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED CredentialResourceMode = 0 + // The credential is expected to appear in subsequent resource syncs. + CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_DISCOVERABLE CredentialResourceMode = 1 + // The provider cannot enumerate the credential after issuance. The returned + // Resource remains its stable handle for audit and provider deletion/expiry. + CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_VIRTUAL CredentialResourceMode = 2 +) + +// Enum value maps for CredentialResourceMode. +var ( + CredentialResourceMode_name = map[int32]string{ + 0: "CREDENTIAL_RESOURCE_MODE_UNSPECIFIED", + 1: "CREDENTIAL_RESOURCE_MODE_DISCOVERABLE", + 2: "CREDENTIAL_RESOURCE_MODE_VIRTUAL", + } + CredentialResourceMode_value = map[string]int32{ + "CREDENTIAL_RESOURCE_MODE_UNSPECIFIED": 0, + "CREDENTIAL_RESOURCE_MODE_DISCOVERABLE": 1, + "CREDENTIAL_RESOURCE_MODE_VIRTUAL": 2, + } +) + +func (x CredentialResourceMode) Enum() *CredentialResourceMode { + p := new(CredentialResourceMode) + *p = x + return p +} + +func (x CredentialResourceMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CredentialResourceMode) Descriptor() protoreflect.EnumDescriptor { + return file_c1_connector_v2_resource_proto_enumTypes[0].Descriptor() +} + +func (CredentialResourceMode) Type() protoreflect.EnumType { + return &file_c1_connector_v2_resource_proto_enumTypes[0] +} + +func (x CredentialResourceMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + type ResourceType_Trait int32 const ( @@ -89,11 +136,11 @@ func (x ResourceType_Trait) String() string { } func (ResourceType_Trait) Descriptor() protoreflect.EnumDescriptor { - return file_c1_connector_v2_resource_proto_enumTypes[0].Descriptor() + return file_c1_connector_v2_resource_proto_enumTypes[1].Descriptor() } func (ResourceType_Trait) Type() protoreflect.EnumType { - return &file_c1_connector_v2_resource_proto_enumTypes[0] + return &file_c1_connector_v2_resource_proto_enumTypes[1] } func (x ResourceType_Trait) Number() protoreflect.EnumNumber { @@ -133,11 +180,11 @@ func (x Resource_CreationSource) String() string { } func (Resource_CreationSource) Descriptor() protoreflect.EnumDescriptor { - return file_c1_connector_v2_resource_proto_enumTypes[1].Descriptor() + return file_c1_connector_v2_resource_proto_enumTypes[2].Descriptor() } func (Resource_CreationSource) Type() protoreflect.EnumType { - return &file_c1_connector_v2_resource_proto_enumTypes[1] + return &file_c1_connector_v2_resource_proto_enumTypes[2] } func (x Resource_CreationSource) Number() protoreflect.EnumNumber { @@ -180,11 +227,11 @@ func (x Status_ResourceStatus) String() string { } func (Status_ResourceStatus) Descriptor() protoreflect.EnumDescriptor { - return file_c1_connector_v2_resource_proto_enumTypes[2].Descriptor() + return file_c1_connector_v2_resource_proto_enumTypes[3].Descriptor() } func (Status_ResourceStatus) Type() protoreflect.EnumType { - return &file_c1_connector_v2_resource_proto_enumTypes[2] + return &file_c1_connector_v2_resource_proto_enumTypes[3] } func (x Status_ResourceStatus) Number() protoreflect.EnumNumber { @@ -1078,52 +1125,733 @@ func (x *RotateCredentialRequest) ClearResourceId() { x.xxx_hidden_ResourceId = nil } -func (x *RotateCredentialRequest) ClearCredentialOptions() { - x.xxx_hidden_CredentialOptions = nil +func (x *RotateCredentialRequest) ClearCredentialOptions() { + x.xxx_hidden_CredentialOptions = nil +} + +type RotateCredentialRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ResourceId *ResourceId + CredentialOptions *CredentialOptions + EncryptionConfigs []*EncryptionConfig +} + +func (b0 RotateCredentialRequest_builder) Build() *RotateCredentialRequest { + m0 := &RotateCredentialRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_ResourceId = b.ResourceId + x.xxx_hidden_CredentialOptions = b.CredentialOptions + x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs + return m0 +} + +type RotateCredentialResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_EncryptedData *[]*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_data,json=encryptedData,proto3"` + xxx_hidden_ResourceId *ResourceId `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3"` + xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RotateCredentialResponse) Reset() { + *x = RotateCredentialResponse{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RotateCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RotateCredentialResponse) ProtoMessage() {} + +func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RotateCredentialResponse) GetEncryptedData() []*EncryptedData { + if x != nil { + if x.xxx_hidden_EncryptedData != nil { + return *x.xxx_hidden_EncryptedData + } + } + return nil +} + +func (x *RotateCredentialResponse) GetResourceId() *ResourceId { + if x != nil { + return x.xxx_hidden_ResourceId + } + return nil +} + +func (x *RotateCredentialResponse) GetAnnotations() []*anypb.Any { + if x != nil { + if x.xxx_hidden_Annotations != nil { + return *x.xxx_hidden_Annotations + } + } + return nil +} + +func (x *RotateCredentialResponse) SetEncryptedData(v []*EncryptedData) { + x.xxx_hidden_EncryptedData = &v +} + +func (x *RotateCredentialResponse) SetResourceId(v *ResourceId) { + x.xxx_hidden_ResourceId = v +} + +func (x *RotateCredentialResponse) SetAnnotations(v []*anypb.Any) { + x.xxx_hidden_Annotations = &v +} + +func (x *RotateCredentialResponse) HasResourceId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ResourceId != nil +} + +func (x *RotateCredentialResponse) ClearResourceId() { + x.xxx_hidden_ResourceId = nil +} + +type RotateCredentialResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + EncryptedData []*EncryptedData + ResourceId *ResourceId + Annotations []*anypb.Any +} + +func (b0 RotateCredentialResponse_builder) Build() *RotateCredentialResponse { + m0 := &RotateCredentialResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_EncryptedData = &b.EncryptedData + x.xxx_hidden_ResourceId = b.ResourceId + x.xxx_hidden_Annotations = &b.Annotations + return m0 +} + +type IssueCredentialRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_IdentityId *ResourceId `protobuf:"bytes,1,opt,name=identity_id,json=identityId,proto3"` + xxx_hidden_CredentialOptions *CredentialIssueOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3"` + xxx_hidden_EncryptionConfigs *[]*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3"` + xxx_hidden_RequestId string `protobuf:"bytes,4,opt,name=request_id,json=requestId,proto3"` + xxx_hidden_ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IssueCredentialRequest) Reset() { + *x = IssueCredentialRequest{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IssueCredentialRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IssueCredentialRequest) ProtoMessage() {} + +func (x *IssueCredentialRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *IssueCredentialRequest) GetIdentityId() *ResourceId { + if x != nil { + return x.xxx_hidden_IdentityId + } + return nil +} + +func (x *IssueCredentialRequest) GetCredentialOptions() *CredentialIssueOptions { + if x != nil { + return x.xxx_hidden_CredentialOptions + } + return nil +} + +func (x *IssueCredentialRequest) GetEncryptionConfigs() []*EncryptionConfig { + if x != nil { + if x.xxx_hidden_EncryptionConfigs != nil { + return *x.xxx_hidden_EncryptionConfigs + } + } + return nil +} + +func (x *IssueCredentialRequest) GetRequestId() string { + if x != nil { + return x.xxx_hidden_RequestId + } + return "" +} + +func (x *IssueCredentialRequest) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_ExpiresAt + } + return nil +} + +func (x *IssueCredentialRequest) SetIdentityId(v *ResourceId) { + x.xxx_hidden_IdentityId = v +} + +func (x *IssueCredentialRequest) SetCredentialOptions(v *CredentialIssueOptions) { + x.xxx_hidden_CredentialOptions = v +} + +func (x *IssueCredentialRequest) SetEncryptionConfigs(v []*EncryptionConfig) { + x.xxx_hidden_EncryptionConfigs = &v +} + +func (x *IssueCredentialRequest) SetRequestId(v string) { + x.xxx_hidden_RequestId = v +} + +func (x *IssueCredentialRequest) SetExpiresAt(v *timestamppb.Timestamp) { + x.xxx_hidden_ExpiresAt = v +} + +func (x *IssueCredentialRequest) HasIdentityId() bool { + if x == nil { + return false + } + return x.xxx_hidden_IdentityId != nil +} + +func (x *IssueCredentialRequest) HasCredentialOptions() bool { + if x == nil { + return false + } + return x.xxx_hidden_CredentialOptions != nil +} + +func (x *IssueCredentialRequest) HasExpiresAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_ExpiresAt != nil +} + +func (x *IssueCredentialRequest) ClearIdentityId() { + x.xxx_hidden_IdentityId = nil +} + +func (x *IssueCredentialRequest) ClearCredentialOptions() { + x.xxx_hidden_CredentialOptions = nil +} + +func (x *IssueCredentialRequest) ClearExpiresAt() { + x.xxx_hidden_ExpiresAt = nil +} + +type IssueCredentialRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The existing identity (e.g. service account) to mint the credential for. + IdentityId *ResourceId + // What kind of credential to mint (api_key / keypair / token / ...). + // Issuance has its own option type so it cannot accidentally expand account + // creation or password rotation. + CredentialOptions *CredentialIssueOptions + // Public keys the connector encrypts the returned material against. + EncryptionConfigs []*EncryptionConfig + // Stable correlation identifier. This does not by itself guarantee provider + // idempotency; callers must not blindly retry an ambiguous issuance. + RequestId string + // Optional absolute expiry requested by the caller. Absolute time avoids + // extending a credential merely because an approved task waited in queue. + ExpiresAt *timestamppb.Timestamp +} + +func (b0 IssueCredentialRequest_builder) Build() *IssueCredentialRequest { + m0 := &IssueCredentialRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_IdentityId = b.IdentityId + x.xxx_hidden_CredentialOptions = b.CredentialOptions + x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs + x.xxx_hidden_RequestId = b.RequestId + x.xxx_hidden_ExpiresAt = b.ExpiresAt + return m0 +} + +type IssueCredentialResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Secret *Resource `protobuf:"bytes,1,opt,name=secret,proto3"` + xxx_hidden_EncryptedData *[]*EncryptedData `protobuf:"bytes,2,rep,name=encrypted_data,json=encryptedData,proto3"` + xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3"` + xxx_hidden_ResourceMode CredentialResourceMode `protobuf:"varint,4,opt,name=resource_mode,json=resourceMode,proto3,enum=c1.connector.v2.CredentialResourceMode"` + xxx_hidden_RequestId string `protobuf:"bytes,5,opt,name=request_id,json=requestId,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IssueCredentialResponse) Reset() { + *x = IssueCredentialResponse{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IssueCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IssueCredentialResponse) ProtoMessage() {} + +func (x *IssueCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *IssueCredentialResponse) GetSecret() *Resource { + if x != nil { + return x.xxx_hidden_Secret + } + return nil +} + +func (x *IssueCredentialResponse) GetEncryptedData() []*EncryptedData { + if x != nil { + if x.xxx_hidden_EncryptedData != nil { + return *x.xxx_hidden_EncryptedData + } + } + return nil +} + +func (x *IssueCredentialResponse) GetAnnotations() []*anypb.Any { + if x != nil { + if x.xxx_hidden_Annotations != nil { + return *x.xxx_hidden_Annotations + } + } + return nil +} + +func (x *IssueCredentialResponse) GetResourceMode() CredentialResourceMode { + if x != nil { + return x.xxx_hidden_ResourceMode + } + return CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED +} + +func (x *IssueCredentialResponse) GetRequestId() string { + if x != nil { + return x.xxx_hidden_RequestId + } + return "" +} + +func (x *IssueCredentialResponse) SetSecret(v *Resource) { + x.xxx_hidden_Secret = v +} + +func (x *IssueCredentialResponse) SetEncryptedData(v []*EncryptedData) { + x.xxx_hidden_EncryptedData = &v +} + +func (x *IssueCredentialResponse) SetAnnotations(v []*anypb.Any) { + x.xxx_hidden_Annotations = &v +} + +func (x *IssueCredentialResponse) SetResourceMode(v CredentialResourceMode) { + x.xxx_hidden_ResourceMode = v +} + +func (x *IssueCredentialResponse) SetRequestId(v string) { + x.xxx_hidden_RequestId = v +} + +func (x *IssueCredentialResponse) HasSecret() bool { + if x == nil { + return false + } + return x.xxx_hidden_Secret != nil +} + +func (x *IssueCredentialResponse) ClearSecret() { + x.xxx_hidden_Secret = nil +} + +type IssueCredentialResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The newly minted secret modeled as a resource. Carries SecretTrait, whose + // identity_id back-references the IssueCredentialRequest.identity_id, so the + // platform can link the secret to the identity that owns it. + Secret *Resource + // The minted credential material, encrypted per the request's + // EncryptionConfigs via the same fan-out as CreateAccount/RotateCredential. + EncryptedData []*EncryptedData + Annotations []*anypb.Any + ResourceMode CredentialResourceMode + RequestId string +} + +func (b0 IssueCredentialResponse_builder) Build() *IssueCredentialResponse { + m0 := &IssueCredentialResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Secret = b.Secret + x.xxx_hidden_EncryptedData = &b.EncryptedData + x.xxx_hidden_Annotations = &b.Annotations + x.xxx_hidden_ResourceMode = b.ResourceMode + x.xxx_hidden_RequestId = b.RequestId + return m0 +} + +type AccountInfo struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Emails *[]*AccountInfo_Email `protobuf:"bytes,1,rep,name=emails,proto3"` + xxx_hidden_Login string `protobuf:"bytes,2,opt,name=login,proto3"` + xxx_hidden_LoginAliases []string `protobuf:"bytes,3,rep,name=login_aliases,json=loginAliases,proto3"` + xxx_hidden_Profile *structpb.Struct `protobuf:"bytes,4,opt,name=profile,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountInfo) Reset() { + *x = AccountInfo{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountInfo) ProtoMessage() {} + +func (x *AccountInfo) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AccountInfo) GetEmails() []*AccountInfo_Email { + if x != nil { + if x.xxx_hidden_Emails != nil { + return *x.xxx_hidden_Emails + } + } + return nil +} + +func (x *AccountInfo) GetLogin() string { + if x != nil { + return x.xxx_hidden_Login + } + return "" +} + +func (x *AccountInfo) GetLoginAliases() []string { + if x != nil { + return x.xxx_hidden_LoginAliases + } + return nil +} + +func (x *AccountInfo) GetProfile() *structpb.Struct { + if x != nil { + return x.xxx_hidden_Profile + } + return nil +} + +func (x *AccountInfo) SetEmails(v []*AccountInfo_Email) { + x.xxx_hidden_Emails = &v +} + +func (x *AccountInfo) SetLogin(v string) { + x.xxx_hidden_Login = v +} + +func (x *AccountInfo) SetLoginAliases(v []string) { + x.xxx_hidden_LoginAliases = v +} + +func (x *AccountInfo) SetProfile(v *structpb.Struct) { + x.xxx_hidden_Profile = v +} + +func (x *AccountInfo) HasProfile() bool { + if x == nil { + return false + } + return x.xxx_hidden_Profile != nil +} + +func (x *AccountInfo) ClearProfile() { + x.xxx_hidden_Profile = nil +} + +type AccountInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Emails []*AccountInfo_Email + // The user's login + Login string + // Any additional login aliases for the user + LoginAliases []string + Profile *structpb.Struct +} + +func (b0 AccountInfo_builder) Build() *AccountInfo { + m0 := &AccountInfo{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Emails = &b.Emails + x.xxx_hidden_Login = b.Login + x.xxx_hidden_LoginAliases = b.LoginAliases + x.xxx_hidden_Profile = b.Profile + return m0 +} + +type KeyGenerationProfile struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Kty string `protobuf:"bytes,1,opt,name=kty,proto3"` + xxx_hidden_Parameters isKeyGenerationProfile_Parameters `protobuf_oneof:"parameters"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *KeyGenerationProfile) Reset() { + *x = KeyGenerationProfile{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *KeyGenerationProfile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyGenerationProfile) ProtoMessage() {} + +func (x *KeyGenerationProfile) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *KeyGenerationProfile) GetKty() string { + if x != nil { + return x.xxx_hidden_Kty + } + return "" +} + +func (x *KeyGenerationProfile) GetRsaModulusBits() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_Parameters.(*keyGenerationProfile_RsaModulusBits); ok { + return x.RsaModulusBits + } + } + return 0 +} + +func (x *KeyGenerationProfile) GetCrv() string { + if x != nil { + if x, ok := x.xxx_hidden_Parameters.(*keyGenerationProfile_Crv); ok { + return x.Crv + } + } + return "" +} + +func (x *KeyGenerationProfile) SetKty(v string) { + x.xxx_hidden_Kty = v +} + +func (x *KeyGenerationProfile) SetRsaModulusBits(v uint32) { + x.xxx_hidden_Parameters = &keyGenerationProfile_RsaModulusBits{v} +} + +func (x *KeyGenerationProfile) SetCrv(v string) { + x.xxx_hidden_Parameters = &keyGenerationProfile_Crv{v} +} + +func (x *KeyGenerationProfile) HasParameters() bool { + if x == nil { + return false + } + return x.xxx_hidden_Parameters != nil +} + +func (x *KeyGenerationProfile) HasRsaModulusBits() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Parameters.(*keyGenerationProfile_RsaModulusBits) + return ok +} + +func (x *KeyGenerationProfile) HasCrv() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Parameters.(*keyGenerationProfile_Crv) + return ok +} + +func (x *KeyGenerationProfile) ClearParameters() { + x.xxx_hidden_Parameters = nil +} + +func (x *KeyGenerationProfile) ClearRsaModulusBits() { + if _, ok := x.xxx_hidden_Parameters.(*keyGenerationProfile_RsaModulusBits); ok { + x.xxx_hidden_Parameters = nil + } +} + +func (x *KeyGenerationProfile) ClearCrv() { + if _, ok := x.xxx_hidden_Parameters.(*keyGenerationProfile_Crv); ok { + x.xxx_hidden_Parameters = nil + } +} + +const KeyGenerationProfile_Parameters_not_set_case case_KeyGenerationProfile_Parameters = 0 +const KeyGenerationProfile_RsaModulusBits_case case_KeyGenerationProfile_Parameters = 2 +const KeyGenerationProfile_Crv_case case_KeyGenerationProfile_Parameters = 3 + +func (x *KeyGenerationProfile) WhichParameters() case_KeyGenerationProfile_Parameters { + if x == nil { + return KeyGenerationProfile_Parameters_not_set_case + } + switch x.xxx_hidden_Parameters.(type) { + case *keyGenerationProfile_RsaModulusBits: + return KeyGenerationProfile_RsaModulusBits_case + case *keyGenerationProfile_Crv: + return KeyGenerationProfile_Crv_case + default: + return KeyGenerationProfile_Parameters_not_set_case + } +} + +type KeyGenerationProfile_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Kty string + // Fields of oneof xxx_hidden_Parameters: + RsaModulusBits *uint32 + Crv *string + // -- end of xxx_hidden_Parameters +} + +func (b0 KeyGenerationProfile_builder) Build() *KeyGenerationProfile { + m0 := &KeyGenerationProfile{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Kty = b.Kty + if b.RsaModulusBits != nil { + x.xxx_hidden_Parameters = &keyGenerationProfile_RsaModulusBits{*b.RsaModulusBits} + } + if b.Crv != nil { + x.xxx_hidden_Parameters = &keyGenerationProfile_Crv{*b.Crv} + } + return m0 +} + +type case_KeyGenerationProfile_Parameters protoreflect.FieldNumber + +func (x case_KeyGenerationProfile_Parameters) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[14].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isKeyGenerationProfile_Parameters interface { + isKeyGenerationProfile_Parameters() } -type RotateCredentialRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - ResourceId *ResourceId - CredentialOptions *CredentialOptions - EncryptionConfigs []*EncryptionConfig +type keyGenerationProfile_RsaModulusBits struct { + RsaModulusBits uint32 `protobuf:"varint,2,opt,name=rsa_modulus_bits,json=rsaModulusBits,proto3,oneof"` } -func (b0 RotateCredentialRequest_builder) Build() *RotateCredentialRequest { - m0 := &RotateCredentialRequest{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_ResourceId = b.ResourceId - x.xxx_hidden_CredentialOptions = b.CredentialOptions - x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs - return m0 +type keyGenerationProfile_Crv struct { + Crv string `protobuf:"bytes,3,opt,name=crv,proto3,oneof"` } -type RotateCredentialResponse struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_EncryptedData *[]*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_data,json=encryptedData,proto3"` - xxx_hidden_ResourceId *ResourceId `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3"` - xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache +func (*keyGenerationProfile_RsaModulusBits) isKeyGenerationProfile_Parameters() {} + +func (*keyGenerationProfile_Crv) isKeyGenerationProfile_Parameters() {} + +// CredentialIssueOptions are intentionally separate from CredentialOptions: +// adding issuance-only arms must not expand account creation or rotation. +type CredentialIssueOptions struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Options isCredentialIssueOptions_Options `protobuf_oneof:"options"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (x *RotateCredentialResponse) Reset() { - *x = RotateCredentialResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[10] +func (x *CredentialIssueOptions) Reset() { + *x = CredentialIssueOptions{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RotateCredentialResponse) String() string { +func (x *CredentialIssueOptions) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RotateCredentialResponse) ProtoMessage() {} +func (*CredentialIssueOptions) ProtoMessage() {} -func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[10] +func (x *CredentialIssueOptions) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1134,186 +1862,233 @@ func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -func (x *RotateCredentialResponse) GetEncryptedData() []*EncryptedData { +func (x *CredentialIssueOptions) GetApiKey() *CredentialIssueOptions_ApiKey { if x != nil { - if x.xxx_hidden_EncryptedData != nil { - return *x.xxx_hidden_EncryptedData + if x, ok := x.xxx_hidden_Options.(*credentialIssueOptions_ApiKey_); ok { + return x.ApiKey } } return nil } -func (x *RotateCredentialResponse) GetResourceId() *ResourceId { +func (x *CredentialIssueOptions) GetKeypair() *CredentialIssueOptions_Keypair { if x != nil { - return x.xxx_hidden_ResourceId + if x, ok := x.xxx_hidden_Options.(*credentialIssueOptions_Keypair_); ok { + return x.Keypair + } } return nil } -func (x *RotateCredentialResponse) GetAnnotations() []*anypb.Any { +func (x *CredentialIssueOptions) GetToken() *CredentialIssueOptions_Token { if x != nil { - if x.xxx_hidden_Annotations != nil { - return *x.xxx_hidden_Annotations + if x, ok := x.xxx_hidden_Options.(*credentialIssueOptions_Token_); ok { + return x.Token } } return nil } -func (x *RotateCredentialResponse) SetEncryptedData(v []*EncryptedData) { - x.xxx_hidden_EncryptedData = &v +func (x *CredentialIssueOptions) GetClientSecret() *CredentialIssueOptions_ClientSecret { + if x != nil { + if x, ok := x.xxx_hidden_Options.(*credentialIssueOptions_ClientSecret_); ok { + return x.ClientSecret + } + } + return nil } -func (x *RotateCredentialResponse) SetResourceId(v *ResourceId) { - x.xxx_hidden_ResourceId = v +func (x *CredentialIssueOptions) SetApiKey(v *CredentialIssueOptions_ApiKey) { + if v == nil { + x.xxx_hidden_Options = nil + return + } + x.xxx_hidden_Options = &credentialIssueOptions_ApiKey_{v} } -func (x *RotateCredentialResponse) SetAnnotations(v []*anypb.Any) { - x.xxx_hidden_Annotations = &v +func (x *CredentialIssueOptions) SetKeypair(v *CredentialIssueOptions_Keypair) { + if v == nil { + x.xxx_hidden_Options = nil + return + } + x.xxx_hidden_Options = &credentialIssueOptions_Keypair_{v} } -func (x *RotateCredentialResponse) HasResourceId() bool { - if x == nil { - return false +func (x *CredentialIssueOptions) SetToken(v *CredentialIssueOptions_Token) { + if v == nil { + x.xxx_hidden_Options = nil + return } - return x.xxx_hidden_ResourceId != nil + x.xxx_hidden_Options = &credentialIssueOptions_Token_{v} } -func (x *RotateCredentialResponse) ClearResourceId() { - x.xxx_hidden_ResourceId = nil +func (x *CredentialIssueOptions) SetClientSecret(v *CredentialIssueOptions_ClientSecret) { + if v == nil { + x.xxx_hidden_Options = nil + return + } + x.xxx_hidden_Options = &credentialIssueOptions_ClientSecret_{v} } -type RotateCredentialResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - EncryptedData []*EncryptedData - ResourceId *ResourceId - Annotations []*anypb.Any +func (x *CredentialIssueOptions) HasOptions() bool { + if x == nil { + return false + } + return x.xxx_hidden_Options != nil } -func (b0 RotateCredentialResponse_builder) Build() *RotateCredentialResponse { - m0 := &RotateCredentialResponse{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_EncryptedData = &b.EncryptedData - x.xxx_hidden_ResourceId = b.ResourceId - x.xxx_hidden_Annotations = &b.Annotations - return m0 +func (x *CredentialIssueOptions) HasApiKey() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_ApiKey_) + return ok } -type AccountInfo struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Emails *[]*AccountInfo_Email `protobuf:"bytes,1,rep,name=emails,proto3"` - xxx_hidden_Login string `protobuf:"bytes,2,opt,name=login,proto3"` - xxx_hidden_LoginAliases []string `protobuf:"bytes,3,rep,name=login_aliases,json=loginAliases,proto3"` - xxx_hidden_Profile *structpb.Struct `protobuf:"bytes,4,opt,name=profile,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache +func (x *CredentialIssueOptions) HasKeypair() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_Keypair_) + return ok } -func (x *AccountInfo) Reset() { - *x = AccountInfo{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *CredentialIssueOptions) HasToken() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_Token_) + return ok } -func (x *AccountInfo) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *CredentialIssueOptions) HasClientSecret() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_ClientSecret_) + return ok } -func (*AccountInfo) ProtoMessage() {} +func (x *CredentialIssueOptions) ClearOptions() { + x.xxx_hidden_Options = nil +} -func (x *AccountInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *CredentialIssueOptions) ClearApiKey() { + if _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_ApiKey_); ok { + x.xxx_hidden_Options = nil } - return mi.MessageOf(x) } -func (x *AccountInfo) GetEmails() []*AccountInfo_Email { - if x != nil { - if x.xxx_hidden_Emails != nil { - return *x.xxx_hidden_Emails - } +func (x *CredentialIssueOptions) ClearKeypair() { + if _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_Keypair_); ok { + x.xxx_hidden_Options = nil } - return nil } -func (x *AccountInfo) GetLogin() string { - if x != nil { - return x.xxx_hidden_Login +func (x *CredentialIssueOptions) ClearToken() { + if _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_Token_); ok { + x.xxx_hidden_Options = nil } - return "" } -func (x *AccountInfo) GetLoginAliases() []string { - if x != nil { - return x.xxx_hidden_LoginAliases +func (x *CredentialIssueOptions) ClearClientSecret() { + if _, ok := x.xxx_hidden_Options.(*credentialIssueOptions_ClientSecret_); ok { + x.xxx_hidden_Options = nil } - return nil } -func (x *AccountInfo) GetProfile() *structpb.Struct { - if x != nil { - return x.xxx_hidden_Profile +const CredentialIssueOptions_Options_not_set_case case_CredentialIssueOptions_Options = 0 +const CredentialIssueOptions_ApiKey_case case_CredentialIssueOptions_Options = 100 +const CredentialIssueOptions_Keypair_case case_CredentialIssueOptions_Options = 101 +const CredentialIssueOptions_Token_case case_CredentialIssueOptions_Options = 102 +const CredentialIssueOptions_ClientSecret_case case_CredentialIssueOptions_Options = 103 + +func (x *CredentialIssueOptions) WhichOptions() case_CredentialIssueOptions_Options { + if x == nil { + return CredentialIssueOptions_Options_not_set_case + } + switch x.xxx_hidden_Options.(type) { + case *credentialIssueOptions_ApiKey_: + return CredentialIssueOptions_ApiKey_case + case *credentialIssueOptions_Keypair_: + return CredentialIssueOptions_Keypair_case + case *credentialIssueOptions_Token_: + return CredentialIssueOptions_Token_case + case *credentialIssueOptions_ClientSecret_: + return CredentialIssueOptions_ClientSecret_case + default: + return CredentialIssueOptions_Options_not_set_case } - return nil } -func (x *AccountInfo) SetEmails(v []*AccountInfo_Email) { - x.xxx_hidden_Emails = &v -} +type CredentialIssueOptions_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. -func (x *AccountInfo) SetLogin(v string) { - x.xxx_hidden_Login = v + // Fields of oneof xxx_hidden_Options: + ApiKey *CredentialIssueOptions_ApiKey + Keypair *CredentialIssueOptions_Keypair + Token *CredentialIssueOptions_Token + ClientSecret *CredentialIssueOptions_ClientSecret + // -- end of xxx_hidden_Options } -func (x *AccountInfo) SetLoginAliases(v []string) { - x.xxx_hidden_LoginAliases = v +func (b0 CredentialIssueOptions_builder) Build() *CredentialIssueOptions { + m0 := &CredentialIssueOptions{} + b, x := &b0, m0 + _, _ = b, x + if b.ApiKey != nil { + x.xxx_hidden_Options = &credentialIssueOptions_ApiKey_{b.ApiKey} + } + if b.Keypair != nil { + x.xxx_hidden_Options = &credentialIssueOptions_Keypair_{b.Keypair} + } + if b.Token != nil { + x.xxx_hidden_Options = &credentialIssueOptions_Token_{b.Token} + } + if b.ClientSecret != nil { + x.xxx_hidden_Options = &credentialIssueOptions_ClientSecret_{b.ClientSecret} + } + return m0 } -func (x *AccountInfo) SetProfile(v *structpb.Struct) { - x.xxx_hidden_Profile = v -} +type case_CredentialIssueOptions_Options protoreflect.FieldNumber -func (x *AccountInfo) HasProfile() bool { - if x == nil { - return false +func (x case_CredentialIssueOptions_Options) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[15].Descriptor() + if x == 0 { + return "not set" } - return x.xxx_hidden_Profile != nil + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) } -func (x *AccountInfo) ClearProfile() { - x.xxx_hidden_Profile = nil +type isCredentialIssueOptions_Options interface { + isCredentialIssueOptions_Options() } -type AccountInfo_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. +type credentialIssueOptions_ApiKey_ struct { + ApiKey *CredentialIssueOptions_ApiKey `protobuf:"bytes,100,opt,name=api_key,json=apiKey,proto3,oneof"` +} - Emails []*AccountInfo_Email - // The user's login - Login string - // Any additional login aliases for the user - LoginAliases []string - Profile *structpb.Struct +type credentialIssueOptions_Keypair_ struct { + Keypair *CredentialIssueOptions_Keypair `protobuf:"bytes,101,opt,name=keypair,proto3,oneof"` } -func (b0 AccountInfo_builder) Build() *AccountInfo { - m0 := &AccountInfo{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Emails = &b.Emails - x.xxx_hidden_Login = b.Login - x.xxx_hidden_LoginAliases = b.LoginAliases - x.xxx_hidden_Profile = b.Profile - return m0 +type credentialIssueOptions_Token_ struct { + Token *CredentialIssueOptions_Token `protobuf:"bytes,102,opt,name=token,proto3,oneof"` +} + +type credentialIssueOptions_ClientSecret_ struct { + ClientSecret *CredentialIssueOptions_ClientSecret `protobuf:"bytes,103,opt,name=client_secret,json=clientSecret,proto3,oneof"` } +func (*credentialIssueOptions_ApiKey_) isCredentialIssueOptions_Options() {} + +func (*credentialIssueOptions_Keypair_) isCredentialIssueOptions_Options() {} + +func (*credentialIssueOptions_Token_) isCredentialIssueOptions_Options() {} + +func (*credentialIssueOptions_ClientSecret_) isCredentialIssueOptions_Options() {} + type CredentialOptions struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_Options isCredentialOptions_Options `protobuf_oneof:"options"` @@ -1324,7 +2099,7 @@ type CredentialOptions struct { func (x *CredentialOptions) Reset() { *x = CredentialOptions{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + mi := &file_c1_connector_v2_resource_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1336,7 +2111,7 @@ func (x *CredentialOptions) String() string { func (*CredentialOptions) ProtoMessage() {} func (x *CredentialOptions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[12] + mi := &file_c1_connector_v2_resource_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1552,7 +2327,7 @@ func (b0 CredentialOptions_builder) Build() *CredentialOptions { type case_CredentialOptions_Options protoreflect.FieldNumber func (x case_CredentialOptions_Options) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[12].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[16].Descriptor() if x == 0 { return "not set" } @@ -1598,7 +2373,7 @@ type LocalCredentialOptions struct { func (x *LocalCredentialOptions) Reset() { *x = LocalCredentialOptions{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + mi := &file_c1_connector_v2_resource_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1610,7 +2385,7 @@ func (x *LocalCredentialOptions) String() string { func (*LocalCredentialOptions) ProtoMessage() {} func (x *LocalCredentialOptions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[13] + mi := &file_c1_connector_v2_resource_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1826,7 +2601,7 @@ func (b0 LocalCredentialOptions_builder) Build() *LocalCredentialOptions { type case_LocalCredentialOptions_Options protoreflect.FieldNumber func (x case_LocalCredentialOptions_Options) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[13].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[17].Descriptor() if x == 0 { return "not set" } @@ -1871,7 +2646,7 @@ type PasswordConstraint struct { func (x *PasswordConstraint) Reset() { *x = PasswordConstraint{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + mi := &file_c1_connector_v2_resource_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1883,7 +2658,7 @@ func (x *PasswordConstraint) String() string { func (*PasswordConstraint) ProtoMessage() {} func (x *PasswordConstraint) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[14] + mi := &file_c1_connector_v2_resource_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1944,7 +2719,7 @@ type CreateAccountRequest struct { func (x *CreateAccountRequest) Reset() { *x = CreateAccountRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[15] + mi := &file_c1_connector_v2_resource_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1956,7 +2731,7 @@ func (x *CreateAccountRequest) String() string { func (*CreateAccountRequest) ProtoMessage() {} func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[15] + mi := &file_c1_connector_v2_resource_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2066,7 +2841,7 @@ type CreateAccountResponse struct { func (x *CreateAccountResponse) Reset() { *x = CreateAccountResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[16] + mi := &file_c1_connector_v2_resource_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2078,7 +2853,7 @@ func (x *CreateAccountResponse) String() string { func (*CreateAccountResponse) ProtoMessage() {} func (x *CreateAccountResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[16] + mi := &file_c1_connector_v2_resource_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2311,7 +3086,7 @@ func (b0 CreateAccountResponse_builder) Build() *CreateAccountResponse { type case_CreateAccountResponse_Result protoreflect.FieldNumber func (x case_CreateAccountResponse_Result) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[16].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[20].Descriptor() if x == 0 { return "not set" } @@ -2361,7 +3136,7 @@ type EncryptedData struct { func (x *EncryptedData) Reset() { *x = EncryptedData{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[17] + mi := &file_c1_connector_v2_resource_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2373,7 +3148,7 @@ func (x *EncryptedData) String() string { func (*EncryptedData) ProtoMessage() {} func (x *EncryptedData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[17] + mi := &file_c1_connector_v2_resource_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2512,7 +3287,7 @@ type PlaintextData struct { func (x *PlaintextData) Reset() { *x = PlaintextData{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[18] + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2524,7 +3299,7 @@ func (x *PlaintextData) String() string { func (*PlaintextData) ProtoMessage() {} func (x *PlaintextData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[18] + mi := &file_c1_connector_v2_resource_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2614,7 +3389,7 @@ type EncryptionConfig struct { func (x *EncryptionConfig) Reset() { *x = EncryptionConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[19] + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2626,7 +3401,7 @@ func (x *EncryptionConfig) String() string { func (*EncryptionConfig) ProtoMessage() {} func (x *EncryptionConfig) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[19] + mi := &file_c1_connector_v2_resource_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2803,7 +3578,7 @@ func (b0 EncryptionConfig_builder) Build() *EncryptionConfig { type case_EncryptionConfig_Config protoreflect.FieldNumber func (x case_EncryptionConfig_Config) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[19].Descriptor() + md := file_c1_connector_v2_resource_proto_msgTypes[23].Descriptor() if x == 0 { return "not set" } @@ -2837,7 +3612,7 @@ type ResourceId struct { func (x *ResourceId) Reset() { *x = ResourceId{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[20] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2849,7 +3624,7 @@ func (x *ResourceId) String() string { func (*ResourceId) ProtoMessage() {} func (x *ResourceId) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[20] + mi := &file_c1_connector_v2_resource_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2931,7 +3706,7 @@ type Resource struct { func (x *Resource) Reset() { *x = Resource{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[21] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2943,7 +3718,7 @@ func (x *Resource) String() string { func (*Resource) ProtoMessage() {} func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[21] + mi := &file_c1_connector_v2_resource_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3227,7 +4002,7 @@ type Status struct { func (x *Status) Reset() { *x = Status{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3239,7 +4014,7 @@ func (x *Status) String() string { func (*Status) ProtoMessage() {} func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[22] + mi := &file_c1_connector_v2_resource_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3304,7 +4079,7 @@ type ResourcesServiceListResourcesRequest struct { func (x *ResourcesServiceListResourcesRequest) Reset() { *x = ResourcesServiceListResourcesRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3316,7 +4091,7 @@ func (x *ResourcesServiceListResourcesRequest) String() string { func (*ResourcesServiceListResourcesRequest) ProtoMessage() {} func (x *ResourcesServiceListResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[23] + mi := &file_c1_connector_v2_resource_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3459,7 +4234,7 @@ type ResourcesServiceListResourcesResponse struct { func (x *ResourcesServiceListResourcesResponse) Reset() { *x = ResourcesServiceListResourcesResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3471,7 +4246,7 @@ func (x *ResourcesServiceListResourcesResponse) String() string { func (*ResourcesServiceListResourcesResponse) ProtoMessage() {} func (x *ResourcesServiceListResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[24] + mi := &file_c1_connector_v2_resource_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3549,7 +4324,7 @@ type ResourceGetterServiceGetResourceRequest struct { func (x *ResourceGetterServiceGetResourceRequest) Reset() { *x = ResourceGetterServiceGetResourceRequest{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3561,7 +4336,7 @@ func (x *ResourceGetterServiceGetResourceRequest) String() string { func (*ResourceGetterServiceGetResourceRequest) ProtoMessage() {} func (x *ResourceGetterServiceGetResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[25] + mi := &file_c1_connector_v2_resource_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3670,7 +4445,7 @@ type ResourceGetterServiceGetResourceResponse struct { func (x *ResourceGetterServiceGetResourceResponse) Reset() { *x = ResourceGetterServiceGetResourceResponse{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3682,7 +4457,7 @@ func (x *ResourceGetterServiceGetResourceResponse) String() string { func (*ResourceGetterServiceGetResourceResponse) ProtoMessage() {} func (x *ResourceGetterServiceGetResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[26] + mi := &file_c1_connector_v2_resource_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3755,7 +4530,7 @@ type ExternalId struct { func (x *ExternalId) Reset() { *x = ExternalId{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3767,7 +4542,7 @@ func (x *ExternalId) String() string { func (*ExternalId) ProtoMessage() {} func (x *ExternalId) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[27] + mi := &file_c1_connector_v2_resource_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3839,7 +4614,7 @@ type AccountInfo_Email struct { func (x *AccountInfo_Email) Reset() { *x = AccountInfo_Email{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3851,7 +4626,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[28] + mi := &file_c1_connector_v2_resource_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3901,6 +4676,245 @@ func (b0 AccountInfo_Email_builder) Build() *AccountInfo_Email { return m0 } +type CredentialIssueOptions_ApiKey struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Scopes []string `protobuf:"bytes,1,rep,name=scopes,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_ApiKey) Reset() { + *x = CredentialIssueOptions_ApiKey{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_ApiKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_ApiKey) ProtoMessage() {} + +func (x *CredentialIssueOptions_ApiKey) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptions_ApiKey) GetScopes() []string { + if x != nil { + return x.xxx_hidden_Scopes + } + return nil +} + +func (x *CredentialIssueOptions_ApiKey) SetScopes(v []string) { + x.xxx_hidden_Scopes = v +} + +type CredentialIssueOptions_ApiKey_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Scopes []string +} + +func (b0 CredentialIssueOptions_ApiKey_builder) Build() *CredentialIssueOptions_ApiKey { + m0 := &CredentialIssueOptions_ApiKey{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Scopes = b.Scopes + return m0 +} + +type CredentialIssueOptions_Keypair struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Profile *KeyGenerationProfile `protobuf:"bytes,1,opt,name=profile,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_Keypair) Reset() { + *x = CredentialIssueOptions_Keypair{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_Keypair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_Keypair) ProtoMessage() {} + +func (x *CredentialIssueOptions_Keypair) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptions_Keypair) GetProfile() *KeyGenerationProfile { + if x != nil { + return x.xxx_hidden_Profile + } + return nil +} + +func (x *CredentialIssueOptions_Keypair) SetProfile(v *KeyGenerationProfile) { + x.xxx_hidden_Profile = v +} + +func (x *CredentialIssueOptions_Keypair) HasProfile() bool { + if x == nil { + return false + } + return x.xxx_hidden_Profile != nil +} + +func (x *CredentialIssueOptions_Keypair) ClearProfile() { + x.xxx_hidden_Profile = nil +} + +type CredentialIssueOptions_Keypair_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Profile *KeyGenerationProfile +} + +func (b0 CredentialIssueOptions_Keypair_builder) Build() *CredentialIssueOptions_Keypair { + m0 := &CredentialIssueOptions_Keypair{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Profile = b.Profile + return m0 +} + +type CredentialIssueOptions_Token struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Scopes []string `protobuf:"bytes,1,rep,name=scopes,proto3"` + xxx_hidden_Audiences []string `protobuf:"bytes,2,rep,name=audiences,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_Token) Reset() { + *x = CredentialIssueOptions_Token{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_Token) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_Token) ProtoMessage() {} + +func (x *CredentialIssueOptions_Token) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CredentialIssueOptions_Token) GetScopes() []string { + if x != nil { + return x.xxx_hidden_Scopes + } + return nil +} + +func (x *CredentialIssueOptions_Token) GetAudiences() []string { + if x != nil { + return x.xxx_hidden_Audiences + } + return nil +} + +func (x *CredentialIssueOptions_Token) SetScopes(v []string) { + x.xxx_hidden_Scopes = v +} + +func (x *CredentialIssueOptions_Token) SetAudiences(v []string) { + x.xxx_hidden_Audiences = v +} + +type CredentialIssueOptions_Token_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Scopes []string + Audiences []string +} + +func (b0 CredentialIssueOptions_Token_builder) Build() *CredentialIssueOptions_Token { + m0 := &CredentialIssueOptions_Token{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Scopes = b.Scopes + x.xxx_hidden_Audiences = b.Audiences + return m0 +} + +type CredentialIssueOptions_ClientSecret struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CredentialIssueOptions_ClientSecret) Reset() { + *x = CredentialIssueOptions_ClientSecret{} + mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CredentialIssueOptions_ClientSecret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialIssueOptions_ClientSecret) ProtoMessage() {} + +func (x *CredentialIssueOptions_ClientSecret) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type CredentialIssueOptions_ClientSecret_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 CredentialIssueOptions_ClientSecret_builder) Build() *CredentialIssueOptions_ClientSecret { + m0 := &CredentialIssueOptions_ClientSecret{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + type CredentialOptions_RandomPassword struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_Length int64 `protobuf:"varint,1,opt,name=length,proto3"` @@ -3911,7 +4925,7 @@ type CredentialOptions_RandomPassword struct { func (x *CredentialOptions_RandomPassword) Reset() { *x = CredentialOptions_RandomPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3923,7 +4937,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[29] + mi := &file_c1_connector_v2_resource_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3982,7 +4996,7 @@ type CredentialOptions_NoPassword struct { func (x *CredentialOptions_NoPassword) Reset() { *x = CredentialOptions_NoPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[30] + mi := &file_c1_connector_v2_resource_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3994,7 +5008,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[30] + mi := &file_c1_connector_v2_resource_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4026,7 +5040,7 @@ type CredentialOptions_SSO struct { func (x *CredentialOptions_SSO) Reset() { *x = CredentialOptions_SSO{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[31] + mi := &file_c1_connector_v2_resource_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4038,7 +5052,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[31] + mi := &file_c1_connector_v2_resource_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4083,7 +5097,7 @@ type CredentialOptions_EncryptedPassword struct { func (x *CredentialOptions_EncryptedPassword) Reset() { *x = CredentialOptions_EncryptedPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + mi := &file_c1_connector_v2_resource_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4095,7 +5109,7 @@ func (x *CredentialOptions_EncryptedPassword) String() string { func (*CredentialOptions_EncryptedPassword) ProtoMessage() {} func (x *CredentialOptions_EncryptedPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[32] + mi := &file_c1_connector_v2_resource_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4143,7 +5157,7 @@ type LocalCredentialOptions_RandomPassword struct { func (x *LocalCredentialOptions_RandomPassword) Reset() { *x = LocalCredentialOptions_RandomPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + mi := &file_c1_connector_v2_resource_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4155,7 +5169,7 @@ func (x *LocalCredentialOptions_RandomPassword) String() string { func (*LocalCredentialOptions_RandomPassword) ProtoMessage() {} func (x *LocalCredentialOptions_RandomPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[33] + mi := &file_c1_connector_v2_resource_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4214,7 +5228,7 @@ type LocalCredentialOptions_NoPassword struct { func (x *LocalCredentialOptions_NoPassword) Reset() { *x = LocalCredentialOptions_NoPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + mi := &file_c1_connector_v2_resource_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4226,7 +5240,7 @@ func (x *LocalCredentialOptions_NoPassword) String() string { func (*LocalCredentialOptions_NoPassword) ProtoMessage() {} func (x *LocalCredentialOptions_NoPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[34] + mi := &file_c1_connector_v2_resource_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4258,7 +5272,7 @@ type LocalCredentialOptions_SSO struct { func (x *LocalCredentialOptions_SSO) Reset() { *x = LocalCredentialOptions_SSO{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + mi := &file_c1_connector_v2_resource_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4270,7 +5284,7 @@ func (x *LocalCredentialOptions_SSO) String() string { func (*LocalCredentialOptions_SSO) ProtoMessage() {} func (x *LocalCredentialOptions_SSO) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[35] + mi := &file_c1_connector_v2_resource_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4315,7 +5329,7 @@ type LocalCredentialOptions_PlaintextPassword struct { func (x *LocalCredentialOptions_PlaintextPassword) Reset() { *x = LocalCredentialOptions_PlaintextPassword{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + mi := &file_c1_connector_v2_resource_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4327,7 +5341,7 @@ func (x *LocalCredentialOptions_PlaintextPassword) String() string { func (*LocalCredentialOptions_PlaintextPassword) ProtoMessage() {} func (x *LocalCredentialOptions_PlaintextPassword) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[36] + mi := &file_c1_connector_v2_resource_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4374,7 +5388,7 @@ type CreateAccountResponse_SuccessResult struct { func (x *CreateAccountResponse_SuccessResult) Reset() { *x = CreateAccountResponse_SuccessResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[37] + mi := &file_c1_connector_v2_resource_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4386,7 +5400,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[37] + mi := &file_c1_connector_v2_resource_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4490,7 +5504,7 @@ type CreateAccountResponse_ActionRequiredResult struct { func (x *CreateAccountResponse_ActionRequiredResult) Reset() { *x = CreateAccountResponse_ActionRequiredResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[38] + mi := &file_c1_connector_v2_resource_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4502,7 +5516,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[38] + mi := &file_c1_connector_v2_resource_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4585,7 +5599,7 @@ type CreateAccountResponse_AlreadyExistsResult struct { func (x *CreateAccountResponse_AlreadyExistsResult) Reset() { *x = CreateAccountResponse_AlreadyExistsResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[39] + mi := &file_c1_connector_v2_resource_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4597,7 +5611,7 @@ func (x *CreateAccountResponse_AlreadyExistsResult) String() string { func (*CreateAccountResponse_AlreadyExistsResult) ProtoMessage() {} func (x *CreateAccountResponse_AlreadyExistsResult) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[39] + mi := &file_c1_connector_v2_resource_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4667,7 +5681,7 @@ type CreateAccountResponse_InProgressResult struct { func (x *CreateAccountResponse_InProgressResult) Reset() { *x = CreateAccountResponse_InProgressResult{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[40] + mi := &file_c1_connector_v2_resource_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4679,7 +5693,7 @@ func (x *CreateAccountResponse_InProgressResult) String() string { func (*CreateAccountResponse_InProgressResult) ProtoMessage() {} func (x *CreateAccountResponse_InProgressResult) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[40] + mi := &file_c1_connector_v2_resource_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4748,7 +5762,7 @@ type EncryptionConfig_JWKPublicKeyConfig struct { func (x *EncryptionConfig_JWKPublicKeyConfig) Reset() { *x = EncryptionConfig_JWKPublicKeyConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[41] + mi := &file_c1_connector_v2_resource_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4760,7 +5774,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[41] + mi := &file_c1_connector_v2_resource_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4816,7 +5830,7 @@ type EncryptionConfig_AgeRecipientConfig struct { func (x *EncryptionConfig_AgeRecipientConfig) Reset() { *x = EncryptionConfig_AgeRecipientConfig{} - mi := &file_c1_connector_v2_resource_proto_msgTypes[42] + mi := &file_c1_connector_v2_resource_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4828,7 +5842,7 @@ func (x *EncryptionConfig_AgeRecipientConfig) String() string { func (*EncryptionConfig_AgeRecipientConfig) ProtoMessage() {} func (x *EncryptionConfig_AgeRecipientConfig) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_resource_proto_msgTypes[42] + mi := &file_c1_connector_v2_resource_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4935,7 +5949,23 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\x0eencrypted_data\x18\x01 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x12<\n" + "\vresource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + "resourceId\x126\n" + - "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\x82\x02\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xf8\x02\n" + + "\x16IssueCredentialRequest\x12<\n" + + "\videntity_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "identityId\x12V\n" + + "\x12credential_options\x18\x02 \x01(\v2'.c1.connector.v2.CredentialIssueOptionsR\x11credentialOptions\x12P\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x12;\n" + + "\n" + + "request_id\x18\x04 \x01(\tB\x1c\xfaB\x19r\x17 \x01(\x80\x012\x10^[A-Za-z0-9_-]+$R\trequestId\x129\n" + + "\n" + + "expires_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\"\xb8\x02\n" + + "\x17IssueCredentialResponse\x121\n" + + "\x06secret\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06secret\x12E\n" + + "\x0eencrypted_data\x18\x02 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x126\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12L\n" + + "\rresource_mode\x18\x04 \x01(\x0e2'.c1.connector.v2.CredentialResourceModeR\fresourceMode\x12\x1d\n" + + "\n" + + "request_id\x18\x05 \x01(\tR\trequestId\"\x82\x02\n" + "\vAccountInfo\x12:\n" + "\x06emails\x18\x01 \x03(\v2\".c1.connector.v2.AccountInfo.EmailR\x06emails\x12\x14\n" + "\x05login\x18\x02 \x01(\tR\x05login\x12#\n" + @@ -4944,7 +5974,27 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\x05Email\x12!\n" + "\aaddress\x18\x01 \x01(\tB\a\xfaB\x04r\x02`\x01R\aaddress\x12\x1d\n" + "\n" + - "is_primary\x18\x02 \x01(\bR\tisPrimary\"\xd1\x05\n" + + "is_primary\x18\x02 \x01(\bR\tisPrimary\"\x8a\x01\n" + + "\x14KeyGenerationProfile\x12\x1b\n" + + "\x03kty\x18\x01 \x01(\tB\t\xfaB\x06r\x04 \x01( R\x03kty\x12*\n" + + "\x10rsa_modulus_bits\x18\x02 \x01(\rH\x00R\x0ersaModulusBits\x12\x1b\n" + + "\x03crv\x18\x03 \x01(\tB\a\xfaB\x04r\x02(@H\x00R\x03crvB\f\n" + + "\n" + + "parameters\"\x9c\x04\n" + + "\x16CredentialIssueOptions\x12I\n" + + "\aapi_key\x18d \x01(\v2..c1.connector.v2.CredentialIssueOptions.ApiKeyH\x00R\x06apiKey\x12K\n" + + "\akeypair\x18e \x01(\v2/.c1.connector.v2.CredentialIssueOptions.KeypairH\x00R\akeypair\x12E\n" + + "\x05token\x18f \x01(\v2-.c1.connector.v2.CredentialIssueOptions.TokenH\x00R\x05token\x12[\n" + + "\rclient_secret\x18g \x01(\v24.c1.connector.v2.CredentialIssueOptions.ClientSecretH\x00R\fclientSecret\x1a \n" + + "\x06ApiKey\x12\x16\n" + + "\x06scopes\x18\x01 \x03(\tR\x06scopes\x1aJ\n" + + "\aKeypair\x12?\n" + + "\aprofile\x18\x01 \x01(\v2%.c1.connector.v2.KeyGenerationProfileR\aprofile\x1a=\n" + + "\x05Token\x12\x16\n" + + "\x06scopes\x18\x01 \x03(\tR\x06scopes\x12\x1c\n" + + "\taudiences\x18\x02 \x03(\tR\taudiences\x1a\x0e\n" + + "\fClientSecretB\t\n" + + "\aoptions\"\xd1\x05\n" + "\x11CredentialOptions\x12\\\n" + "\x0frandom_password\x18d \x01(\v21.c1.connector.v2.CredentialOptions.RandomPasswordH\x00R\x0erandomPassword\x12P\n" + "\vno_password\x18e \x01(\v2-.c1.connector.v2.CredentialOptions.NoPasswordH\x00R\n" + @@ -5104,7 +6154,11 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "ExternalId\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04link\x18\x02 \x01(\tR\x04link\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription2\xab\x01\n" + + "\vdescription\x18\x03 \x01(\tR\vdescription*\x93\x01\n" + + "\x16CredentialResourceMode\x12(\n" + + "$CREDENTIAL_RESOURCE_MODE_UNSPECIFIED\x10\x00\x12)\n" + + "%CREDENTIAL_RESOURCE_MODE_DISCOVERABLE\x10\x01\x12$\n" + + " CREDENTIAL_RESOURCE_MODE_VIRTUAL\x10\x022\xab\x01\n" + "\x14ResourceTypesService\x12\x92\x01\n" + "\x11ListResourceTypes\x12=.c1.connector.v2.ResourceTypesServiceListResourceTypesRequest\x1a>.c1.connector.v2.ResourceTypesServiceListResourceTypesResponse2\x92\x01\n" + "\x10ResourcesService\x12~\n" + @@ -5115,159 +6169,184 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\x0eCreateResource\x12&.c1.connector.v2.CreateResourceRequest\x1a'.c1.connector.v2.CreateResourceResponse\x12a\n" + "\x0eDeleteResource\x12&.c1.connector.v2.DeleteResourceRequest\x1a'.c1.connector.v2.DeleteResourceResponse2\x81\x01\n" + "\x16ResourceDeleterService\x12g\n" + - "\x10DeleteResourceV2\x12(.c1.connector.v2.DeleteResourceV2Request\x1a).c1.connector.v2.DeleteResourceV2Response2\x83\x01\n" + + "\x10DeleteResourceV2\x12(.c1.connector.v2.DeleteResourceV2Request\x1a).c1.connector.v2.DeleteResourceV2Response2\xe9\x01\n" + "\x18CredentialManagerService\x12g\n" + - "\x10RotateCredential\x12(.c1.connector.v2.RotateCredentialRequest\x1a).c1.connector.v2.RotateCredentialResponse2w\n" + + "\x10RotateCredential\x12(.c1.connector.v2.RotateCredentialRequest\x1a).c1.connector.v2.RotateCredentialResponse\x12d\n" + + "\x0fIssueCredential\x12'.c1.connector.v2.IssueCredentialRequest\x1a(.c1.connector.v2.IssueCredentialResponse2w\n" + "\x15AccountManagerService\x12^\n" + "\rCreateAccount\x12%.c1.connector.v2.CreateAccountRequest\x1a&.c1.connector.v2.CreateAccountResponseB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" -var file_c1_connector_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_c1_connector_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 51) 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 - (Status_ResourceStatus)(0), // 2: c1.connector.v2.Status.ResourceStatus - (*ResourceType)(nil), // 3: c1.connector.v2.ResourceType - (*ResourceTypesServiceListResourceTypesRequest)(nil), // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest - (*ResourceTypesServiceListResourceTypesResponse)(nil), // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse - (*CreateResourceRequest)(nil), // 6: c1.connector.v2.CreateResourceRequest - (*CreateResourceResponse)(nil), // 7: c1.connector.v2.CreateResourceResponse - (*DeleteResourceRequest)(nil), // 8: c1.connector.v2.DeleteResourceRequest - (*DeleteResourceResponse)(nil), // 9: c1.connector.v2.DeleteResourceResponse - (*DeleteResourceV2Request)(nil), // 10: c1.connector.v2.DeleteResourceV2Request - (*DeleteResourceV2Response)(nil), // 11: c1.connector.v2.DeleteResourceV2Response - (*RotateCredentialRequest)(nil), // 12: c1.connector.v2.RotateCredentialRequest - (*RotateCredentialResponse)(nil), // 13: c1.connector.v2.RotateCredentialResponse - (*AccountInfo)(nil), // 14: c1.connector.v2.AccountInfo - (*CredentialOptions)(nil), // 15: c1.connector.v2.CredentialOptions - (*LocalCredentialOptions)(nil), // 16: c1.connector.v2.LocalCredentialOptions - (*PasswordConstraint)(nil), // 17: c1.connector.v2.PasswordConstraint - (*CreateAccountRequest)(nil), // 18: c1.connector.v2.CreateAccountRequest - (*CreateAccountResponse)(nil), // 19: c1.connector.v2.CreateAccountResponse - (*EncryptedData)(nil), // 20: c1.connector.v2.EncryptedData - (*PlaintextData)(nil), // 21: c1.connector.v2.PlaintextData - (*EncryptionConfig)(nil), // 22: c1.connector.v2.EncryptionConfig - (*ResourceId)(nil), // 23: c1.connector.v2.ResourceId - (*Resource)(nil), // 24: c1.connector.v2.Resource - (*Status)(nil), // 25: c1.connector.v2.Status - (*ResourcesServiceListResourcesRequest)(nil), // 26: c1.connector.v2.ResourcesServiceListResourcesRequest - (*ResourcesServiceListResourcesResponse)(nil), // 27: c1.connector.v2.ResourcesServiceListResourcesResponse - (*ResourceGetterServiceGetResourceRequest)(nil), // 28: c1.connector.v2.ResourceGetterServiceGetResourceRequest - (*ResourceGetterServiceGetResourceResponse)(nil), // 29: c1.connector.v2.ResourceGetterServiceGetResourceResponse - (*ExternalId)(nil), // 30: c1.connector.v2.ExternalId - (*AccountInfo_Email)(nil), // 31: c1.connector.v2.AccountInfo.Email - (*CredentialOptions_RandomPassword)(nil), // 32: c1.connector.v2.CredentialOptions.RandomPassword - (*CredentialOptions_NoPassword)(nil), // 33: c1.connector.v2.CredentialOptions.NoPassword - (*CredentialOptions_SSO)(nil), // 34: c1.connector.v2.CredentialOptions.SSO - (*CredentialOptions_EncryptedPassword)(nil), // 35: c1.connector.v2.CredentialOptions.EncryptedPassword - (*LocalCredentialOptions_RandomPassword)(nil), // 36: c1.connector.v2.LocalCredentialOptions.RandomPassword - (*LocalCredentialOptions_NoPassword)(nil), // 37: c1.connector.v2.LocalCredentialOptions.NoPassword - (*LocalCredentialOptions_SSO)(nil), // 38: c1.connector.v2.LocalCredentialOptions.SSO - (*LocalCredentialOptions_PlaintextPassword)(nil), // 39: c1.connector.v2.LocalCredentialOptions.PlaintextPassword - (*CreateAccountResponse_SuccessResult)(nil), // 40: c1.connector.v2.CreateAccountResponse.SuccessResult - (*CreateAccountResponse_ActionRequiredResult)(nil), // 41: c1.connector.v2.CreateAccountResponse.ActionRequiredResult - (*CreateAccountResponse_AlreadyExistsResult)(nil), // 42: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult - (*CreateAccountResponse_InProgressResult)(nil), // 43: c1.connector.v2.CreateAccountResponse.InProgressResult - (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 44: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig - (*EncryptionConfig_AgeRecipientConfig)(nil), // 45: c1.connector.v2.EncryptionConfig.AgeRecipientConfig - (*anypb.Any)(nil), // 46: google.protobuf.Any - (*structpb.Struct)(nil), // 47: google.protobuf.Struct - (*AssetRef)(nil), // 48: c1.connector.v2.AssetRef - (*timestamppb.Timestamp)(nil), // 49: google.protobuf.Timestamp + (CredentialResourceMode)(0), // 0: c1.connector.v2.CredentialResourceMode + (ResourceType_Trait)(0), // 1: c1.connector.v2.ResourceType.Trait + (Resource_CreationSource)(0), // 2: c1.connector.v2.Resource.CreationSource + (Status_ResourceStatus)(0), // 3: c1.connector.v2.Status.ResourceStatus + (*ResourceType)(nil), // 4: c1.connector.v2.ResourceType + (*ResourceTypesServiceListResourceTypesRequest)(nil), // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest + (*ResourceTypesServiceListResourceTypesResponse)(nil), // 6: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse + (*CreateResourceRequest)(nil), // 7: c1.connector.v2.CreateResourceRequest + (*CreateResourceResponse)(nil), // 8: c1.connector.v2.CreateResourceResponse + (*DeleteResourceRequest)(nil), // 9: c1.connector.v2.DeleteResourceRequest + (*DeleteResourceResponse)(nil), // 10: c1.connector.v2.DeleteResourceResponse + (*DeleteResourceV2Request)(nil), // 11: c1.connector.v2.DeleteResourceV2Request + (*DeleteResourceV2Response)(nil), // 12: c1.connector.v2.DeleteResourceV2Response + (*RotateCredentialRequest)(nil), // 13: c1.connector.v2.RotateCredentialRequest + (*RotateCredentialResponse)(nil), // 14: c1.connector.v2.RotateCredentialResponse + (*IssueCredentialRequest)(nil), // 15: c1.connector.v2.IssueCredentialRequest + (*IssueCredentialResponse)(nil), // 16: c1.connector.v2.IssueCredentialResponse + (*AccountInfo)(nil), // 17: c1.connector.v2.AccountInfo + (*KeyGenerationProfile)(nil), // 18: c1.connector.v2.KeyGenerationProfile + (*CredentialIssueOptions)(nil), // 19: c1.connector.v2.CredentialIssueOptions + (*CredentialOptions)(nil), // 20: c1.connector.v2.CredentialOptions + (*LocalCredentialOptions)(nil), // 21: c1.connector.v2.LocalCredentialOptions + (*PasswordConstraint)(nil), // 22: c1.connector.v2.PasswordConstraint + (*CreateAccountRequest)(nil), // 23: c1.connector.v2.CreateAccountRequest + (*CreateAccountResponse)(nil), // 24: c1.connector.v2.CreateAccountResponse + (*EncryptedData)(nil), // 25: c1.connector.v2.EncryptedData + (*PlaintextData)(nil), // 26: c1.connector.v2.PlaintextData + (*EncryptionConfig)(nil), // 27: c1.connector.v2.EncryptionConfig + (*ResourceId)(nil), // 28: c1.connector.v2.ResourceId + (*Resource)(nil), // 29: c1.connector.v2.Resource + (*Status)(nil), // 30: c1.connector.v2.Status + (*ResourcesServiceListResourcesRequest)(nil), // 31: c1.connector.v2.ResourcesServiceListResourcesRequest + (*ResourcesServiceListResourcesResponse)(nil), // 32: c1.connector.v2.ResourcesServiceListResourcesResponse + (*ResourceGetterServiceGetResourceRequest)(nil), // 33: c1.connector.v2.ResourceGetterServiceGetResourceRequest + (*ResourceGetterServiceGetResourceResponse)(nil), // 34: c1.connector.v2.ResourceGetterServiceGetResourceResponse + (*ExternalId)(nil), // 35: c1.connector.v2.ExternalId + (*AccountInfo_Email)(nil), // 36: c1.connector.v2.AccountInfo.Email + (*CredentialIssueOptions_ApiKey)(nil), // 37: c1.connector.v2.CredentialIssueOptions.ApiKey + (*CredentialIssueOptions_Keypair)(nil), // 38: c1.connector.v2.CredentialIssueOptions.Keypair + (*CredentialIssueOptions_Token)(nil), // 39: c1.connector.v2.CredentialIssueOptions.Token + (*CredentialIssueOptions_ClientSecret)(nil), // 40: c1.connector.v2.CredentialIssueOptions.ClientSecret + (*CredentialOptions_RandomPassword)(nil), // 41: c1.connector.v2.CredentialOptions.RandomPassword + (*CredentialOptions_NoPassword)(nil), // 42: c1.connector.v2.CredentialOptions.NoPassword + (*CredentialOptions_SSO)(nil), // 43: c1.connector.v2.CredentialOptions.SSO + (*CredentialOptions_EncryptedPassword)(nil), // 44: c1.connector.v2.CredentialOptions.EncryptedPassword + (*LocalCredentialOptions_RandomPassword)(nil), // 45: c1.connector.v2.LocalCredentialOptions.RandomPassword + (*LocalCredentialOptions_NoPassword)(nil), // 46: c1.connector.v2.LocalCredentialOptions.NoPassword + (*LocalCredentialOptions_SSO)(nil), // 47: c1.connector.v2.LocalCredentialOptions.SSO + (*LocalCredentialOptions_PlaintextPassword)(nil), // 48: c1.connector.v2.LocalCredentialOptions.PlaintextPassword + (*CreateAccountResponse_SuccessResult)(nil), // 49: c1.connector.v2.CreateAccountResponse.SuccessResult + (*CreateAccountResponse_ActionRequiredResult)(nil), // 50: c1.connector.v2.CreateAccountResponse.ActionRequiredResult + (*CreateAccountResponse_AlreadyExistsResult)(nil), // 51: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult + (*CreateAccountResponse_InProgressResult)(nil), // 52: c1.connector.v2.CreateAccountResponse.InProgressResult + (*EncryptionConfig_JWKPublicKeyConfig)(nil), // 53: c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + (*EncryptionConfig_AgeRecipientConfig)(nil), // 54: c1.connector.v2.EncryptionConfig.AgeRecipientConfig + (*anypb.Any)(nil), // 55: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 56: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 57: google.protobuf.Struct + (*AssetRef)(nil), // 58: c1.connector.v2.AssetRef } var file_c1_connector_v2_resource_proto_depIdxs = []int32{ - 0, // 0: c1.connector.v2.ResourceType.traits:type_name -> c1.connector.v2.ResourceType.Trait - 46, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any - 24, // 2: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.parent:type_name -> c1.connector.v2.Resource - 46, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any - 3, // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.list:type_name -> c1.connector.v2.ResourceType - 46, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any - 24, // 6: c1.connector.v2.CreateResourceRequest.resource:type_name -> c1.connector.v2.Resource - 24, // 7: c1.connector.v2.CreateResourceResponse.created:type_name -> c1.connector.v2.Resource - 46, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any - 23, // 9: c1.connector.v2.DeleteResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 23, // 10: c1.connector.v2.DeleteResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 11: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any - 23, // 12: c1.connector.v2.DeleteResourceV2Request.resource_id:type_name -> c1.connector.v2.ResourceId - 23, // 13: c1.connector.v2.DeleteResourceV2Request.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 14: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any - 23, // 15: c1.connector.v2.RotateCredentialRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 15, // 16: c1.connector.v2.RotateCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions - 22, // 17: c1.connector.v2.RotateCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 20, // 18: c1.connector.v2.RotateCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData - 23, // 19: c1.connector.v2.RotateCredentialResponse.resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 20: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any - 31, // 21: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email - 47, // 22: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct - 32, // 23: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword - 33, // 24: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword - 34, // 25: c1.connector.v2.CredentialOptions.sso:type_name -> c1.connector.v2.CredentialOptions.SSO - 35, // 26: c1.connector.v2.CredentialOptions.encrypted_password:type_name -> c1.connector.v2.CredentialOptions.EncryptedPassword - 36, // 27: c1.connector.v2.LocalCredentialOptions.random_password:type_name -> c1.connector.v2.LocalCredentialOptions.RandomPassword - 37, // 28: c1.connector.v2.LocalCredentialOptions.no_password:type_name -> c1.connector.v2.LocalCredentialOptions.NoPassword - 38, // 29: c1.connector.v2.LocalCredentialOptions.sso:type_name -> c1.connector.v2.LocalCredentialOptions.SSO - 39, // 30: c1.connector.v2.LocalCredentialOptions.plaintext_password:type_name -> c1.connector.v2.LocalCredentialOptions.PlaintextPassword - 14, // 31: c1.connector.v2.CreateAccountRequest.account_info:type_name -> c1.connector.v2.AccountInfo - 15, // 32: c1.connector.v2.CreateAccountRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions - 22, // 33: c1.connector.v2.CreateAccountRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 40, // 34: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult - 41, // 35: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult - 42, // 36: c1.connector.v2.CreateAccountResponse.already_exists:type_name -> c1.connector.v2.CreateAccountResponse.AlreadyExistsResult - 43, // 37: c1.connector.v2.CreateAccountResponse.in_progress:type_name -> c1.connector.v2.CreateAccountResponse.InProgressResult - 20, // 38: c1.connector.v2.CreateAccountResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData - 46, // 39: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any - 24, // 40: c1.connector.v2.EncryptionConfig.principal:type_name -> c1.connector.v2.Resource - 44, // 41: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig - 45, // 42: c1.connector.v2.EncryptionConfig.age_recipient_config:type_name -> c1.connector.v2.EncryptionConfig.AgeRecipientConfig - 23, // 43: c1.connector.v2.Resource.id:type_name -> c1.connector.v2.ResourceId - 23, // 44: c1.connector.v2.Resource.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 45: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any - 30, // 46: c1.connector.v2.Resource.external_id:type_name -> c1.connector.v2.ExternalId - 1, // 47: c1.connector.v2.Resource.creation_source:type_name -> c1.connector.v2.Resource.CreationSource - 47, // 48: c1.connector.v2.Resource.profile:type_name -> google.protobuf.Struct - 48, // 49: c1.connector.v2.Resource.icon:type_name -> c1.connector.v2.AssetRef - 25, // 50: c1.connector.v2.Resource.status:type_name -> c1.connector.v2.Status - 49, // 51: c1.connector.v2.Resource.created_at:type_name -> google.protobuf.Timestamp - 2, // 52: c1.connector.v2.Status.status:type_name -> c1.connector.v2.Status.ResourceStatus - 23, // 53: c1.connector.v2.ResourcesServiceListResourcesRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 54: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any - 0, // 55: c1.connector.v2.ResourcesServiceListResourcesRequest.trait:type_name -> c1.connector.v2.ResourceType.Trait - 24, // 56: c1.connector.v2.ResourcesServiceListResourcesResponse.list:type_name -> c1.connector.v2.Resource - 46, // 57: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any - 23, // 58: c1.connector.v2.ResourceGetterServiceGetResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId - 23, // 59: c1.connector.v2.ResourceGetterServiceGetResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 46, // 60: c1.connector.v2.ResourceGetterServiceGetResourceRequest.annotations:type_name -> google.protobuf.Any - 24, // 61: c1.connector.v2.ResourceGetterServiceGetResourceResponse.resource:type_name -> c1.connector.v2.Resource - 46, // 62: c1.connector.v2.ResourceGetterServiceGetResourceResponse.annotations:type_name -> google.protobuf.Any - 17, // 63: c1.connector.v2.CredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint - 20, // 64: c1.connector.v2.CredentialOptions.EncryptedPassword.encrypted_passwords:type_name -> c1.connector.v2.EncryptedData - 17, // 65: c1.connector.v2.LocalCredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint - 24, // 66: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource - 49, // 67: c1.connector.v2.CreateAccountResponse.SuccessResult.invitation_expires_at:type_name -> google.protobuf.Timestamp - 24, // 68: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource - 24, // 69: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult.resource:type_name -> c1.connector.v2.Resource - 24, // 70: c1.connector.v2.CreateAccountResponse.InProgressResult.resource:type_name -> c1.connector.v2.Resource - 4, // 71: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest - 26, // 72: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest - 28, // 73: c1.connector.v2.ResourceGetterService.GetResource:input_type -> c1.connector.v2.ResourceGetterServiceGetResourceRequest - 6, // 74: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest - 8, // 75: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest - 10, // 76: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request - 12, // 77: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest - 18, // 78: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest - 5, // 79: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse - 27, // 80: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse - 29, // 81: c1.connector.v2.ResourceGetterService.GetResource:output_type -> c1.connector.v2.ResourceGetterServiceGetResourceResponse - 7, // 82: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse - 9, // 83: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse - 11, // 84: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response - 13, // 85: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse - 19, // 86: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse - 79, // [79:87] is the sub-list for method output_type - 71, // [71:79] is the sub-list for method input_type - 71, // [71:71] is the sub-list for extension type_name - 71, // [71:71] is the sub-list for extension extendee - 0, // [0:71] is the sub-list for field type_name + 1, // 0: c1.connector.v2.ResourceType.traits:type_name -> c1.connector.v2.ResourceType.Trait + 55, // 1: c1.connector.v2.ResourceType.annotations:type_name -> google.protobuf.Any + 29, // 2: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.parent:type_name -> c1.connector.v2.Resource + 55, // 3: c1.connector.v2.ResourceTypesServiceListResourceTypesRequest.annotations:type_name -> google.protobuf.Any + 4, // 4: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.list:type_name -> c1.connector.v2.ResourceType + 55, // 5: c1.connector.v2.ResourceTypesServiceListResourceTypesResponse.annotations:type_name -> google.protobuf.Any + 29, // 6: c1.connector.v2.CreateResourceRequest.resource:type_name -> c1.connector.v2.Resource + 29, // 7: c1.connector.v2.CreateResourceResponse.created:type_name -> c1.connector.v2.Resource + 55, // 8: c1.connector.v2.CreateResourceResponse.annotations:type_name -> google.protobuf.Any + 28, // 9: c1.connector.v2.DeleteResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 28, // 10: c1.connector.v2.DeleteResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 11: c1.connector.v2.DeleteResourceResponse.annotations:type_name -> google.protobuf.Any + 28, // 12: c1.connector.v2.DeleteResourceV2Request.resource_id:type_name -> c1.connector.v2.ResourceId + 28, // 13: c1.connector.v2.DeleteResourceV2Request.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 14: c1.connector.v2.DeleteResourceV2Response.annotations:type_name -> google.protobuf.Any + 28, // 15: c1.connector.v2.RotateCredentialRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 20, // 16: c1.connector.v2.RotateCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions + 27, // 17: c1.connector.v2.RotateCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 25, // 18: c1.connector.v2.RotateCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 28, // 19: c1.connector.v2.RotateCredentialResponse.resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 20: c1.connector.v2.RotateCredentialResponse.annotations:type_name -> google.protobuf.Any + 28, // 21: c1.connector.v2.IssueCredentialRequest.identity_id:type_name -> c1.connector.v2.ResourceId + 19, // 22: c1.connector.v2.IssueCredentialRequest.credential_options:type_name -> c1.connector.v2.CredentialIssueOptions + 27, // 23: c1.connector.v2.IssueCredentialRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 56, // 24: c1.connector.v2.IssueCredentialRequest.expires_at:type_name -> google.protobuf.Timestamp + 29, // 25: c1.connector.v2.IssueCredentialResponse.secret:type_name -> c1.connector.v2.Resource + 25, // 26: c1.connector.v2.IssueCredentialResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 55, // 27: c1.connector.v2.IssueCredentialResponse.annotations:type_name -> google.protobuf.Any + 0, // 28: c1.connector.v2.IssueCredentialResponse.resource_mode:type_name -> c1.connector.v2.CredentialResourceMode + 36, // 29: c1.connector.v2.AccountInfo.emails:type_name -> c1.connector.v2.AccountInfo.Email + 57, // 30: c1.connector.v2.AccountInfo.profile:type_name -> google.protobuf.Struct + 37, // 31: c1.connector.v2.CredentialIssueOptions.api_key:type_name -> c1.connector.v2.CredentialIssueOptions.ApiKey + 38, // 32: c1.connector.v2.CredentialIssueOptions.keypair:type_name -> c1.connector.v2.CredentialIssueOptions.Keypair + 39, // 33: c1.connector.v2.CredentialIssueOptions.token:type_name -> c1.connector.v2.CredentialIssueOptions.Token + 40, // 34: c1.connector.v2.CredentialIssueOptions.client_secret:type_name -> c1.connector.v2.CredentialIssueOptions.ClientSecret + 41, // 35: c1.connector.v2.CredentialOptions.random_password:type_name -> c1.connector.v2.CredentialOptions.RandomPassword + 42, // 36: c1.connector.v2.CredentialOptions.no_password:type_name -> c1.connector.v2.CredentialOptions.NoPassword + 43, // 37: c1.connector.v2.CredentialOptions.sso:type_name -> c1.connector.v2.CredentialOptions.SSO + 44, // 38: c1.connector.v2.CredentialOptions.encrypted_password:type_name -> c1.connector.v2.CredentialOptions.EncryptedPassword + 45, // 39: c1.connector.v2.LocalCredentialOptions.random_password:type_name -> c1.connector.v2.LocalCredentialOptions.RandomPassword + 46, // 40: c1.connector.v2.LocalCredentialOptions.no_password:type_name -> c1.connector.v2.LocalCredentialOptions.NoPassword + 47, // 41: c1.connector.v2.LocalCredentialOptions.sso:type_name -> c1.connector.v2.LocalCredentialOptions.SSO + 48, // 42: c1.connector.v2.LocalCredentialOptions.plaintext_password:type_name -> c1.connector.v2.LocalCredentialOptions.PlaintextPassword + 17, // 43: c1.connector.v2.CreateAccountRequest.account_info:type_name -> c1.connector.v2.AccountInfo + 20, // 44: c1.connector.v2.CreateAccountRequest.credential_options:type_name -> c1.connector.v2.CredentialOptions + 27, // 45: c1.connector.v2.CreateAccountRequest.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 49, // 46: c1.connector.v2.CreateAccountResponse.success:type_name -> c1.connector.v2.CreateAccountResponse.SuccessResult + 50, // 47: c1.connector.v2.CreateAccountResponse.action_required:type_name -> c1.connector.v2.CreateAccountResponse.ActionRequiredResult + 51, // 48: c1.connector.v2.CreateAccountResponse.already_exists:type_name -> c1.connector.v2.CreateAccountResponse.AlreadyExistsResult + 52, // 49: c1.connector.v2.CreateAccountResponse.in_progress:type_name -> c1.connector.v2.CreateAccountResponse.InProgressResult + 25, // 50: c1.connector.v2.CreateAccountResponse.encrypted_data:type_name -> c1.connector.v2.EncryptedData + 55, // 51: c1.connector.v2.CreateAccountResponse.annotations:type_name -> google.protobuf.Any + 29, // 52: c1.connector.v2.EncryptionConfig.principal:type_name -> c1.connector.v2.Resource + 53, // 53: c1.connector.v2.EncryptionConfig.jwk_public_key_config:type_name -> c1.connector.v2.EncryptionConfig.JWKPublicKeyConfig + 54, // 54: c1.connector.v2.EncryptionConfig.age_recipient_config:type_name -> c1.connector.v2.EncryptionConfig.AgeRecipientConfig + 28, // 55: c1.connector.v2.Resource.id:type_name -> c1.connector.v2.ResourceId + 28, // 56: c1.connector.v2.Resource.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 57: c1.connector.v2.Resource.annotations:type_name -> google.protobuf.Any + 35, // 58: c1.connector.v2.Resource.external_id:type_name -> c1.connector.v2.ExternalId + 2, // 59: c1.connector.v2.Resource.creation_source:type_name -> c1.connector.v2.Resource.CreationSource + 57, // 60: c1.connector.v2.Resource.profile:type_name -> google.protobuf.Struct + 58, // 61: c1.connector.v2.Resource.icon:type_name -> c1.connector.v2.AssetRef + 30, // 62: c1.connector.v2.Resource.status:type_name -> c1.connector.v2.Status + 56, // 63: c1.connector.v2.Resource.created_at:type_name -> google.protobuf.Timestamp + 3, // 64: c1.connector.v2.Status.status:type_name -> c1.connector.v2.Status.ResourceStatus + 28, // 65: c1.connector.v2.ResourcesServiceListResourcesRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 66: c1.connector.v2.ResourcesServiceListResourcesRequest.annotations:type_name -> google.protobuf.Any + 1, // 67: c1.connector.v2.ResourcesServiceListResourcesRequest.trait:type_name -> c1.connector.v2.ResourceType.Trait + 29, // 68: c1.connector.v2.ResourcesServiceListResourcesResponse.list:type_name -> c1.connector.v2.Resource + 55, // 69: c1.connector.v2.ResourcesServiceListResourcesResponse.annotations:type_name -> google.protobuf.Any + 28, // 70: c1.connector.v2.ResourceGetterServiceGetResourceRequest.resource_id:type_name -> c1.connector.v2.ResourceId + 28, // 71: c1.connector.v2.ResourceGetterServiceGetResourceRequest.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 55, // 72: c1.connector.v2.ResourceGetterServiceGetResourceRequest.annotations:type_name -> google.protobuf.Any + 29, // 73: c1.connector.v2.ResourceGetterServiceGetResourceResponse.resource:type_name -> c1.connector.v2.Resource + 55, // 74: c1.connector.v2.ResourceGetterServiceGetResourceResponse.annotations:type_name -> google.protobuf.Any + 18, // 75: c1.connector.v2.CredentialIssueOptions.Keypair.profile:type_name -> c1.connector.v2.KeyGenerationProfile + 22, // 76: c1.connector.v2.CredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint + 25, // 77: c1.connector.v2.CredentialOptions.EncryptedPassword.encrypted_passwords:type_name -> c1.connector.v2.EncryptedData + 22, // 78: c1.connector.v2.LocalCredentialOptions.RandomPassword.constraints:type_name -> c1.connector.v2.PasswordConstraint + 29, // 79: c1.connector.v2.CreateAccountResponse.SuccessResult.resource:type_name -> c1.connector.v2.Resource + 56, // 80: c1.connector.v2.CreateAccountResponse.SuccessResult.invitation_expires_at:type_name -> google.protobuf.Timestamp + 29, // 81: c1.connector.v2.CreateAccountResponse.ActionRequiredResult.resource:type_name -> c1.connector.v2.Resource + 29, // 82: c1.connector.v2.CreateAccountResponse.AlreadyExistsResult.resource:type_name -> c1.connector.v2.Resource + 29, // 83: c1.connector.v2.CreateAccountResponse.InProgressResult.resource:type_name -> c1.connector.v2.Resource + 5, // 84: c1.connector.v2.ResourceTypesService.ListResourceTypes:input_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesRequest + 31, // 85: c1.connector.v2.ResourcesService.ListResources:input_type -> c1.connector.v2.ResourcesServiceListResourcesRequest + 33, // 86: c1.connector.v2.ResourceGetterService.GetResource:input_type -> c1.connector.v2.ResourceGetterServiceGetResourceRequest + 7, // 87: c1.connector.v2.ResourceManagerService.CreateResource:input_type -> c1.connector.v2.CreateResourceRequest + 9, // 88: c1.connector.v2.ResourceManagerService.DeleteResource:input_type -> c1.connector.v2.DeleteResourceRequest + 11, // 89: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:input_type -> c1.connector.v2.DeleteResourceV2Request + 13, // 90: c1.connector.v2.CredentialManagerService.RotateCredential:input_type -> c1.connector.v2.RotateCredentialRequest + 15, // 91: c1.connector.v2.CredentialManagerService.IssueCredential:input_type -> c1.connector.v2.IssueCredentialRequest + 23, // 92: c1.connector.v2.AccountManagerService.CreateAccount:input_type -> c1.connector.v2.CreateAccountRequest + 6, // 93: c1.connector.v2.ResourceTypesService.ListResourceTypes:output_type -> c1.connector.v2.ResourceTypesServiceListResourceTypesResponse + 32, // 94: c1.connector.v2.ResourcesService.ListResources:output_type -> c1.connector.v2.ResourcesServiceListResourcesResponse + 34, // 95: c1.connector.v2.ResourceGetterService.GetResource:output_type -> c1.connector.v2.ResourceGetterServiceGetResourceResponse + 8, // 96: c1.connector.v2.ResourceManagerService.CreateResource:output_type -> c1.connector.v2.CreateResourceResponse + 10, // 97: c1.connector.v2.ResourceManagerService.DeleteResource:output_type -> c1.connector.v2.DeleteResourceResponse + 12, // 98: c1.connector.v2.ResourceDeleterService.DeleteResourceV2:output_type -> c1.connector.v2.DeleteResourceV2Response + 14, // 99: c1.connector.v2.CredentialManagerService.RotateCredential:output_type -> c1.connector.v2.RotateCredentialResponse + 16, // 100: c1.connector.v2.CredentialManagerService.IssueCredential:output_type -> c1.connector.v2.IssueCredentialResponse + 24, // 101: c1.connector.v2.AccountManagerService.CreateAccount:output_type -> c1.connector.v2.CreateAccountResponse + 93, // [93:102] is the sub-list for method output_type + 84, // [84:93] is the sub-list for method input_type + 84, // [84:84] is the sub-list for extension type_name + 84, // [84:84] is the sub-list for extension extendee + 0, // [0:84] is the sub-list for field type_name } func init() { file_c1_connector_v2_resource_proto_init() } @@ -5276,25 +6355,35 @@ func file_c1_connector_v2_resource_proto_init() { return } file_c1_connector_v2_asset_proto_init() - file_c1_connector_v2_resource_proto_msgTypes[12].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[14].OneofWrappers = []any{ + (*keyGenerationProfile_RsaModulusBits)(nil), + (*keyGenerationProfile_Crv)(nil), + } + file_c1_connector_v2_resource_proto_msgTypes[15].OneofWrappers = []any{ + (*credentialIssueOptions_ApiKey_)(nil), + (*credentialIssueOptions_Keypair_)(nil), + (*credentialIssueOptions_Token_)(nil), + (*credentialIssueOptions_ClientSecret_)(nil), + } + file_c1_connector_v2_resource_proto_msgTypes[16].OneofWrappers = []any{ (*credentialOptions_RandomPassword_)(nil), (*credentialOptions_NoPassword_)(nil), (*credentialOptions_Sso)(nil), (*credentialOptions_EncryptedPassword_)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[13].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[17].OneofWrappers = []any{ (*localCredentialOptions_RandomPassword_)(nil), (*localCredentialOptions_NoPassword_)(nil), (*localCredentialOptions_Sso)(nil), (*localCredentialOptions_PlaintextPassword_)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[16].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[20].OneofWrappers = []any{ (*createAccountResponse_Success)(nil), (*createAccountResponse_ActionRequired)(nil), (*createAccountResponse_AlreadyExists)(nil), (*createAccountResponse_InProgress)(nil), } - file_c1_connector_v2_resource_proto_msgTypes[19].OneofWrappers = []any{ + file_c1_connector_v2_resource_proto_msgTypes[23].OneofWrappers = []any{ (*encryptionConfig_JwkPublicKeyConfig)(nil), (*encryptionConfig_AgeRecipientConfig_)(nil), } @@ -5303,8 +6392,8 @@ func file_c1_connector_v2_resource_proto_init() { File: protoimpl.DescBuilder{ 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: 3, - NumMessages: 43, + NumEnums: 4, + NumMessages: 51, NumExtensions: 0, NumServices: 7, }, 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 dc6f99fa..fe7c7788 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,7 @@ type Task struct { // *Task_CompactSyncs_ // *Task_ListEventFeeds // *Task_ListEvents + // *Task_IssueCredential TaskType isTask_TaskType `protobuf_oneof:"task_type"` Debug bool `protobuf:"varint,3,opt,name=debug,proto3" json:"debug,omitempty"` unknownFields protoimpl.UnknownFields @@ -367,6 +368,15 @@ func (x *Task) GetListEvents() *Task_ListEventsTask { return nil } +func (x *Task) GetIssueCredential() *Task_IssueCredentialTask { + if x != nil { + if x, ok := x.TaskType.(*Task_IssueCredential); ok { + return x.IssueCredential + } + } + return nil +} + func (x *Task) GetDebug() bool { if x != nil { return x.Debug @@ -566,6 +576,14 @@ func (x *Task) SetListEvents(v *Task_ListEventsTask) { x.TaskType = &Task_ListEvents{v} } +func (x *Task) SetIssueCredential(v *Task_IssueCredentialTask) { + if v == nil { + x.TaskType = nil + return + } + x.TaskType = &Task_IssueCredential{v} +} + func (x *Task) SetDebug(v bool) { x.Debug = v } @@ -761,6 +779,14 @@ func (x *Task) HasListEvents() bool { return ok } +func (x *Task) HasIssueCredential() bool { + if x == nil { + return false + } + _, ok := x.TaskType.(*Task_IssueCredential) + return ok +} + func (x *Task) ClearTaskType() { x.TaskType = nil } @@ -903,6 +929,12 @@ func (x *Task) ClearListEvents() { } } +func (x *Task) ClearIssueCredential() { + if _, ok := x.TaskType.(*Task_IssueCredential); ok { + x.TaskType = nil + } +} + const Task_TaskType_not_set_case case_Task_TaskType = 0 const Task_None_case case_Task_TaskType = 100 const Task_Hello_case case_Task_TaskType = 101 @@ -927,6 +959,7 @@ const Task_CreateSyncDiff_case case_Task_TaskType = 119 const Task_CompactSyncs_case case_Task_TaskType = 120 const Task_ListEventFeeds_case case_Task_TaskType = 121 const Task_ListEvents_case case_Task_TaskType = 122 +const Task_IssueCredential_case case_Task_TaskType = 123 func (x *Task) WhichTaskType() case_Task_TaskType { if x == nil { @@ -979,6 +1012,8 @@ func (x *Task) WhichTaskType() case_Task_TaskType { return Task_ListEventFeeds_case case *Task_ListEvents: return Task_ListEvents_case + case *Task_IssueCredential: + return Task_IssueCredential_case default: return Task_TaskType_not_set_case } @@ -1013,6 +1048,7 @@ type Task_builder struct { CompactSyncs *Task_CompactSyncs ListEventFeeds *Task_ListEventFeedsTask ListEvents *Task_ListEventsTask + IssueCredential *Task_IssueCredentialTask // -- end of TaskType Debug bool } @@ -1092,6 +1128,9 @@ func (b0 Task_builder) Build() *Task { if b.ListEvents != nil { x.TaskType = &Task_ListEvents{b.ListEvents} } + if b.IssueCredential != nil { + x.TaskType = &Task_IssueCredential{b.IssueCredential} + } x.Debug = b.Debug return m0 } @@ -1202,6 +1241,10 @@ type Task_ListEvents struct { ListEvents *Task_ListEventsTask `protobuf:"bytes,122,opt,name=list_events,json=listEvents,proto3,oneof"` } +type Task_IssueCredential struct { + IssueCredential *Task_IssueCredentialTask `protobuf:"bytes,123,opt,name=issue_credential,json=issueCredential,proto3,oneof"` +} + func (*Task_None) isTask_TaskType() {} func (*Task_Hello) isTask_TaskType() {} @@ -1248,6 +1291,8 @@ func (*Task_ListEventFeeds) isTask_TaskType() {} func (*Task_ListEvents) isTask_TaskType() {} +func (*Task_IssueCredential) isTask_TaskType() {} + type BatonServiceHelloRequest struct { state protoimpl.MessageState `protogen:"hybrid.v1"` HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"` @@ -3896,6 +3941,138 @@ func (b0 Task_RotateCredentialsTask_builder) Build() *Task_RotateCredentialsTask return m0 } +type Task_IssueCredentialTask struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + IdentityId *v2.ResourceId `protobuf:"bytes,1,opt,name=identity_id,json=identityId,proto3" json:"identity_id,omitempty"` + CredentialOptions *v2.CredentialIssueOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` + EncryptionConfigs []*v2.EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_IssueCredentialTask) Reset() { + *x = Task_IssueCredentialTask{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_IssueCredentialTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_IssueCredentialTask) ProtoMessage() {} + +func (x *Task_IssueCredentialTask) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Task_IssueCredentialTask) GetIdentityId() *v2.ResourceId { + if x != nil { + return x.IdentityId + } + return nil +} + +func (x *Task_IssueCredentialTask) GetCredentialOptions() *v2.CredentialIssueOptions { + if x != nil { + return x.CredentialOptions + } + return nil +} + +func (x *Task_IssueCredentialTask) GetEncryptionConfigs() []*v2.EncryptionConfig { + if x != nil { + return x.EncryptionConfigs + } + return nil +} + +func (x *Task_IssueCredentialTask) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (x *Task_IssueCredentialTask) SetIdentityId(v *v2.ResourceId) { + x.IdentityId = v +} + +func (x *Task_IssueCredentialTask) SetCredentialOptions(v *v2.CredentialIssueOptions) { + x.CredentialOptions = v +} + +func (x *Task_IssueCredentialTask) SetEncryptionConfigs(v []*v2.EncryptionConfig) { + x.EncryptionConfigs = v +} + +func (x *Task_IssueCredentialTask) SetExpiresAt(v *timestamppb.Timestamp) { + x.ExpiresAt = v +} + +func (x *Task_IssueCredentialTask) HasIdentityId() bool { + if x == nil { + return false + } + return x.IdentityId != nil +} + +func (x *Task_IssueCredentialTask) HasCredentialOptions() bool { + if x == nil { + return false + } + return x.CredentialOptions != nil +} + +func (x *Task_IssueCredentialTask) HasExpiresAt() bool { + if x == nil { + return false + } + return x.ExpiresAt != nil +} + +func (x *Task_IssueCredentialTask) ClearIdentityId() { + x.IdentityId = nil +} + +func (x *Task_IssueCredentialTask) ClearCredentialOptions() { + x.CredentialOptions = nil +} + +func (x *Task_IssueCredentialTask) ClearExpiresAt() { + x.ExpiresAt = nil +} + +type Task_IssueCredentialTask_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + IdentityId *v2.ResourceId + CredentialOptions *v2.CredentialIssueOptions + EncryptionConfigs []*v2.EncryptionConfig + ExpiresAt *timestamppb.Timestamp +} + +func (b0 Task_IssueCredentialTask_builder) Build() *Task_IssueCredentialTask { + m0 := &Task_IssueCredentialTask{} + b, x := &b0, m0 + _, _ = b, x + x.IdentityId = b.IdentityId + x.CredentialOptions = b.CredentialOptions + x.EncryptionConfigs = b.EncryptionConfigs + x.ExpiresAt = b.ExpiresAt + return m0 +} + type Task_CreateTicketTask struct { state protoimpl.MessageState `protogen:"hybrid.v1"` TicketRequest *v2.TicketRequest `protobuf:"bytes,1,opt,name=ticket_request,json=ticketRequest,proto3" json:"ticket_request,omitempty"` @@ -3907,7 +4084,7 @@ type Task_CreateTicketTask struct { func (x *Task_CreateTicketTask) Reset() { *x = Task_CreateTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3919,7 +4096,7 @@ func (x *Task_CreateTicketTask) String() string { func (*Task_CreateTicketTask) ProtoMessage() {} func (x *Task_CreateTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4012,7 +4189,7 @@ type Task_BulkCreateTicketsTask struct { func (x *Task_BulkCreateTicketsTask) Reset() { *x = Task_BulkCreateTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4024,7 +4201,7 @@ func (x *Task_BulkCreateTicketsTask) String() string { func (*Task_BulkCreateTicketsTask) ProtoMessage() {} func (x *Task_BulkCreateTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4069,7 +4246,7 @@ type Task_BulkGetTicketsTask struct { func (x *Task_BulkGetTicketsTask) Reset() { *x = Task_BulkGetTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4081,7 +4258,7 @@ func (x *Task_BulkGetTicketsTask) String() string { func (*Task_BulkGetTicketsTask) ProtoMessage() {} func (x *Task_BulkGetTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4126,7 +4303,7 @@ type Task_ListTicketSchemasTask struct { func (x *Task_ListTicketSchemasTask) Reset() { *x = Task_ListTicketSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4138,7 +4315,7 @@ func (x *Task_ListTicketSchemasTask) String() string { func (*Task_ListTicketSchemasTask) ProtoMessage() {} func (x *Task_ListTicketSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4184,7 +4361,7 @@ type Task_GetTicketTask struct { func (x *Task_GetTicketTask) Reset() { *x = Task_GetTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4196,7 +4373,7 @@ func (x *Task_GetTicketTask) String() string { func (*Task_GetTicketTask) ProtoMessage() {} func (x *Task_GetTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4256,7 +4433,7 @@ type Task_ActionListSchemasTask struct { func (x *Task_ActionListSchemasTask) Reset() { *x = Task_ActionListSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4268,7 +4445,7 @@ func (x *Task_ActionListSchemasTask) String() string { func (*Task_ActionListSchemasTask) ProtoMessage() {} func (x *Task_ActionListSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4328,7 +4505,7 @@ type Task_ActionGetSchemaTask struct { func (x *Task_ActionGetSchemaTask) Reset() { *x = Task_ActionGetSchemaTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4340,7 +4517,7 @@ func (x *Task_ActionGetSchemaTask) String() string { func (*Task_ActionGetSchemaTask) ProtoMessage() {} func (x *Task_ActionGetSchemaTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4402,7 +4579,7 @@ type Task_ActionInvokeTask struct { func (x *Task_ActionInvokeTask) Reset() { *x = Task_ActionInvokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4414,7 +4591,7 @@ func (x *Task_ActionInvokeTask) String() string { func (*Task_ActionInvokeTask) ProtoMessage() {} func (x *Task_ActionInvokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4512,7 +4689,7 @@ type Task_ActionStatusTask struct { func (x *Task_ActionStatusTask) Reset() { *x = Task_ActionStatusTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4524,7 +4701,7 @@ func (x *Task_ActionStatusTask) String() string { func (*Task_ActionStatusTask) ProtoMessage() {} func (x *Task_ActionStatusTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4598,7 +4775,7 @@ type Task_CreateSyncDiffTask struct { func (x *Task_CreateSyncDiffTask) Reset() { *x = Task_CreateSyncDiffTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4610,7 +4787,7 @@ func (x *Task_CreateSyncDiffTask) String() string { func (*Task_CreateSyncDiffTask) ProtoMessage() {} func (x *Task_CreateSyncDiffTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4683,7 +4860,7 @@ type Task_CompactSyncs struct { func (x *Task_CompactSyncs) Reset() { *x = Task_CompactSyncs{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4695,7 +4872,7 @@ func (x *Task_CompactSyncs) String() string { func (*Task_CompactSyncs) ProtoMessage() {} func (x *Task_CompactSyncs) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4754,7 +4931,7 @@ type Task_CompactSyncs_CompactableSync struct { func (x *Task_CompactSyncs_CompactableSync) Reset() { *x = Task_CompactSyncs_CompactableSync{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4766,7 +4943,7 @@ func (x *Task_CompactSyncs_CompactableSync) String() string { func (*Task_CompactSyncs_CompactableSync) ProtoMessage() {} func (x *Task_CompactSyncs_CompactableSync) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4826,7 +5003,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4838,7 +5015,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[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4916,7 +5093,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4928,7 +5105,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[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5066,7 +5243,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5078,7 +5255,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[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5150,7 +5327,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5162,7 +5339,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[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5212,7 +5389,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5224,7 +5401,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[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5288,7 +5465,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[44] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5300,7 +5477,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[44] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5385,7 +5562,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[45] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5397,7 +5574,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[45] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5462,7 +5639,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xb9.\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xd51\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -5491,7 +5668,8 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12]\n" + "\x10list_event_feeds\x18y \x01(\v21.c1.connectorapi.baton.v1.Task.ListEventFeedsTaskH\x00R\x0elistEventFeeds\x12P\n" + "\vlist_events\x18z \x01(\v2-.c1.connectorapi.baton.v1.Task.ListEventsTaskH\x00R\n" + - "listEvents\x12\x14\n" + + "listEvents\x12_\n" + + "\x10issue_credential\x18{ \x01(\v22.c1.connectorapi.baton.v1.Task.IssueCredentialTaskH\x00R\x0fissueCredential\x12\x14\n" + "\x05debug\x18\x03 \x01(\bR\x05debug\x1aB\n" + "\bNoneTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1aC\n" + @@ -5543,7 +5721,14 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + "resourceId\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1a\xd5\x01\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1a\xb8\x02\n" + + "\x13IssueCredentialTask\x12<\n" + + "\videntity_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "identityId\x12V\n" + + "\x12credential_options\x18\x02 \x01(\v2'.c1.connector.v2.CredentialIssueOptionsR\x11credentialOptions\x12P\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x129\n" + + "\n" + + "expires_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x1a\xd5\x01\n" + "\x10CreateTicketTask\x12E\n" + "\x0eticket_request\x18\x01 \x01(\v2\x1e.c1.connector.v2.TicketRequestR\rticketRequest\x12B\n" + "\rticket_schema\x18\x02 \x01(\v2\x1d.c1.connector.v2.TicketSchemaR\fticketSchema\x126\n" + @@ -5695,7 +5880,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x0eStartDebugging\x12/.c1.connectorapi.baton.v1.StartDebuggingRequest\x1a0.c1.connectorapi.baton.v1.StartDebuggingResponse\"\x00B7Z5gitlab.com/ductone/c1/pkg/pb/c1/connectorapi/baton/v1b\x06proto3" 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, 46) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 47) 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 @@ -5725,40 +5910,42 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (*Task_CreateResourceTask)(nil), // 25: c1.connectorapi.baton.v1.Task.CreateResourceTask (*Task_DeleteResourceTask)(nil), // 26: c1.connectorapi.baton.v1.Task.DeleteResourceTask (*Task_RotateCredentialsTask)(nil), // 27: c1.connectorapi.baton.v1.Task.RotateCredentialsTask - (*Task_CreateTicketTask)(nil), // 28: c1.connectorapi.baton.v1.Task.CreateTicketTask - (*Task_BulkCreateTicketsTask)(nil), // 29: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - (*Task_BulkGetTicketsTask)(nil), // 30: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - (*Task_ListTicketSchemasTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - (*Task_GetTicketTask)(nil), // 32: c1.connectorapi.baton.v1.Task.GetTicketTask - (*Task_ActionListSchemasTask)(nil), // 33: c1.connectorapi.baton.v1.Task.ActionListSchemasTask - (*Task_ActionGetSchemaTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - (*Task_ActionInvokeTask)(nil), // 35: c1.connectorapi.baton.v1.Task.ActionInvokeTask - (*Task_ActionStatusTask)(nil), // 36: c1.connectorapi.baton.v1.Task.ActionStatusTask - (*Task_CreateSyncDiffTask)(nil), // 37: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - (*Task_CompactSyncs)(nil), // 38: c1.connectorapi.baton.v1.Task.CompactSyncs - (*Task_CompactSyncs_CompactableSync)(nil), // 39: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - (*BatonServiceHelloRequest_BuildInfo)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 45: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 47: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 48: google.protobuf.Any - (*durationpb.Duration)(nil), // 49: google.protobuf.Duration - (*status.Status)(nil), // 50: google.rpc.Status - (*v2.Resource)(nil), // 51: c1.connector.v2.Resource - (*timestamppb.Timestamp)(nil), // 52: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 53: c1.connector.v2.Entitlement - (*v2.Grant)(nil), // 54: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 55: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 56: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 57: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 58: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 59: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 60: c1.connector.v2.TicketSchema - (*structpb.Struct)(nil), // 61: google.protobuf.Struct + (*Task_IssueCredentialTask)(nil), // 28: c1.connectorapi.baton.v1.Task.IssueCredentialTask + (*Task_CreateTicketTask)(nil), // 29: c1.connectorapi.baton.v1.Task.CreateTicketTask + (*Task_BulkCreateTicketsTask)(nil), // 30: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + (*Task_BulkGetTicketsTask)(nil), // 31: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + (*Task_ListTicketSchemasTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + (*Task_GetTicketTask)(nil), // 33: c1.connectorapi.baton.v1.Task.GetTicketTask + (*Task_ActionListSchemasTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionListSchemasTask + (*Task_ActionGetSchemaTask)(nil), // 35: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + (*Task_ActionInvokeTask)(nil), // 36: c1.connectorapi.baton.v1.Task.ActionInvokeTask + (*Task_ActionStatusTask)(nil), // 37: c1.connectorapi.baton.v1.Task.ActionStatusTask + (*Task_CreateSyncDiffTask)(nil), // 38: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + (*Task_CompactSyncs)(nil), // 39: c1.connectorapi.baton.v1.Task.CompactSyncs + (*Task_CompactSyncs_CompactableSync)(nil), // 40: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + (*BatonServiceHelloRequest_BuildInfo)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 45: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 47: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 48: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 49: google.protobuf.Any + (*durationpb.Duration)(nil), // 50: google.protobuf.Duration + (*status.Status)(nil), // 51: google.rpc.Status + (*v2.Resource)(nil), // 52: c1.connector.v2.Resource + (*timestamppb.Timestamp)(nil), // 53: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 54: c1.connector.v2.Entitlement + (*v2.Grant)(nil), // 55: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 56: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 57: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 58: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 59: c1.connector.v2.ResourceId + (*v2.CredentialIssueOptions)(nil), // 60: c1.connector.v2.CredentialIssueOptions + (*v2.TicketRequest)(nil), // 61: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 62: c1.connector.v2.TicketSchema + (*structpb.Struct)(nil), // 63: 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 @@ -5772,108 +5959,113 @@ var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 26, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask 27, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask 19, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask - 28, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 31, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - 32, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 29, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - 30, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - 33, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask - 34, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - 35, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask - 36, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask - 37, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - 38, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs + 29, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 32, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + 33, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 30, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + 31, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + 34, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask + 35, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + 36, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask + 37, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask + 38, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + 39, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs 21, // 22: c1.connectorapi.baton.v1.Task.list_event_feeds:type_name -> c1.connectorapi.baton.v1.Task.ListEventFeedsTask 20, // 23: c1.connectorapi.baton.v1.Task.list_events:type_name -> c1.connectorapi.baton.v1.Task.ListEventsTask - 40, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 41, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 47, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 48, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 48, // 28: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any - 48, // 29: c1.connectorapi.baton.v1.BatonServiceGetTasksRequest.annotations:type_name -> google.protobuf.Any - 1, // 30: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.tasks:type_name -> c1.connectorapi.baton.v1.Task - 49, // 31: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_poll:type_name -> google.protobuf.Duration - 49, // 32: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_heartbeat:type_name -> google.protobuf.Duration - 48, // 33: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.annotations:type_name -> google.protobuf.Any - 1, // 34: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 49, // 35: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 49, // 36: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 48, // 37: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 48, // 38: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 49, // 39: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 48, // 40: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 42, // 41: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 43, // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 44, // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 48, // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 50, // 45: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 45, // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 46, // 47: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 48, // 48: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 48, // 49: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 48, // 50: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 48, // 51: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 51, // 52: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource - 48, // 53: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 52, // 54: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 48, // 55: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any - 52, // 56: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp - 48, // 57: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any - 53, // 58: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 51, // 59: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 48, // 60: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 49, // 61: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 54, // 62: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 48, // 63: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 55, // 64: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 56, // 65: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 57, // 66: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 51, // 67: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 58, // 68: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 58, // 69: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 58, // 70: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 56, // 71: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 57, // 72: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 59, // 73: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 60, // 74: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 48, // 75: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 28, // 76: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 32, // 77: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 48, // 78: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 48, // 79: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 48, // 80: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 48, // 81: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 61, // 82: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 48, // 83: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 48, // 84: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 48, // 85: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any - 39, // 86: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - 48, // 87: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any - 48, // 88: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 48, // 89: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 48, // 90: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 48, // 91: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 48, // 92: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 48, // 93: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 94: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 95: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 5, // 96: c1.connectorapi.baton.v1.BatonService.GetTasks:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksRequest - 8, // 97: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 12, // 98: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 10, // 99: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 14, // 100: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 101: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 7, // 102: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 6, // 103: c1.connectorapi.baton.v1.BatonService.GetTasks:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksResponse - 9, // 104: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 13, // 105: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 11, // 106: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 15, // 107: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 101, // [101:108] is the sub-list for method output_type - 94, // [94:101] is the sub-list for method input_type - 94, // [94:94] is the sub-list for extension type_name - 94, // [94:94] is the sub-list for extension extendee - 0, // [0:94] is the sub-list for field type_name + 28, // 24: c1.connectorapi.baton.v1.Task.issue_credential:type_name -> c1.connectorapi.baton.v1.Task.IssueCredentialTask + 41, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 42, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 48, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 49, // 28: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 49, // 29: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 49, // 30: c1.connectorapi.baton.v1.BatonServiceGetTasksRequest.annotations:type_name -> google.protobuf.Any + 1, // 31: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.tasks:type_name -> c1.connectorapi.baton.v1.Task + 50, // 32: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_poll:type_name -> google.protobuf.Duration + 50, // 33: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_heartbeat:type_name -> google.protobuf.Duration + 49, // 34: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.annotations:type_name -> google.protobuf.Any + 1, // 35: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task + 50, // 36: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 50, // 37: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 49, // 38: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 49, // 39: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 50, // 40: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 49, // 41: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 43, // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 44, // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 45, // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 49, // 45: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 51, // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 46, // 47: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 47, // 48: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 49, // 49: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 49, // 50: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 49, // 51: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 49, // 52: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 52, // 53: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource + 49, // 54: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 53, // 55: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 49, // 56: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any + 53, // 57: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp + 49, // 58: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any + 54, // 59: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 52, // 60: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 49, // 61: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 50, // 62: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 55, // 63: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 49, // 64: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 56, // 65: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 57, // 66: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 58, // 67: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 52, // 68: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource + 59, // 69: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId + 59, // 70: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 59, // 71: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 57, // 72: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 58, // 73: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 59, // 74: c1.connectorapi.baton.v1.Task.IssueCredentialTask.identity_id:type_name -> c1.connector.v2.ResourceId + 60, // 75: c1.connectorapi.baton.v1.Task.IssueCredentialTask.credential_options:type_name -> c1.connector.v2.CredentialIssueOptions + 58, // 76: c1.connectorapi.baton.v1.Task.IssueCredentialTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 53, // 77: c1.connectorapi.baton.v1.Task.IssueCredentialTask.expires_at:type_name -> google.protobuf.Timestamp + 61, // 78: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 62, // 79: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 49, // 80: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 29, // 81: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 33, // 82: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 49, // 83: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 49, // 84: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 49, // 85: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any + 49, // 86: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any + 63, // 87: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct + 49, // 88: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any + 49, // 89: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any + 49, // 90: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any + 40, // 91: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + 49, // 92: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any + 49, // 93: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 49, // 94: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 49, // 95: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 49, // 96: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 49, // 97: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 49, // 98: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 2, // 99: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest + 4, // 100: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest + 5, // 101: c1.connectorapi.baton.v1.BatonService.GetTasks:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksRequest + 8, // 102: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest + 12, // 103: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest + 10, // 104: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest + 14, // 105: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 106: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 7, // 107: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 6, // 108: c1.connectorapi.baton.v1.BatonService.GetTasks:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksResponse + 9, // 109: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 13, // 110: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 11, // 111: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 15, // 112: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 106, // [106:113] is the sub-list for method output_type + 99, // [99:106] is the sub-list for method input_type + 99, // [99:99] is the sub-list for extension type_name + 99, // [99:99] is the sub-list for extension extendee + 0, // [0:99] is the sub-list for field type_name } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } @@ -5905,6 +6097,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { (*Task_CompactSyncs_)(nil), (*Task_ListEventFeeds)(nil), (*Task_ListEvents)(nil), + (*Task_IssueCredential)(nil), } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[9].OneofWrappers = []any{ (*BatonServiceUploadAssetRequest_Metadata)(nil), @@ -5921,7 +6114,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: 46, + NumMessages: 47, 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 64ea5d8e..559b0b0d 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 @@ -1006,6 +1006,47 @@ func (m *Task) validate(all bool) error { } } + case *Task_IssueCredential: + 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.GetIssueCredential()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TaskValidationError{ + field: "IssueCredential", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TaskValidationError{ + field: "IssueCredential", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetIssueCredential()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TaskValidationError{ + field: "IssueCredential", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -5634,6 +5675,229 @@ var _ interface { ErrorName() string } = Task_RotateCredentialsTaskValidationError{} +// Validate checks the field values on Task_IssueCredentialTask 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_IssueCredentialTask) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Task_IssueCredentialTask 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_IssueCredentialTaskMultiError, or nil if none found. +func (m *Task_IssueCredentialTask) ValidateAll() error { + return m.validate(true) +} + +func (m *Task_IssueCredentialTask) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetIdentityId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: "IdentityId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: "IdentityId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetIdentityId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Task_IssueCredentialTaskValidationError{ + field: "IdentityId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCredentialOptions()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCredentialOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Task_IssueCredentialTaskValidationError{ + field: "CredentialOptions", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetEncryptionConfigs() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%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_IssueCredentialTaskValidationError{ + field: fmt.Sprintf("EncryptionConfigs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if all { + switch v := interface{}(m.GetExpiresAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Task_IssueCredentialTaskValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetExpiresAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Task_IssueCredentialTaskValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Task_IssueCredentialTaskMultiError(errors) + } + + return nil +} + +// Task_IssueCredentialTaskMultiError is an error wrapping multiple validation +// errors returned by Task_IssueCredentialTask.ValidateAll() if the designated +// constraints aren't met. +type Task_IssueCredentialTaskMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Task_IssueCredentialTaskMultiError) 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_IssueCredentialTaskMultiError) AllErrors() []error { return m } + +// Task_IssueCredentialTaskValidationError is the validation error returned by +// Task_IssueCredentialTask.Validate if the designated constraints aren't met. +type Task_IssueCredentialTaskValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Task_IssueCredentialTaskValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Task_IssueCredentialTaskValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Task_IssueCredentialTaskValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Task_IssueCredentialTaskValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Task_IssueCredentialTaskValidationError) ErrorName() string { + return "Task_IssueCredentialTaskValidationError" +} + +// Error satisfies the builtin error interface +func (e Task_IssueCredentialTaskValidationError) 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_IssueCredentialTask.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Task_IssueCredentialTaskValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Task_IssueCredentialTaskValidationError{} + // Validate checks the field values on Task_CreateTicketTask 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/connectorapi/baton/v1/baton_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go index 1165306e..833a47a4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go @@ -335,6 +335,15 @@ func (x *Task) GetListEvents() *Task_ListEventsTask { return nil } +func (x *Task) GetIssueCredential() *Task_IssueCredentialTask { + if x != nil { + if x, ok := x.xxx_hidden_TaskType.(*task_IssueCredential); ok { + return x.IssueCredential + } + } + return nil +} + func (x *Task) GetDebug() bool { if x != nil { return x.xxx_hidden_Debug @@ -534,6 +543,14 @@ func (x *Task) SetListEvents(v *Task_ListEventsTask) { x.xxx_hidden_TaskType = &task_ListEvents{v} } +func (x *Task) SetIssueCredential(v *Task_IssueCredentialTask) { + if v == nil { + x.xxx_hidden_TaskType = nil + return + } + x.xxx_hidden_TaskType = &task_IssueCredential{v} +} + func (x *Task) SetDebug(v bool) { x.xxx_hidden_Debug = v } @@ -729,6 +746,14 @@ func (x *Task) HasListEvents() bool { return ok } +func (x *Task) HasIssueCredential() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_TaskType.(*task_IssueCredential) + return ok +} + func (x *Task) ClearTaskType() { x.xxx_hidden_TaskType = nil } @@ -871,6 +896,12 @@ func (x *Task) ClearListEvents() { } } +func (x *Task) ClearIssueCredential() { + if _, ok := x.xxx_hidden_TaskType.(*task_IssueCredential); ok { + x.xxx_hidden_TaskType = nil + } +} + const Task_TaskType_not_set_case case_Task_TaskType = 0 const Task_None_case case_Task_TaskType = 100 const Task_Hello_case case_Task_TaskType = 101 @@ -895,6 +926,7 @@ const Task_CreateSyncDiff_case case_Task_TaskType = 119 const Task_CompactSyncs_case case_Task_TaskType = 120 const Task_ListEventFeeds_case case_Task_TaskType = 121 const Task_ListEvents_case case_Task_TaskType = 122 +const Task_IssueCredential_case case_Task_TaskType = 123 func (x *Task) WhichTaskType() case_Task_TaskType { if x == nil { @@ -947,6 +979,8 @@ func (x *Task) WhichTaskType() case_Task_TaskType { return Task_ListEventFeeds_case case *task_ListEvents: return Task_ListEvents_case + case *task_IssueCredential: + return Task_IssueCredential_case default: return Task_TaskType_not_set_case } @@ -981,6 +1015,7 @@ type Task_builder struct { CompactSyncs *Task_CompactSyncs ListEventFeeds *Task_ListEventFeedsTask ListEvents *Task_ListEventsTask + IssueCredential *Task_IssueCredentialTask // -- end of xxx_hidden_TaskType Debug bool } @@ -1060,6 +1095,9 @@ func (b0 Task_builder) Build() *Task { if b.ListEvents != nil { x.xxx_hidden_TaskType = &task_ListEvents{b.ListEvents} } + if b.IssueCredential != nil { + x.xxx_hidden_TaskType = &task_IssueCredential{b.IssueCredential} + } x.xxx_hidden_Debug = b.Debug return m0 } @@ -1170,6 +1208,10 @@ type task_ListEvents struct { ListEvents *Task_ListEventsTask `protobuf:"bytes,122,opt,name=list_events,json=listEvents,proto3,oneof"` } +type task_IssueCredential struct { + IssueCredential *Task_IssueCredentialTask `protobuf:"bytes,123,opt,name=issue_credential,json=issueCredential,proto3,oneof"` +} + func (*task_None) isTask_TaskType() {} func (*task_Hello) isTask_TaskType() {} @@ -1216,6 +1258,8 @@ func (*task_ListEventFeeds) isTask_TaskType() {} func (*task_ListEvents) isTask_TaskType() {} +func (*task_IssueCredential) isTask_TaskType() {} + type BatonServiceHelloRequest struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3"` @@ -3876,6 +3920,140 @@ func (b0 Task_RotateCredentialsTask_builder) Build() *Task_RotateCredentialsTask return m0 } +type Task_IssueCredentialTask struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_IdentityId *v2.ResourceId `protobuf:"bytes,1,opt,name=identity_id,json=identityId,proto3"` + xxx_hidden_CredentialOptions *v2.CredentialIssueOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3"` + xxx_hidden_EncryptionConfigs *[]*v2.EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3"` + xxx_hidden_ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_IssueCredentialTask) Reset() { + *x = Task_IssueCredentialTask{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_IssueCredentialTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_IssueCredentialTask) ProtoMessage() {} + +func (x *Task_IssueCredentialTask) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Task_IssueCredentialTask) GetIdentityId() *v2.ResourceId { + if x != nil { + return x.xxx_hidden_IdentityId + } + return nil +} + +func (x *Task_IssueCredentialTask) GetCredentialOptions() *v2.CredentialIssueOptions { + if x != nil { + return x.xxx_hidden_CredentialOptions + } + return nil +} + +func (x *Task_IssueCredentialTask) GetEncryptionConfigs() []*v2.EncryptionConfig { + if x != nil { + if x.xxx_hidden_EncryptionConfigs != nil { + return *x.xxx_hidden_EncryptionConfigs + } + } + return nil +} + +func (x *Task_IssueCredentialTask) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_ExpiresAt + } + return nil +} + +func (x *Task_IssueCredentialTask) SetIdentityId(v *v2.ResourceId) { + x.xxx_hidden_IdentityId = v +} + +func (x *Task_IssueCredentialTask) SetCredentialOptions(v *v2.CredentialIssueOptions) { + x.xxx_hidden_CredentialOptions = v +} + +func (x *Task_IssueCredentialTask) SetEncryptionConfigs(v []*v2.EncryptionConfig) { + x.xxx_hidden_EncryptionConfigs = &v +} + +func (x *Task_IssueCredentialTask) SetExpiresAt(v *timestamppb.Timestamp) { + x.xxx_hidden_ExpiresAt = v +} + +func (x *Task_IssueCredentialTask) HasIdentityId() bool { + if x == nil { + return false + } + return x.xxx_hidden_IdentityId != nil +} + +func (x *Task_IssueCredentialTask) HasCredentialOptions() bool { + if x == nil { + return false + } + return x.xxx_hidden_CredentialOptions != nil +} + +func (x *Task_IssueCredentialTask) HasExpiresAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_ExpiresAt != nil +} + +func (x *Task_IssueCredentialTask) ClearIdentityId() { + x.xxx_hidden_IdentityId = nil +} + +func (x *Task_IssueCredentialTask) ClearCredentialOptions() { + x.xxx_hidden_CredentialOptions = nil +} + +func (x *Task_IssueCredentialTask) ClearExpiresAt() { + x.xxx_hidden_ExpiresAt = nil +} + +type Task_IssueCredentialTask_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + IdentityId *v2.ResourceId + CredentialOptions *v2.CredentialIssueOptions + EncryptionConfigs []*v2.EncryptionConfig + ExpiresAt *timestamppb.Timestamp +} + +func (b0 Task_IssueCredentialTask_builder) Build() *Task_IssueCredentialTask { + m0 := &Task_IssueCredentialTask{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_IdentityId = b.IdentityId + x.xxx_hidden_CredentialOptions = b.CredentialOptions + x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs + x.xxx_hidden_ExpiresAt = b.ExpiresAt + return m0 +} + type Task_CreateTicketTask struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_TicketRequest *v2.TicketRequest `protobuf:"bytes,1,opt,name=ticket_request,json=ticketRequest,proto3"` @@ -3887,7 +4065,7 @@ type Task_CreateTicketTask struct { func (x *Task_CreateTicketTask) Reset() { *x = Task_CreateTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3899,7 +4077,7 @@ func (x *Task_CreateTicketTask) String() string { func (*Task_CreateTicketTask) ProtoMessage() {} func (x *Task_CreateTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3994,7 +4172,7 @@ type Task_BulkCreateTicketsTask struct { func (x *Task_BulkCreateTicketsTask) Reset() { *x = Task_BulkCreateTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4006,7 +4184,7 @@ func (x *Task_BulkCreateTicketsTask) String() string { func (*Task_BulkCreateTicketsTask) ProtoMessage() {} func (x *Task_BulkCreateTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4053,7 +4231,7 @@ type Task_BulkGetTicketsTask struct { func (x *Task_BulkGetTicketsTask) Reset() { *x = Task_BulkGetTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4065,7 +4243,7 @@ func (x *Task_BulkGetTicketsTask) String() string { func (*Task_BulkGetTicketsTask) ProtoMessage() {} func (x *Task_BulkGetTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4112,7 +4290,7 @@ type Task_ListTicketSchemasTask struct { func (x *Task_ListTicketSchemasTask) Reset() { *x = Task_ListTicketSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4124,7 +4302,7 @@ func (x *Task_ListTicketSchemasTask) String() string { func (*Task_ListTicketSchemasTask) ProtoMessage() {} func (x *Task_ListTicketSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4172,7 +4350,7 @@ type Task_GetTicketTask struct { func (x *Task_GetTicketTask) Reset() { *x = Task_GetTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4184,7 +4362,7 @@ func (x *Task_GetTicketTask) String() string { func (*Task_GetTicketTask) ProtoMessage() {} func (x *Task_GetTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4245,7 +4423,7 @@ type Task_ActionListSchemasTask struct { func (x *Task_ActionListSchemasTask) Reset() { *x = Task_ActionListSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4257,7 +4435,7 @@ func (x *Task_ActionListSchemasTask) String() string { func (*Task_ActionListSchemasTask) ProtoMessage() {} func (x *Task_ActionListSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4319,7 +4497,7 @@ type Task_ActionGetSchemaTask struct { func (x *Task_ActionGetSchemaTask) Reset() { *x = Task_ActionGetSchemaTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4331,7 +4509,7 @@ func (x *Task_ActionGetSchemaTask) String() string { func (*Task_ActionGetSchemaTask) ProtoMessage() {} func (x *Task_ActionGetSchemaTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4394,7 +4572,7 @@ type Task_ActionInvokeTask struct { func (x *Task_ActionInvokeTask) Reset() { *x = Task_ActionInvokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4406,7 +4584,7 @@ func (x *Task_ActionInvokeTask) String() string { func (*Task_ActionInvokeTask) ProtoMessage() {} func (x *Task_ActionInvokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4506,7 +4684,7 @@ type Task_ActionStatusTask struct { func (x *Task_ActionStatusTask) Reset() { *x = Task_ActionStatusTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4518,7 +4696,7 @@ func (x *Task_ActionStatusTask) String() string { func (*Task_ActionStatusTask) ProtoMessage() {} func (x *Task_ActionStatusTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4593,7 +4771,7 @@ type Task_CreateSyncDiffTask struct { func (x *Task_CreateSyncDiffTask) Reset() { *x = Task_CreateSyncDiffTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4605,7 +4783,7 @@ func (x *Task_CreateSyncDiffTask) String() string { func (*Task_CreateSyncDiffTask) ProtoMessage() {} func (x *Task_CreateSyncDiffTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4680,7 +4858,7 @@ type Task_CompactSyncs struct { func (x *Task_CompactSyncs) Reset() { *x = Task_CompactSyncs{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4692,7 +4870,7 @@ func (x *Task_CompactSyncs) String() string { func (*Task_CompactSyncs) ProtoMessage() {} func (x *Task_CompactSyncs) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4755,7 +4933,7 @@ type Task_CompactSyncs_CompactableSync struct { func (x *Task_CompactSyncs_CompactableSync) Reset() { *x = Task_CompactSyncs_CompactableSync{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4767,7 +4945,7 @@ func (x *Task_CompactSyncs_CompactableSync) String() string { func (*Task_CompactSyncs_CompactableSync) ProtoMessage() {} func (x *Task_CompactSyncs_CompactableSync) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4827,7 +5005,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4839,7 +5017,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[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4917,7 +5095,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4929,7 +5107,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[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5067,7 +5245,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5079,7 +5257,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[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5152,7 +5330,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5164,7 +5342,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[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5214,7 +5392,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5226,7 +5404,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[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5291,7 +5469,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[44] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5303,7 +5481,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[44] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5389,7 +5567,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[45] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5401,7 +5579,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[45] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5468,7 +5646,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xb9.\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xd51\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -5497,7 +5675,8 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12]\n" + "\x10list_event_feeds\x18y \x01(\v21.c1.connectorapi.baton.v1.Task.ListEventFeedsTaskH\x00R\x0elistEventFeeds\x12P\n" + "\vlist_events\x18z \x01(\v2-.c1.connectorapi.baton.v1.Task.ListEventsTaskH\x00R\n" + - "listEvents\x12\x14\n" + + "listEvents\x12_\n" + + "\x10issue_credential\x18{ \x01(\v22.c1.connectorapi.baton.v1.Task.IssueCredentialTaskH\x00R\x0fissueCredential\x12\x14\n" + "\x05debug\x18\x03 \x01(\bR\x05debug\x1aB\n" + "\bNoneTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1aC\n" + @@ -5549,7 +5728,14 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + "resourceId\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1a\xd5\x01\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1a\xb8\x02\n" + + "\x13IssueCredentialTask\x12<\n" + + "\videntity_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "identityId\x12V\n" + + "\x12credential_options\x18\x02 \x01(\v2'.c1.connector.v2.CredentialIssueOptionsR\x11credentialOptions\x12P\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x129\n" + + "\n" + + "expires_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x1a\xd5\x01\n" + "\x10CreateTicketTask\x12E\n" + "\x0eticket_request\x18\x01 \x01(\v2\x1e.c1.connector.v2.TicketRequestR\rticketRequest\x12B\n" + "\rticket_schema\x18\x02 \x01(\v2\x1d.c1.connector.v2.TicketSchemaR\fticketSchema\x126\n" + @@ -5701,7 +5887,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x0eStartDebugging\x12/.c1.connectorapi.baton.v1.StartDebuggingRequest\x1a0.c1.connectorapi.baton.v1.StartDebuggingResponse\"\x00B7Z5gitlab.com/ductone/c1/pkg/pb/c1/connectorapi/baton/v1b\x06proto3" 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, 46) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 47) 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 @@ -5731,40 +5917,42 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (*Task_CreateResourceTask)(nil), // 25: c1.connectorapi.baton.v1.Task.CreateResourceTask (*Task_DeleteResourceTask)(nil), // 26: c1.connectorapi.baton.v1.Task.DeleteResourceTask (*Task_RotateCredentialsTask)(nil), // 27: c1.connectorapi.baton.v1.Task.RotateCredentialsTask - (*Task_CreateTicketTask)(nil), // 28: c1.connectorapi.baton.v1.Task.CreateTicketTask - (*Task_BulkCreateTicketsTask)(nil), // 29: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - (*Task_BulkGetTicketsTask)(nil), // 30: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - (*Task_ListTicketSchemasTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - (*Task_GetTicketTask)(nil), // 32: c1.connectorapi.baton.v1.Task.GetTicketTask - (*Task_ActionListSchemasTask)(nil), // 33: c1.connectorapi.baton.v1.Task.ActionListSchemasTask - (*Task_ActionGetSchemaTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - (*Task_ActionInvokeTask)(nil), // 35: c1.connectorapi.baton.v1.Task.ActionInvokeTask - (*Task_ActionStatusTask)(nil), // 36: c1.connectorapi.baton.v1.Task.ActionStatusTask - (*Task_CreateSyncDiffTask)(nil), // 37: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - (*Task_CompactSyncs)(nil), // 38: c1.connectorapi.baton.v1.Task.CompactSyncs - (*Task_CompactSyncs_CompactableSync)(nil), // 39: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - (*BatonServiceHelloRequest_BuildInfo)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 45: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 47: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 48: google.protobuf.Any - (*durationpb.Duration)(nil), // 49: google.protobuf.Duration - (*status.Status)(nil), // 50: google.rpc.Status - (*v2.Resource)(nil), // 51: c1.connector.v2.Resource - (*timestamppb.Timestamp)(nil), // 52: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 53: c1.connector.v2.Entitlement - (*v2.Grant)(nil), // 54: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 55: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 56: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 57: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 58: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 59: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 60: c1.connector.v2.TicketSchema - (*structpb.Struct)(nil), // 61: google.protobuf.Struct + (*Task_IssueCredentialTask)(nil), // 28: c1.connectorapi.baton.v1.Task.IssueCredentialTask + (*Task_CreateTicketTask)(nil), // 29: c1.connectorapi.baton.v1.Task.CreateTicketTask + (*Task_BulkCreateTicketsTask)(nil), // 30: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + (*Task_BulkGetTicketsTask)(nil), // 31: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + (*Task_ListTicketSchemasTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + (*Task_GetTicketTask)(nil), // 33: c1.connectorapi.baton.v1.Task.GetTicketTask + (*Task_ActionListSchemasTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionListSchemasTask + (*Task_ActionGetSchemaTask)(nil), // 35: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + (*Task_ActionInvokeTask)(nil), // 36: c1.connectorapi.baton.v1.Task.ActionInvokeTask + (*Task_ActionStatusTask)(nil), // 37: c1.connectorapi.baton.v1.Task.ActionStatusTask + (*Task_CreateSyncDiffTask)(nil), // 38: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + (*Task_CompactSyncs)(nil), // 39: c1.connectorapi.baton.v1.Task.CompactSyncs + (*Task_CompactSyncs_CompactableSync)(nil), // 40: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + (*BatonServiceHelloRequest_BuildInfo)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 45: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 47: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 48: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 49: google.protobuf.Any + (*durationpb.Duration)(nil), // 50: google.protobuf.Duration + (*status.Status)(nil), // 51: google.rpc.Status + (*v2.Resource)(nil), // 52: c1.connector.v2.Resource + (*timestamppb.Timestamp)(nil), // 53: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 54: c1.connector.v2.Entitlement + (*v2.Grant)(nil), // 55: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 56: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 57: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 58: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 59: c1.connector.v2.ResourceId + (*v2.CredentialIssueOptions)(nil), // 60: c1.connector.v2.CredentialIssueOptions + (*v2.TicketRequest)(nil), // 61: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 62: c1.connector.v2.TicketSchema + (*structpb.Struct)(nil), // 63: 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 @@ -5778,108 +5966,113 @@ var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 26, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask 27, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask 19, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask - 28, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 31, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - 32, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 29, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - 30, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - 33, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask - 34, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - 35, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask - 36, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask - 37, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - 38, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs + 29, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 32, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + 33, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 30, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + 31, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + 34, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask + 35, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + 36, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask + 37, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask + 38, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + 39, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs 21, // 22: c1.connectorapi.baton.v1.Task.list_event_feeds:type_name -> c1.connectorapi.baton.v1.Task.ListEventFeedsTask 20, // 23: c1.connectorapi.baton.v1.Task.list_events:type_name -> c1.connectorapi.baton.v1.Task.ListEventsTask - 40, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 41, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 47, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 48, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 48, // 28: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any - 48, // 29: c1.connectorapi.baton.v1.BatonServiceGetTasksRequest.annotations:type_name -> google.protobuf.Any - 1, // 30: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.tasks:type_name -> c1.connectorapi.baton.v1.Task - 49, // 31: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_poll:type_name -> google.protobuf.Duration - 49, // 32: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_heartbeat:type_name -> google.protobuf.Duration - 48, // 33: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.annotations:type_name -> google.protobuf.Any - 1, // 34: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 49, // 35: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 49, // 36: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 48, // 37: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 48, // 38: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 49, // 39: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 48, // 40: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 42, // 41: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 43, // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 44, // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 48, // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 50, // 45: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 45, // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 46, // 47: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 48, // 48: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 48, // 49: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 48, // 50: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 48, // 51: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 51, // 52: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource - 48, // 53: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 52, // 54: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 48, // 55: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any - 52, // 56: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp - 48, // 57: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any - 53, // 58: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 51, // 59: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 48, // 60: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 49, // 61: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 54, // 62: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 48, // 63: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 55, // 64: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 56, // 65: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 57, // 66: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 51, // 67: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 58, // 68: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 58, // 69: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 58, // 70: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 56, // 71: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 57, // 72: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 59, // 73: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 60, // 74: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 48, // 75: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 28, // 76: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 32, // 77: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 48, // 78: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 48, // 79: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 48, // 80: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 48, // 81: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 61, // 82: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 48, // 83: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 48, // 84: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 48, // 85: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any - 39, // 86: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - 48, // 87: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any - 48, // 88: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 48, // 89: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 48, // 90: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 48, // 91: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 48, // 92: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 48, // 93: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 94: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 95: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 5, // 96: c1.connectorapi.baton.v1.BatonService.GetTasks:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksRequest - 8, // 97: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 12, // 98: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 10, // 99: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 14, // 100: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 101: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 7, // 102: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 6, // 103: c1.connectorapi.baton.v1.BatonService.GetTasks:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksResponse - 9, // 104: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 13, // 105: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 11, // 106: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 15, // 107: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 101, // [101:108] is the sub-list for method output_type - 94, // [94:101] is the sub-list for method input_type - 94, // [94:94] is the sub-list for extension type_name - 94, // [94:94] is the sub-list for extension extendee - 0, // [0:94] is the sub-list for field type_name + 28, // 24: c1.connectorapi.baton.v1.Task.issue_credential:type_name -> c1.connectorapi.baton.v1.Task.IssueCredentialTask + 41, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 42, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 48, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 49, // 28: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 49, // 29: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 49, // 30: c1.connectorapi.baton.v1.BatonServiceGetTasksRequest.annotations:type_name -> google.protobuf.Any + 1, // 31: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.tasks:type_name -> c1.connectorapi.baton.v1.Task + 50, // 32: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_poll:type_name -> google.protobuf.Duration + 50, // 33: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.next_heartbeat:type_name -> google.protobuf.Duration + 49, // 34: c1.connectorapi.baton.v1.BatonServiceGetTasksResponse.annotations:type_name -> google.protobuf.Any + 1, // 35: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task + 50, // 36: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 50, // 37: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 49, // 38: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 49, // 39: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 50, // 40: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 49, // 41: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 43, // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 44, // 43: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 45, // 44: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 49, // 45: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 51, // 46: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 46, // 47: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 47, // 48: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 49, // 49: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 49, // 50: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 49, // 51: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 49, // 52: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 52, // 53: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource + 49, // 54: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 53, // 55: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 49, // 56: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any + 53, // 57: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp + 49, // 58: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any + 54, // 59: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 52, // 60: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 49, // 61: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 50, // 62: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 55, // 63: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 49, // 64: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 56, // 65: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 57, // 66: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 58, // 67: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 52, // 68: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource + 59, // 69: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId + 59, // 70: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 59, // 71: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 57, // 72: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 58, // 73: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 59, // 74: c1.connectorapi.baton.v1.Task.IssueCredentialTask.identity_id:type_name -> c1.connector.v2.ResourceId + 60, // 75: c1.connectorapi.baton.v1.Task.IssueCredentialTask.credential_options:type_name -> c1.connector.v2.CredentialIssueOptions + 58, // 76: c1.connectorapi.baton.v1.Task.IssueCredentialTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 53, // 77: c1.connectorapi.baton.v1.Task.IssueCredentialTask.expires_at:type_name -> google.protobuf.Timestamp + 61, // 78: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 62, // 79: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 49, // 80: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 29, // 81: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 33, // 82: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 49, // 83: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 49, // 84: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 49, // 85: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any + 49, // 86: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any + 63, // 87: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct + 49, // 88: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any + 49, // 89: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any + 49, // 90: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any + 40, // 91: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + 49, // 92: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any + 49, // 93: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 49, // 94: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 49, // 95: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 49, // 96: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 49, // 97: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 49, // 98: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 2, // 99: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest + 4, // 100: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest + 5, // 101: c1.connectorapi.baton.v1.BatonService.GetTasks:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksRequest + 8, // 102: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest + 12, // 103: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest + 10, // 104: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest + 14, // 105: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 106: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 7, // 107: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 6, // 108: c1.connectorapi.baton.v1.BatonService.GetTasks:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTasksResponse + 9, // 109: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 13, // 110: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 11, // 111: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 15, // 112: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 106, // [106:113] is the sub-list for method output_type + 99, // [99:106] is the sub-list for method input_type + 99, // [99:99] is the sub-list for extension type_name + 99, // [99:99] is the sub-list for extension extendee + 0, // [0:99] is the sub-list for field type_name } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } @@ -5911,6 +6104,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { (*task_CompactSyncs_)(nil), (*task_ListEventFeeds)(nil), (*task_ListEvents)(nil), + (*task_IssueCredential)(nil), } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[9].OneofWrappers = []any{ (*batonServiceUploadAssetRequest_Metadata)(nil), @@ -5927,7 +6121,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: 46, + NumMessages: 47, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.go index c1332de6..dd5cdfaf 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.go @@ -1470,9 +1470,21 @@ type SyncRunRecord struct { // (full-fetch) sync. Orchestrators deciding which artifact to // materialize as the previous sync should apply the same predicate // instead of guessing from provenance. - Compacted bool `protobuf:"varint,9,opt,name=compacted,proto3" json:"compacted,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Compacted bool `protobuf:"varint,9,opt,name=compacted,proto3" json:"compacted,omitempty"` + // Persisted proof that the post-collection ingestion-invariant pass + // completed successfully before this sync was sealed. Empty generation + // means the artifact predates verification metadata (or was produced by a + // path that did not run the pass). Coverage names only checks that actually + // ran; engines without the inspection surface therefore record a subset + // rather than claiming full verification. + IngestInvariantGeneration string `protobuf:"bytes,10,opt,name=ingest_invariant_generation,json=ingestInvariantGeneration,proto3" json:"ingest_invariant_generation,omitempty"` + IngestInvariantCoverage []string `protobuf:"bytes,11,rep,name=ingest_invariant_coverage,json=ingestInvariantCoverage,proto3" json:"ingest_invariant_coverage,omitempty"` + // "connector" applies the ordinary connector-ingest verdict policy; + // "compaction_merge" applies the policy for a pre-sealed keep-newer merge. + // Empty when ingest_invariant_generation is empty. + IngestInvariantMode string `protobuf:"bytes,12,opt,name=ingest_invariant_mode,json=ingestInvariantMode,proto3" json:"ingest_invariant_mode,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncRunRecord) Reset() { @@ -1563,6 +1575,27 @@ func (x *SyncRunRecord) GetCompacted() bool { return false } +func (x *SyncRunRecord) GetIngestInvariantGeneration() string { + if x != nil { + return x.IngestInvariantGeneration + } + return "" +} + +func (x *SyncRunRecord) GetIngestInvariantCoverage() []string { + if x != nil { + return x.IngestInvariantCoverage + } + return nil +} + +func (x *SyncRunRecord) GetIngestInvariantMode() string { + if x != nil { + return x.IngestInvariantMode + } + return "" +} + func (x *SyncRunRecord) SetSyncId(v string) { x.SyncId = v } @@ -1599,6 +1632,18 @@ func (x *SyncRunRecord) SetCompacted(v bool) { x.Compacted = v } +func (x *SyncRunRecord) SetIngestInvariantGeneration(v string) { + x.IngestInvariantGeneration = v +} + +func (x *SyncRunRecord) SetIngestInvariantCoverage(v []string) { + x.IngestInvariantCoverage = v +} + +func (x *SyncRunRecord) SetIngestInvariantMode(v string) { + x.IngestInvariantMode = v +} + func (x *SyncRunRecord) HasStartedAt() bool { if x == nil { return false @@ -1646,6 +1691,18 @@ type SyncRunRecord_builder struct { // materialize as the previous sync should apply the same predicate // instead of guessing from provenance. Compacted bool + // Persisted proof that the post-collection ingestion-invariant pass + // completed successfully before this sync was sealed. Empty generation + // means the artifact predates verification metadata (or was produced by a + // path that did not run the pass). Coverage names only checks that actually + // ran; engines without the inspection surface therefore record a subset + // rather than claiming full verification. + IngestInvariantGeneration string + IngestInvariantCoverage []string + // "connector" applies the ordinary connector-ingest verdict policy; + // "compaction_merge" applies the policy for a pre-sealed keep-newer merge. + // Empty when ingest_invariant_generation is empty. + IngestInvariantMode string } func (b0 SyncRunRecord_builder) Build() *SyncRunRecord { @@ -1661,6 +1718,9 @@ func (b0 SyncRunRecord_builder) Build() *SyncRunRecord { x.SupportsDiff = b.SupportsDiff x.LinkedSyncId = b.LinkedSyncId x.Compacted = b.Compacted + x.IngestInvariantGeneration = b.IngestInvariantGeneration + x.IngestInvariantCoverage = b.IngestInvariantCoverage + x.IngestInvariantMode = b.IngestInvariantMode return m0 } @@ -2522,7 +2582,7 @@ const file_c1_storage_v3_records_proto_rawDesc = "" + "\fcontent_type\x18\x03 \x01(\tR\vcontentType\x12\x12\n" + "\x04data\x18\x04 \x01(\fR\x04data\x12?\n" + "\rdiscovered_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\fdiscoveredAt:\"\x82\xf9+\x1e\n" + - "\x06assets\x12\async_id\x12\vexternal_id\"\x8f\x03\n" + + "\x06assets\x12\async_id\x12\vexternal_id\"\xbf\x04\n" + "\rSyncRunRecord\x12\x17\n" + "\async_id\x18\x01 \x01(\tR\x06syncId\x12+\n" + "\x04type\x18\x02 \x01(\x0e2\x17.c1.storage.v3.SyncTypeR\x04type\x12$\n" + @@ -2534,7 +2594,11 @@ const file_c1_storage_v3_records_proto_rawDesc = "" + "sync_token\x18\x06 \x01(\tR\tsyncToken\x12#\n" + "\rsupports_diff\x18\a \x01(\bR\fsupportsDiff\x12$\n" + "\x0elinked_sync_id\x18\b \x01(\tR\flinkedSyncId\x12\x1c\n" + - "\tcompacted\x18\t \x01(\bR\tcompacted:\x18\x82\xf9+\x14\n" + + "\tcompacted\x18\t \x01(\bR\tcompacted\x12>\n" + + "\x1bingest_invariant_generation\x18\n" + + " \x01(\tR\x19ingestInvariantGeneration\x12:\n" + + "\x19ingest_invariant_coverage\x18\v \x03(\tR\x17ingestInvariantCoverage\x122\n" + + "\x15ingest_invariant_mode\x18\f \x01(\tR\x13ingestInvariantMode:\x18\x82\xf9+\x14\n" + "\tsync_runs\x12\async_id\"\xb4\v\n" + "\x0fSyncStatsRecord\x12\x17\n" + "\async_id\x18\x01 \x01(\tR\x06syncId\x12%\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.validate.go index 8e93c6a1..695c9d9c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records.pb.validate.go @@ -1551,6 +1551,10 @@ func (m *SyncRunRecord) validate(all bool) error { // no validation rules for Compacted + // no validation rules for IngestInvariantGeneration + + // no validation rules for IngestInvariantMode + if len(errors) > 0 { return SyncRunRecordMultiError(errors) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records_protoopaque.pb.go index 39263671..dad1ab1e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/storage/v3/records_protoopaque.pb.go @@ -1407,18 +1407,21 @@ func (b0 AssetRecord_builder) Build() *AssetRecord { } type SyncRunRecord struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3"` - xxx_hidden_Type SyncType `protobuf:"varint,2,opt,name=type,proto3,enum=c1.storage.v3.SyncType"` - xxx_hidden_ParentSyncId string `protobuf:"bytes,3,opt,name=parent_sync_id,json=parentSyncId,proto3"` - xxx_hidden_StartedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=started_at,json=startedAt,proto3"` - xxx_hidden_EndedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=ended_at,json=endedAt,proto3"` - xxx_hidden_SyncToken string `protobuf:"bytes,6,opt,name=sync_token,json=syncToken,proto3"` - xxx_hidden_SupportsDiff bool `protobuf:"varint,7,opt,name=supports_diff,json=supportsDiff,proto3"` - xxx_hidden_LinkedSyncId string `protobuf:"bytes,8,opt,name=linked_sync_id,json=linkedSyncId,proto3"` - xxx_hidden_Compacted bool `protobuf:"varint,9,opt,name=compacted,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_SyncId string `protobuf:"bytes,1,opt,name=sync_id,json=syncId,proto3"` + xxx_hidden_Type SyncType `protobuf:"varint,2,opt,name=type,proto3,enum=c1.storage.v3.SyncType"` + xxx_hidden_ParentSyncId string `protobuf:"bytes,3,opt,name=parent_sync_id,json=parentSyncId,proto3"` + xxx_hidden_StartedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=started_at,json=startedAt,proto3"` + xxx_hidden_EndedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=ended_at,json=endedAt,proto3"` + xxx_hidden_SyncToken string `protobuf:"bytes,6,opt,name=sync_token,json=syncToken,proto3"` + xxx_hidden_SupportsDiff bool `protobuf:"varint,7,opt,name=supports_diff,json=supportsDiff,proto3"` + xxx_hidden_LinkedSyncId string `protobuf:"bytes,8,opt,name=linked_sync_id,json=linkedSyncId,proto3"` + xxx_hidden_Compacted bool `protobuf:"varint,9,opt,name=compacted,proto3"` + xxx_hidden_IngestInvariantGeneration string `protobuf:"bytes,10,opt,name=ingest_invariant_generation,json=ingestInvariantGeneration,proto3"` + xxx_hidden_IngestInvariantCoverage []string `protobuf:"bytes,11,rep,name=ingest_invariant_coverage,json=ingestInvariantCoverage,proto3"` + xxx_hidden_IngestInvariantMode string `protobuf:"bytes,12,opt,name=ingest_invariant_mode,json=ingestInvariantMode,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncRunRecord) Reset() { @@ -1509,6 +1512,27 @@ func (x *SyncRunRecord) GetCompacted() bool { return false } +func (x *SyncRunRecord) GetIngestInvariantGeneration() string { + if x != nil { + return x.xxx_hidden_IngestInvariantGeneration + } + return "" +} + +func (x *SyncRunRecord) GetIngestInvariantCoverage() []string { + if x != nil { + return x.xxx_hidden_IngestInvariantCoverage + } + return nil +} + +func (x *SyncRunRecord) GetIngestInvariantMode() string { + if x != nil { + return x.xxx_hidden_IngestInvariantMode + } + return "" +} + func (x *SyncRunRecord) SetSyncId(v string) { x.xxx_hidden_SyncId = v } @@ -1545,6 +1569,18 @@ func (x *SyncRunRecord) SetCompacted(v bool) { x.xxx_hidden_Compacted = v } +func (x *SyncRunRecord) SetIngestInvariantGeneration(v string) { + x.xxx_hidden_IngestInvariantGeneration = v +} + +func (x *SyncRunRecord) SetIngestInvariantCoverage(v []string) { + x.xxx_hidden_IngestInvariantCoverage = v +} + +func (x *SyncRunRecord) SetIngestInvariantMode(v string) { + x.xxx_hidden_IngestInvariantMode = v +} + func (x *SyncRunRecord) HasStartedAt() bool { if x == nil { return false @@ -1592,6 +1628,18 @@ type SyncRunRecord_builder struct { // materialize as the previous sync should apply the same predicate // instead of guessing from provenance. Compacted bool + // Persisted proof that the post-collection ingestion-invariant pass + // completed successfully before this sync was sealed. Empty generation + // means the artifact predates verification metadata (or was produced by a + // path that did not run the pass). Coverage names only checks that actually + // ran; engines without the inspection surface therefore record a subset + // rather than claiming full verification. + IngestInvariantGeneration string + IngestInvariantCoverage []string + // "connector" applies the ordinary connector-ingest verdict policy; + // "compaction_merge" applies the policy for a pre-sealed keep-newer merge. + // Empty when ingest_invariant_generation is empty. + IngestInvariantMode string } func (b0 SyncRunRecord_builder) Build() *SyncRunRecord { @@ -1607,6 +1655,9 @@ func (b0 SyncRunRecord_builder) Build() *SyncRunRecord { x.xxx_hidden_SupportsDiff = b.SupportsDiff x.xxx_hidden_LinkedSyncId = b.LinkedSyncId x.xxx_hidden_Compacted = b.Compacted + x.xxx_hidden_IngestInvariantGeneration = b.IngestInvariantGeneration + x.xxx_hidden_IngestInvariantCoverage = b.IngestInvariantCoverage + x.xxx_hidden_IngestInvariantMode = b.IngestInvariantMode return m0 } @@ -2435,7 +2486,7 @@ const file_c1_storage_v3_records_proto_rawDesc = "" + "\fcontent_type\x18\x03 \x01(\tR\vcontentType\x12\x12\n" + "\x04data\x18\x04 \x01(\fR\x04data\x12?\n" + "\rdiscovered_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\fdiscoveredAt:\"\x82\xf9+\x1e\n" + - "\x06assets\x12\async_id\x12\vexternal_id\"\x8f\x03\n" + + "\x06assets\x12\async_id\x12\vexternal_id\"\xbf\x04\n" + "\rSyncRunRecord\x12\x17\n" + "\async_id\x18\x01 \x01(\tR\x06syncId\x12+\n" + "\x04type\x18\x02 \x01(\x0e2\x17.c1.storage.v3.SyncTypeR\x04type\x12$\n" + @@ -2447,7 +2498,11 @@ const file_c1_storage_v3_records_proto_rawDesc = "" + "sync_token\x18\x06 \x01(\tR\tsyncToken\x12#\n" + "\rsupports_diff\x18\a \x01(\bR\fsupportsDiff\x12$\n" + "\x0elinked_sync_id\x18\b \x01(\tR\flinkedSyncId\x12\x1c\n" + - "\tcompacted\x18\t \x01(\bR\tcompacted:\x18\x82\xf9+\x14\n" + + "\tcompacted\x18\t \x01(\bR\tcompacted\x12>\n" + + "\x1bingest_invariant_generation\x18\n" + + " \x01(\tR\x19ingestInvariantGeneration\x12:\n" + + "\x19ingest_invariant_coverage\x18\v \x03(\tR\x17ingestInvariantCoverage\x122\n" + + "\x15ingest_invariant_mode\x18\f \x01(\tR\x13ingestInvariantMode:\x18\x82\xf9+\x14\n" + "\tsync_runs\x12\async_id\"\xb4\v\n" + "\x0fSyncStatsRecord\x12\x17\n" + "\async_id\x18\x01 \x01(\tR\x06syncId\x12%\n" + 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 223beb01..a64d4b58 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go @@ -86,6 +86,7 @@ type builder struct { resourceDeleters map[string]ResourceDeleterV2Limited resourceTargetedSyncers map[string]ResourceTargetedSyncerLimited credentialManagers map[string]CredentialManagerLimited + credentialIssuers map[string]CredentialIssuerLimited eventFeeds map[string]EventFeed accountManagers map[string]AccountManagerLimited actionManager ActionManager // Unified action manager for all actions @@ -125,6 +126,7 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne resourceDeleters: make(map[string]ResourceDeleterV2Limited), resourceTargetedSyncers: make(map[string]ResourceTargetedSyncerLimited), credentialManagers: make(map[string]CredentialManagerLimited), + credentialIssuers: make(map[string]CredentialIssuerLimited), eventFeeds: make(map[string]EventFeed), accountManagers: make(map[string]AccountManagerLimited), actionManager: actionMgr, @@ -190,6 +192,10 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne return err } + if err := b.addCredentialIssuer(ctx, rType, rs); err != nil { + return err + } + return nil } @@ -406,6 +412,10 @@ func (b *builder) GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilitie caps = append(caps, v2.Capability_CAPABILITY_CREDENTIAL_ROTATION) } + if _, exists := b.credentialIssuers[resourceTypeID]; exists { + caps = append(caps, v2.Capability_CAPABILITY_CREDENTIAL_ISSUE) + } + // Extend the capabilities with the resource type specificcapabilities for _, cap := range caps { connectorCaps[cap] = struct{}{} @@ -418,6 +428,24 @@ func (b *builder) GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilitie if err != nil { return nil, err } + var issueDetails *v2.CredentialDetailsCredentialIssue + if issuer, exists := b.credentialIssuers[resourceTypeID]; exists { + issueDetails, _, err = issuer.IssueCapabilityDetails(ctx) + if err != nil { + return nil, fmt.Errorf("error: getting credential issuance details for %s: %w", resourceTypeID, err) + } + if err := validateCredentialIssueCapabilityDetails(issueDetails); err != nil { + return nil, fmt.Errorf("error: validating credential issuance details for %s: %w", resourceTypeID, err) + } + for _, descriptor := range issueDetails.GetOptions() { + secretType := descriptor.GetSecretResourceTypeId() + _, managerDeletes := b.resourceManagers[secretType] + _, deleterExists := b.resourceDeleters[secretType] + if !managerDeletes && !deleterExists { + return nil, fmt.Errorf("credential issue option %s returns secret resource type %q without ResourceDeleterV2", descriptor.GetOption(), secretType) + } + } + } resourceTypeCapabilities = append(resourceTypeCapabilities, v2.ResourceTypeCapability_builder{ ResourceType: rb.ResourceType(ctx), @@ -425,6 +453,7 @@ func (b *builder) GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilitie Permissions: p, OptInRequired: annos.Contains(&v2.OptInRequired{}), SkipSyncAnomalyDetection: annos.Contains(&v2.SkipSyncAnomalyDetection{}), + CredentialIssue: issueDetails, }.Build()) } @@ -490,6 +519,96 @@ func validateCapabilityDetails(_ context.Context, credDetails *v2.CredentialDeta return nil } +func validateCredentialIssueCapabilityDetails(issue *v2.CredentialDetailsCredentialIssue) error { + if issue == nil || issue.GetPreferredOption() == v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED { + return status.Error(codes.InvalidArgument, "preferred credential issue option is not set") + } + seen := make(map[v2.CapabilityDetailCredentialOption]struct{}, len(issue.GetOptions())) + for _, descriptor := range issue.GetOptions() { + if descriptor == nil || descriptor.GetOption() == v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED { + return status.Error(codes.InvalidArgument, "credential issue option descriptor is invalid") + } + if descriptor.GetResourceMode() == v2.CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED { + return status.Error(codes.InvalidArgument, "credential issue resource mode is not set") + } + if descriptor.GetSecretResourceTypeId() == "" { + return status.Error(codes.InvalidArgument, "credential issue secret resource type is not set") + } + if err := validateCredentialIssueDescriptorShape(descriptor); err != nil { + return status.Errorf(codes.InvalidArgument, "invalid credential issue option %s: %v", descriptor.GetOption(), err) + } + for _, profile := range descriptor.GetKeyProfiles() { + if err := validateKeyGenerationProfile(profile); err != nil { + return status.Errorf(codes.InvalidArgument, "invalid credential issue key profile: %v", err) + } + } + if err := validateIssuanceExpiryCapability(descriptor.GetExpiry()); err != nil { + return status.Errorf(codes.InvalidArgument, "invalid credential issue expiry capability: %v", err) + } + if _, exists := seen[descriptor.GetOption()]; exists { + return status.Errorf(codes.InvalidArgument, "duplicate credential issue option %s", descriptor.GetOption()) + } + seen[descriptor.GetOption()] = struct{}{} + } + if _, ok := seen[issue.GetPreferredOption()]; !ok { + return status.Error(codes.InvalidArgument, "preferred credential issue option is not part of the supported options") + } + return nil +} + +func validateCredentialIssueDescriptorShape(descriptor *v2.CredentialIssueOptionDescriptor) error { + hasScopes := len(descriptor.GetScopes()) != 0 || descriptor.GetCustomScopesAllowed() + hasAudiences := len(descriptor.GetAudiences()) != 0 || descriptor.GetCustomAudiencesAllowed() + hasKeyProfiles := len(descriptor.GetKeyProfiles()) != 0 + switch descriptor.GetOption() { + case v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY: + if hasKeyProfiles || hasAudiences { + return fmt.Errorf("API key options may only advertise scopes and expiry") + } + case v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR: + if !hasKeyProfiles { + return fmt.Errorf("keypair options must advertise at least one key profile") + } + if hasScopes || hasAudiences { + return fmt.Errorf("keypair options may only advertise key profiles and expiry") + } + case v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN: + if hasKeyProfiles { + return fmt.Errorf("token options may only advertise scopes, audiences, and expiry") + } + case v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET: + if hasKeyProfiles || hasScopes || hasAudiences { + return fmt.Errorf("client secret options may only advertise expiry") + } + default: + return fmt.Errorf("unsupported issuance option") + } + return nil +} + +func validateIssuanceExpiryCapability(capability *v2.IssuanceExpiryCapability) error { + if capability == nil { + return nil + } + var minDuration, maxDuration time.Duration + if capability.GetMin() != nil { + if err := capability.GetMin().CheckValid(); err != nil || capability.GetMin().AsDuration() <= 0 { + return fmt.Errorf("minimum must be a valid positive duration") + } + minDuration = capability.GetMin().AsDuration() + } + if capability.GetMax() != nil { + if err := capability.GetMax().CheckValid(); err != nil || capability.GetMax().AsDuration() <= 0 { + return fmt.Errorf("maximum must be a valid positive duration") + } + maxDuration = capability.GetMax().AsDuration() + } + if minDuration != 0 && maxDuration != 0 && minDuration > maxDuration { + return fmt.Errorf("minimum must not exceed maximum") + } + return nil +} + func getCredentialDetails(ctx context.Context, b *builder) (*v2.CredentialDetails, error) { l := ctxzap.Extract(ctx) rv := &v2.CredentialDetails{} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credential_issue_validation.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credential_issue_validation.go new file mode 100644 index 00000000..7e2c757b --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credential_issue_validation.go @@ -0,0 +1,145 @@ +package connectorbuilder + +import ( + "fmt" + "regexp" + "slices" + "strings" + "time" + + v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "google.golang.org/protobuf/proto" +) + +var credentialIssueRequestIDPattern = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) + +func credentialIssueOptionKind(options *v2.CredentialIssueOptions) v2.CapabilityDetailCredentialOption { + if options == nil { + return v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED + } + switch options.WhichOptions() { + case v2.CredentialIssueOptions_ApiKey_case: + return v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_API_KEY + case v2.CredentialIssueOptions_Keypair_case: + return v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_KEYPAIR + case v2.CredentialIssueOptions_Token_case: + return v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_TOKEN + case v2.CredentialIssueOptions_ClientSecret_case: + return v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_CLIENT_SECRET + default: + return v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED + } +} + +func validateCredentialIssueInput(input *CredentialIssueInput, details *v2.CredentialDetailsCredentialIssue, now time.Time) (*v2.CredentialIssueOptionDescriptor, error) { + if input == nil || input.IdentityID == nil { + return nil, fmt.Errorf("identity id is required") + } + if len(input.RequestID) == 0 || len(input.RequestID) > 128 || !credentialIssueRequestIDPattern.MatchString(input.RequestID) { + return nil, fmt.Errorf("request id must be 1..128 characters containing only letters, digits, underscore, or hyphen") + } + kind := credentialIssueOptionKind(input.CredentialOptions) + if kind == v2.CapabilityDetailCredentialOption_CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED { + return nil, fmt.Errorf("unsupported credential option") + } + var descriptor *v2.CredentialIssueOptionDescriptor + for _, candidate := range details.GetOptions() { + if candidate.GetOption() == kind { + descriptor = candidate + break + } + } + if descriptor == nil { + return nil, fmt.Errorf("credential option %s is not advertised by connector", kind) + } + if descriptor.GetResourceMode() == v2.CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED { + return nil, fmt.Errorf("credential resource mode must be advertised") + } + if keypair := input.CredentialOptions.GetKeypair(); keypair != nil { + if err := validateKeyGenerationProfile(keypair.GetProfile()); err != nil { + return nil, err + } + if !slices.ContainsFunc(descriptor.GetKeyProfiles(), func(profile *v2.KeyGenerationProfile) bool { + return proto.Equal(profile, keypair.GetProfile()) + }) { + return nil, fmt.Errorf("requested key generation profile is not advertised by connector") + } + } + if apiKey := input.CredentialOptions.GetApiKey(); apiKey != nil { + if err := validateRequestedValues("scope", apiKey.GetScopes(), descriptor.GetScopes(), descriptor.GetCustomScopesAllowed()); err != nil { + return nil, err + } + } + if token := input.CredentialOptions.GetToken(); token != nil { + if err := validateRequestedValues("scope", token.GetScopes(), descriptor.GetScopes(), descriptor.GetCustomScopesAllowed()); err != nil { + return nil, err + } + if err := validateRequestedValues("audience", token.GetAudiences(), descriptor.GetAudiences(), descriptor.GetCustomAudiencesAllowed()); err != nil { + return nil, err + } + } + if input.ExpiresAt != nil { + if err := input.ExpiresAt.CheckValid(); err != nil { + return nil, fmt.Errorf("expires_at must be valid: %w", err) + } + remaining := input.ExpiresAt.AsTime().Sub(now) + if remaining <= 0 { + return nil, fmt.Errorf("expires_at must be in the future") + } + capability := descriptor.GetExpiry() + if capability == nil { + return nil, fmt.Errorf("connector does not support caller-selected expiry") + } + if capability.GetMin() != nil && remaining < capability.GetMin().AsDuration() { + return nil, fmt.Errorf("requested expiry is below connector minimum") + } + if capability.GetMax() != nil && remaining > capability.GetMax().AsDuration() { + return nil, fmt.Errorf("requested expiry exceeds connector maximum") + } + } + return descriptor, nil +} + +func validateRequestedValues(kind string, requested []string, advertised []string, customAllowed bool) error { + seen := make(map[string]struct{}, len(requested)) + for _, value := range requested { + if strings.TrimSpace(value) == "" { + return fmt.Errorf("%s must not be empty", kind) + } + if _, ok := seen[value]; ok { + return fmt.Errorf("duplicate %s %q", kind, value) + } + seen[value] = struct{}{} + if !customAllowed && !slices.Contains(advertised, value) { + return fmt.Errorf("%s %q is not advertised by connector", kind, value) + } + } + return nil +} + +func validateKeyGenerationProfile(profile *v2.KeyGenerationProfile) error { + if profile == nil { + return fmt.Errorf("key generation profile is required") + } + switch profile.GetKty() { + case "RSA": + if !profile.HasRsaModulusBits() || profile.HasCrv() { + return fmt.Errorf("RSA profile requires rsa_modulus_bits and no curve") + } + bits := profile.GetRsaModulusBits() + if bits < 2048 || bits > 16384 || bits%256 != 0 { + return fmt.Errorf("RSA modulus bits must be 2048..16384 in 256-bit increments") + } + case "EC": + if !profile.HasCrv() || profile.HasRsaModulusBits() || !slices.Contains([]string{"P-256", "P-384", "P-521"}, profile.GetCrv()) { + return fmt.Errorf("EC profile requires a recognized P-256, P-384, or P-521 curve") + } + case "OKP": + if !profile.HasCrv() || profile.HasRsaModulusBits() || !slices.Contains([]string{"Ed25519", "Ed448", "X25519", "X448"}, profile.GetCrv()) { + return fmt.Errorf("OKP profile requires a recognized curve") + } + default: + return fmt.Errorf("unsupported JWK key type %q", profile.GetKty()) + } + return nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go index 0335ce3b..09f524d9 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go @@ -3,6 +3,7 @@ package connectorbuilder import ( "context" "fmt" + "strings" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "github.com/conductorone/baton-sdk/pkg/annotations" @@ -13,6 +14,8 @@ import ( "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // CredentialManager extends ResourceSyncer to add capabilities for managing credentials. @@ -107,3 +110,202 @@ func (b *builder) addCredentialManager(_ context.Context, typeId string, in inte } return nil } + +// CredentialIssuer extends ResourceSyncer to add the capability to mint a NEW +// credential for an existing identity (e.g. a service-account key/token), +// distinct from rotating the single credential on a resource. It is a separate, +// additive interface so existing CredentialManager implementations are +// unaffected — a connector opts in to issuance only by implementing it. +type CredentialIssuer interface { + ResourceSyncer + CredentialIssuerLimited +} + +// CredentialIssuerV2 is the ResourceSyncerV2 variant implemented by modern +// connectors. It advertises the same issuance contract without forcing a V2 +// syncer to also implement the legacy pagination interface. +type CredentialIssuerV2 interface { + ResourceSyncerV2 + CredentialIssuerLimited +} + +type CredentialIssuerLimited interface { + // Issue mints a new credential for identityId and returns the newly created + // secret resource alongside the plaintext material. The builder encrypts the + // plaintext per the request's EncryptionConfigs before it leaves the + // connector — for client-side keypair generation the returned PlaintextData + // carries the private key, which the platform receives only in encrypted form. + Issue(ctx context.Context, input *CredentialIssueInput) (*CredentialIssueOutput, error) + IssueCapabilityDetails(ctx context.Context) (*v2.CredentialDetailsCredentialIssue, annotations.Annotations, error) +} + +// CredentialIssueInput is the connector-facing issuance contract. Keeping the +// request structured lets the SDK add portable constraints without repeatedly +// breaking every connector implementation. +type CredentialIssueInput struct { + IdentityID *v2.ResourceId + CredentialOptions *v2.CredentialIssueOptions + ExpiresAt *timestamppb.Timestamp + RequestID string +} + +type CredentialIssueOutput struct { + Secret *v2.Resource + PlaintextData []*v2.PlaintextData + Annotations annotations.Annotations + ResourceMode v2.CredentialResourceMode +} + +func (b *builder) IssueCredential(ctx context.Context, request *v2.IssueCredentialRequest) (*v2.IssueCredentialResponse, error) { + ctx, span := tracer.Start(ctx, "builder.IssueCredential") + var err error + defer func() { uotel.EndSpanWithError(span, err) }() + + start := b.nowFunc() + tt := tasks.IssueCredentialType + l := ctxzap.Extract(ctx) + if request == nil || request.GetIdentityId() == nil { + err = status.Error(codes.InvalidArgument, "identity id is required") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err + } + rt := request.GetIdentityId().GetResourceType() + issuer, ok := b.credentialIssuers[rt] + if !ok { + l.Error("error: resource type does not have credential issuer configured", zap.String("resource_type", rt)) + err = status.Error(codes.Unimplemented, "resource type does not have credential issuer configured") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err + } + if len(request.GetEncryptionConfigs()) == 0 { + err = status.Error(codes.InvalidArgument, "at least one encryption config is required for credential issuance") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err + } + + // Validate recipients before asking the connector to mutate the provider. + // A later transport or encryption failure can still be ambiguous, so service + // task execution deliberately does not retry issuance automatically. + err = crypto.ValidateEncryptionConfigs(request.GetEncryptionConfigs()) + if err != nil { + l.Error("error: creating encryption manager failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, fmt.Errorf("error: creating encryption manager failed: %w", err) + } + pkem, err := crypto.NewEncryptionManager(nil, request.GetEncryptionConfigs()) + if err != nil { + l.Error("error: initializing encryption manager failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, fmt.Errorf("error: initializing encryption manager failed: %w", err) + } + details, _, err := issuer.IssueCapabilityDetails(ctx) + if err != nil { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, fmt.Errorf("error: get credential issuance capability details: %w", err) + } + input := &CredentialIssueInput{ + IdentityID: request.GetIdentityId(), + CredentialOptions: request.GetCredentialOptions(), + ExpiresAt: request.GetExpiresAt(), + RequestID: request.GetRequestId(), + } + descriptor, err := validateCredentialIssueInput(input, details, b.nowFunc()) + if err != nil { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, status.Errorf(codes.InvalidArgument, "invalid credential issuance request: %v", err) + } + + output, err := issuer.Issue(ctx, input) + if err != nil { + l.Error("error: issue credential for identity failed", zap.Error(err)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, fmt.Errorf("error: issue credential for identity failed: %w", err) + } + err = validateCredentialIssueOutput(request.GetIdentityId(), request.GetExpiresAt(), output, descriptor) + if err != nil { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, status.Errorf(codes.Internal, "connector returned invalid credential issuance output: %v", err) + } + + var encryptedDatas []*v2.EncryptedData + for _, plaintextCredential := range output.PlaintextData { + var encryptedData []*v2.EncryptedData + encryptedData, err = pkem.Encrypt(ctx, plaintextCredential) + if err != nil { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err + } + encryptedDatas = append(encryptedDatas, encryptedData...) + } + + b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) + return v2.IssueCredentialResponse_builder{ + Secret: output.Secret, + EncryptedData: encryptedDatas, + Annotations: output.Annotations, + ResourceMode: output.ResourceMode, + RequestId: request.GetRequestId(), + }.Build(), nil +} + +func validateCredentialIssueOutput(identityID *v2.ResourceId, requestedExpiresAt *timestamppb.Timestamp, output *CredentialIssueOutput, descriptor *v2.CredentialIssueOptionDescriptor) error { + if output == nil || output.Secret == nil || output.Secret.GetId() == nil { + return fmt.Errorf("secret resource and id are required") + } + if strings.TrimSpace(output.Secret.GetId().GetResource()) == "" || strings.TrimSpace(output.Secret.GetId().GetResourceType()) == "" { + return fmt.Errorf("secret resource id is incomplete") + } + trait := &v2.SecretTrait{} + secretAnnotations := annotations.Annotations(output.Secret.GetAnnotations()) + found, err := secretAnnotations.Pick(trait) + if err != nil { + return fmt.Errorf("read secret trait: %w", err) + } + if !found { + return fmt.Errorf("secret resource must carry SecretTrait") + } + if !proto.Equal(trait.GetIdentityId(), identityID) { + return fmt.Errorf("secret trait identity_id does not match authenticating principal") + } + if requestedExpiresAt != nil { + if trait.GetExpiresAt() == nil { + return fmt.Errorf("secret trait expires_at is required when expiry was requested") + } + if err := trait.GetExpiresAt().CheckValid(); err != nil { + return fmt.Errorf("secret trait expires_at is invalid: %w", err) + } + if trait.GetExpiresAt().AsTime().After(requestedExpiresAt.AsTime()) { + return fmt.Errorf("secret trait expires_at exceeds requested expiry") + } + } + if output.ResourceMode == v2.CredentialResourceMode_CREDENTIAL_RESOURCE_MODE_UNSPECIFIED || output.ResourceMode != descriptor.GetResourceMode() { + return fmt.Errorf("credential resource mode does not match advertised capability") + } + if output.Secret.GetId().GetResourceType() != descriptor.GetSecretResourceTypeId() { + return fmt.Errorf("secret resource type does not match advertised capability") + } + if len(output.PlaintextData) == 0 { + return fmt.Errorf("at least one plaintext value is required") + } + names := make(map[string]struct{}, len(output.PlaintextData)) + for i, value := range output.PlaintextData { + if value == nil || strings.TrimSpace(value.GetName()) == "" || len(value.GetBytes()) == 0 { + return fmt.Errorf("plaintext value %d must have a name and non-empty bytes", i) + } + if _, ok := names[value.GetName()]; ok { + return fmt.Errorf("duplicate plaintext value name %q", value.GetName()) + } + names[value.GetName()] = struct{}{} + } + return nil +} + +func (b *builder) addCredentialIssuer(_ context.Context, typeId string, in interface{}) error { + if credentialIssuer, ok := in.(CredentialIssuerLimited); ok { + if _, ok := b.credentialIssuers[typeId]; ok { + return fmt.Errorf("error: duplicate resource type found for credential issuer %s", typeId) + } + b.credentialIssuers[typeId] = credentialIssuer + } + return nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go index 5e10813d..d1fceab3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/crypto.go @@ -62,6 +62,26 @@ func NewEncryptionManager(co *v2.CredentialOptions, ec []*v2.EncryptionConfig) ( return em, nil } +// ValidateEncryptionConfigs validates recipients before an irreversible +// credential issuance without changing create/rotate compatibility. +func ValidateEncryptionConfigs(ec []*v2.EncryptionConfig) error { + for i, config := range ec { + if config == nil { + return status.Errorf(codes.InvalidArgument, "encryption config %d is empty", i) + } + provider, err := providers.GetEncryptorForConfig(context.Background(), config) + if err != nil { + return status.Errorf(codes.InvalidArgument, "invalid encryption config %d: %v", i, err) + } + if validator, ok := provider.(providers.EncryptionConfigValidator); ok { + if err := validator.ValidateConfig(context.Background(), config); err != nil { + return status.Errorf(codes.InvalidArgument, "invalid encryption config %d: %v", i, err) + } + } + } + return nil +} + func decryptPassword(ctx context.Context, encryptedPassword *v2.EncryptedData, decryptionConfig *providers.DecryptionConfig) (string, error) { if decryptionConfig == nil { return "", ErrInvalidCredentialOptions diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/age/age.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/age/age.go index 1aa4ffea..41f8ef16 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/age/age.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/age/age.go @@ -19,6 +19,11 @@ const EncryptionProviderAge = "baton/age/v1" type RecipientEncryptionProvider struct{} +func (p *RecipientEncryptionProvider) ValidateConfig(_ context.Context, conf *v2.EncryptionConfig) error { + _, _, err := recipientFromConfig(conf) + return err +} + func (p *RecipientEncryptionProvider) Encrypt(_ context.Context, conf *v2.EncryptionConfig, plaintext *v2.PlaintextData) (*v2.EncryptedData, error) { recipientText, recipient, err := recipientFromConfig(conf) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go index e4820fe3..d8dff8a4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/jwk/jwk.go @@ -39,6 +39,22 @@ func unmarshalJWK(jwkBytes []byte) (*jose.JSONWebKey, error) { type JWKEncryptionProvider struct{} +func (j *JWKEncryptionProvider) ValidateConfig(_ context.Context, conf *v2.EncryptionConfig) error { + if conf == nil || conf.GetJwkPublicKeyConfig() == nil { + return status.Error(codes.InvalidArgument, "jwk: public key configuration is required") + } + key, err := unmarshalJWK(conf.GetJwkPublicKeyConfig().GetPubKey()) + if err != nil { + return err + } + switch key.Public().Key.(type) { + case ed25519.PublicKey, *ecdsa.PublicKey, *rsa.PublicKey: + return nil + default: + return ErrJWKUnsupportedKeyType + } +} + func (j *JWKEncryptionProvider) GenerateKey(ctx context.Context) (*v2.EncryptionConfig, *jose.JSONWebKey, error) { _, privKey, err := ed25519.GenerateKey(nil) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go index 8689735d..405eb823 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/crypto/providers/registry.go @@ -27,6 +27,14 @@ type EncryptionProvider interface { GenerateKey(ctx context.Context) (*v2.EncryptionConfig, *jose.JSONWebKey, error) } +// EncryptionConfigValidator is implemented by providers that can validate all +// provider-specific configuration without encrypting data. Builders use it +// before invoking a connector so a bad encryption key cannot strand a newly +// created credential in the provider. +type EncryptionConfigValidator interface { + ValidateConfig(ctx context.Context, conf *v2.EncryptionConfig) error +} + type DecryptionConfig struct { Provider string PrivateKey *jose.JSONWebKey diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_store.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_store.go index 83234246..bc5d5c14 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_store.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_store.go @@ -18,11 +18,12 @@ import ( // wrapper structs satisfy each sub-interface. These assertions catch // signature drift at build time rather than at the first runtime call. var ( - _ c1zstore.Store = (*C1File)(nil) - _ c1zstore.GrantStore = c1FileGrantStore{} - _ c1zstore.SyncMeta = c1FileSyncMeta{} - _ c1zstore.FileOps = c1FileFileOps{} - _ SessionStore = c1FileSessionStore{} + _ c1zstore.Store = (*C1File)(nil) + _ c1zstore.GrantStore = c1FileGrantStore{} + _ c1zstore.SyncMeta = c1FileSyncMeta{} + _ c1zstore.IngestInvariantVerificationWriter = c1FileSyncMeta{} + _ c1zstore.FileOps = c1FileFileOps{} + _ SessionStore = c1FileSessionStore{} ) // Grants returns the grant-store slice of this c1z. @@ -275,6 +276,18 @@ func (s c1FileSyncMeta) MarkSyncSupportsDiff(ctx context.Context, syncID string) return s.c.SetSupportsDiff(ctx, syncID) } +func (s c1FileSyncMeta) MarkIngestInvariantsVerified( + ctx context.Context, + syncID string, + verification c1zstore.IngestInvariantVerification, +) error { + return s.c.markIngestInvariantsVerified(ctx, syncID, verification) +} + +func (s c1FileSyncMeta) ClearIngestInvariantVerification(ctx context.Context, syncID string) error { + return s.c.clearIngestInvariantVerification(ctx, syncID) +} + // LatestFullSync implements SyncMeta. Returns the most-recent finished // SyncTypeFull run, or nil if none. func (s c1FileSyncMeta) LatestFullSync(ctx context.Context) (*c1zstore.SyncRun, error) { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1zstore/sync_meta.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1zstore/sync_meta.go index 9fbc3e2c..1eb1d5c3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1zstore/sync_meta.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1zstore/sync_meta.go @@ -53,6 +53,15 @@ type SyncMeta interface { RecalculateStats(ctx context.Context, syncID string) error } +// IngestInvariantVerificationWriter is the additive sync-metadata capability +// implemented by stores that can persist invariant provenance. It is separate +// from SyncMeta so adding the marker does not break third-party SyncMeta +// implementations at compile time. +type IngestInvariantVerificationWriter interface { + MarkIngestInvariantsVerified(ctx context.Context, syncID string, verification IngestInvariantVerification) error + ClearIngestInvariantVerification(ctx context.Context, syncID string) error +} + // SyncRun is the exported shape of a sync run. The fields match the // sync_runs schema. // @@ -69,4 +78,42 @@ type SyncRun struct { LinkedSyncID string SupportsDiff bool Stats *reader_v2.SyncStats + IngestInvariantVerification } + +// IngestInvariantVerification is persisted provenance for a successful +// post-collection invariant pass. Generation identifies the verifier +// contract, Coverage lists the invariant IDs that actually ran, and Mode +// identifies the verdict policy used. Generation == "" means unverified. +type IngestInvariantVerification struct { + Generation string + Coverage []string + Mode IngestInvariantVerificationMode +} + +// IsVerified reports whether the provenance marker is complete and uses a +// known verdict mode. It says the recorded pass completed; callers must still +// compare Generation and required Coverage with their own contract. +func (v IngestInvariantVerification) IsVerified() bool { + if v.Generation == "" || len(v.Coverage) == 0 { + return false + } + switch v.Mode { + case IngestInvariantVerificationModeConnector, + IngestInvariantVerificationModeConnectorFailFast, + IngestInvariantVerificationModeCompactionMerge, + IngestInvariantVerificationModeCompactionMergeFailFast: + return true + default: + return false + } +} + +type IngestInvariantVerificationMode string + +const ( + IngestInvariantVerificationModeConnector IngestInvariantVerificationMode = "connector" + IngestInvariantVerificationModeConnectorFailFast IngestInvariantVerificationMode = "connector_fail_fast" + IngestInvariantVerificationModeCompactionMerge IngestInvariantVerificationMode = "compaction_merge" + IngestInvariantVerificationModeCompactionMergeFailFast IngestInvariantVerificationMode = "compaction_merge_fail_fast" +) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go index 5c98b14e..69ddc08f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter.go @@ -12,6 +12,7 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "github.com/segmentio/ksuid" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/anypb" @@ -243,14 +244,10 @@ func (e *Engine) CheckpointSync(ctx context.Context, syncToken string) error { if err != nil { return err } - updated := v3.SyncRunRecord_builder{ - SyncId: existing.GetSyncId(), - Type: existing.GetType(), - ParentSyncId: existing.GetParentSyncId(), - StartedAt: existing.GetStartedAt(), - EndedAt: existing.GetEndedAt(), - SyncToken: syncToken, - }.Build() + // Clone-and-mutate so lifecycle updates preserve every metadata field, + // including fields introduced after this code was written. + updated := proto.Clone(existing).(*v3.SyncRunRecord) + updated.SetSyncToken(syncToken) return e.PutSyncRunRecord(ctx, updated) } @@ -336,14 +333,9 @@ func (e *Engine) endSyncFinalize(ctx context.Context, existing *v3.SyncRunRecord return fmt.Errorf("EndSync: repair grant digests: %w", err) } } - updated := v3.SyncRunRecord_builder{ - SyncId: existing.GetSyncId(), - Type: existing.GetType(), - ParentSyncId: existing.GetParentSyncId(), - StartedAt: existing.GetStartedAt(), - EndedAt: timestamppb.Now(), - SyncToken: existing.GetSyncToken(), - }.Build() + // Preserve all provenance fields while adding the lifecycle stamp. + updated := proto.Clone(existing).(*v3.SyncRunRecord) + updated.SetEndedAt(timestamppb.Now()) if e.test.endSyncStampHook != nil { if err := e.test.endSyncStampHook(); err != nil { return err diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter_sync_meta.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter_sync_meta.go index a77ba672..d7ec808e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter_sync_meta.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/engine/pebble/adapter_sync_meta.go @@ -26,6 +26,8 @@ type pebbleSyncMeta struct { e *Engine } +var _ c1zstore.IngestInvariantVerificationWriter = pebbleSyncMeta{} + // MarkSyncSupportsDiff sets supports_diff = true on the named sync's // run record. Used by pkg/sync.parallelSyncer after graph // construction to signal that the sync has SQL-layer grant metadata @@ -51,6 +53,55 @@ func (s pebbleSyncMeta) MarkSyncSupportsDiff(ctx context.Context, syncID string) return nil } +// MarkIngestInvariantsVerified persists the successful invariant pass on the +// sync-run record. Rewriting the same marker after crash/resume is idempotent. +func (s pebbleSyncMeta) MarkIngestInvariantsVerified( + ctx context.Context, + syncID string, + verification c1zstore.IngestInvariantVerification, +) error { + if syncID == "" { + return errors.New("MarkIngestInvariantsVerified: empty syncID") + } + if !verification.IsVerified() { + return errors.New("MarkIngestInvariantsVerified: incomplete verification") + } + r, err := s.e.GetSyncRunRecord(ctx, syncID) + if err != nil { + return c1zstore.AdaptNotFound(fmt.Errorf("MarkIngestInvariantsVerified: get: %w", err), pebble.ErrNotFound) + } + // The marker is only ever valid on a sealed sync: an unfinished sync's + // data is still mutable, so a verified-but-unfinished record would be a + // lie the moment the next write lands. Callers mark AFTER EndSync. + if r.GetEndedAt() == nil { + return fmt.Errorf("MarkIngestInvariantsVerified: sync %s is not finished", syncID) + } + r.SetIngestInvariantGeneration(verification.Generation) + r.SetIngestInvariantCoverage(append([]string(nil), verification.Coverage...)) + r.SetIngestInvariantMode(string(verification.Mode)) + if err := s.e.PutSyncRunRecord(ctx, r); err != nil { + return fmt.Errorf("MarkIngestInvariantsVerified: put: %w", err) + } + return nil +} + +func (s pebbleSyncMeta) ClearIngestInvariantVerification(ctx context.Context, syncID string) error { + if syncID == "" { + return errors.New("ClearIngestInvariantVerification: empty syncID") + } + r, err := s.e.GetSyncRunRecord(ctx, syncID) + if err != nil { + return c1zstore.AdaptNotFound(fmt.Errorf("ClearIngestInvariantVerification: get: %w", err), pebble.ErrNotFound) + } + r.SetIngestInvariantGeneration("") + r.SetIngestInvariantCoverage(nil) + r.SetIngestInvariantMode("") + if err := s.e.PutSyncRunRecord(ctx, r); err != nil { + return fmt.Errorf("ClearIngestInvariantVerification: put: %w", err) + } + return nil +} + // LatestFullSync returns the most recently finished sync whose type // is SYNC_TYPE_FULL, or nil if no such sync exists. func (s pebbleSyncMeta) LatestFullSync(ctx context.Context) (*c1zstore.SyncRun, error) { @@ -114,13 +165,22 @@ func syncRunRecordToExported(r *v3.SyncRunRecord) *c1zstore.SyncRun { if r == nil { return nil } + verification := c1zstore.IngestInvariantVerification{ + Generation: r.GetIngestInvariantGeneration(), + Coverage: append([]string(nil), r.GetIngestInvariantCoverage()...), + Mode: c1zstore.IngestInvariantVerificationMode(r.GetIngestInvariantMode()), + } + if !verification.IsVerified() { + verification = c1zstore.IngestInvariantVerification{} + } out := &c1zstore.SyncRun{ - ID: r.GetSyncId(), - Type: syncTypeV3ToConnectorstore(r.GetType()), - SyncToken: r.GetSyncToken(), - ParentSyncID: r.GetParentSyncId(), - LinkedSyncID: r.GetLinkedSyncId(), - SupportsDiff: r.GetSupportsDiff(), + ID: r.GetSyncId(), + Type: syncTypeV3ToConnectorstore(r.GetType()), + SyncToken: r.GetSyncToken(), + ParentSyncID: r.GetParentSyncId(), + LinkedSyncID: r.GetLinkedSyncId(), + SupportsDiff: r.GetSupportsDiff(), + IngestInvariantVerification: verification, } if t := r.GetStartedAt(); t != nil { tt := t.AsTime() @@ -148,13 +208,22 @@ func syncRunRecordToExported(r *v3.SyncRunRecord) *c1zstore.SyncRun { func (e *Engine) sortedSyncRuns(ctx context.Context) ([]c1zstore.SyncRun, error) { var out []c1zstore.SyncRun err := e.IterateAllSyncRuns(ctx, func(r *v3.SyncRunRecord) bool { + verification := c1zstore.IngestInvariantVerification{ + Generation: r.GetIngestInvariantGeneration(), + Coverage: append([]string(nil), r.GetIngestInvariantCoverage()...), + Mode: c1zstore.IngestInvariantVerificationMode(r.GetIngestInvariantMode()), + } + if !verification.IsVerified() { + verification = c1zstore.IngestInvariantVerification{} + } cand := c1zstore.SyncRun{ - ID: r.GetSyncId(), - Type: syncTypeV3ToConnectorstore(r.GetType()), - SyncToken: r.GetSyncToken(), - ParentSyncID: r.GetParentSyncId(), - SupportsDiff: r.GetSupportsDiff(), - LinkedSyncID: r.GetLinkedSyncId(), + ID: r.GetSyncId(), + Type: syncTypeV3ToConnectorstore(r.GetType()), + SyncToken: r.GetSyncToken(), + ParentSyncID: r.GetParentSyncId(), + SupportsDiff: r.GetSupportsDiff(), + LinkedSyncID: r.GetLinkedSyncId(), + IngestInvariantVerification: verification, } if t := r.GetStartedAt(); t != nil { tt := t.AsTime() diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/pebble_store.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/pebble_store.go index 1eeb1e5d..95828913 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/pebble_store.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/pebble_store.go @@ -16,6 +16,7 @@ import ( c1zv3 "github.com/conductorone/baton-sdk/pb/c1/c1z/v3" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" v3 "github.com/conductorone/baton-sdk/pb/c1/storage/v3" "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/conductorone/baton-sdk/pkg/dotc1z/c1zstore" @@ -275,6 +276,66 @@ func (f pebbleStoreFileOps) GenerateSyncDiff(ctx context.Context, baseSyncID, ap return diffSyncID, f.store.markDirty(nil) } +// SyncMeta overrides the Adapter-level SyncMeta so the MUTATING +// metadata methods flip the store's dirty bit — Close only saves the +// envelope when dirty, so a standalone metadata stamp on a reopened +// c1z (e.g. MarkIngestInvariantsVerified after the engine sealed) +// would otherwise be silently dropped with the discarded temp dir. +// Same pattern as Grants() and FileOps(); the production Sync() path +// never noticed because EndSync sets dirty right before the stamps. +func (s *pebbleStore) SyncMeta() c1zstore.SyncMeta { + return pebbleStoreSyncMeta{inner: s.Engine.SyncMeta(), store: s} +} + +type pebbleStoreSyncMeta struct { + inner c1zstore.SyncMeta + store *pebbleStore +} + +// The engine-level SyncMeta implements the verification writer; the +// dirty-marking wrapper must keep exposing it. +var _ c1zstore.IngestInvariantVerificationWriter = pebbleStoreSyncMeta{} + +func (m pebbleStoreSyncMeta) MarkSyncSupportsDiff(ctx context.Context, syncID string) error { + return m.store.markDirty(m.inner.MarkSyncSupportsDiff(ctx, syncID)) +} + +func (m pebbleStoreSyncMeta) MarkIngestInvariantsVerified(ctx context.Context, syncID string, verification c1zstore.IngestInvariantVerification) error { + w, ok := m.inner.(c1zstore.IngestInvariantVerificationWriter) + if !ok { + return errors.New("pebble sync meta: engine SyncMeta does not implement IngestInvariantVerificationWriter") + } + return m.store.markDirty(w.MarkIngestInvariantsVerified(ctx, syncID, verification)) +} + +func (m pebbleStoreSyncMeta) ClearIngestInvariantVerification(ctx context.Context, syncID string) error { + w, ok := m.inner.(c1zstore.IngestInvariantVerificationWriter) + if !ok { + return errors.New("pebble sync meta: engine SyncMeta does not implement IngestInvariantVerificationWriter") + } + return m.store.markDirty(w.ClearIngestInvariantVerification(ctx, syncID)) +} + +func (m pebbleStoreSyncMeta) RecalculateStats(ctx context.Context, syncID string) error { + return m.store.markDirty(m.inner.RecalculateStats(ctx, syncID)) +} + +func (m pebbleStoreSyncMeta) LatestFullSync(ctx context.Context) (*c1zstore.SyncRun, error) { + return m.inner.LatestFullSync(ctx) +} + +func (m pebbleStoreSyncMeta) LatestFinishedSyncOfAnyType(ctx context.Context) (*c1zstore.SyncRun, error) { + return m.inner.LatestFinishedSyncOfAnyType(ctx) +} + +func (m pebbleStoreSyncMeta) Stats(ctx context.Context, syncType connectorstore.SyncType, syncID string) (map[string]int64, error) { + return m.inner.Stats(ctx, syncType, syncID) +} + +func (m pebbleStoreSyncMeta) StatsV2(ctx context.Context, syncType connectorstore.SyncType, syncID string) (*reader_v2.SyncStats, error) { + return m.inner.StatsV2(ctx, syncType, syncID) +} + // Metadata extends the embedded Adapter's Metadata with this store's // configured payload encoding. Encoding lives on the pebbleStore // (not the inner Adapter) because it's a writer-side option threaded 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 9171ac44..9dc774e7 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 @@ -49,7 +49,10 @@ create table if not exists %s ( linked_sync_id text not null default '', supports_diff integer not null default 0, grants_backfilled integer not null default 0, - stats text + stats text, + ingest_invariant_generation text not null default '', + ingest_invariant_coverage text not null default '', + ingest_invariant_mode text not null default '' ); create unique index if not exists %s on %s (sync_id);` @@ -148,9 +151,52 @@ func (r *syncRunsTable) Migrations(ctx context.Context, db *goqu.Database) (bool migrated = true } + for _, column := range []struct { + name string + ddl string + }{ + {name: "ingest_invariant_generation", ddl: "text not null default ''"}, + {name: "ingest_invariant_coverage", ddl: "text not null default ''"}, + {name: "ingest_invariant_mode", ddl: "text not null default ''"}, + } { + _, err = db.ExecContext(ctx, fmt.Sprintf("alter table %s add column %s %s", r.Name(), column.name, column.ddl)) + if err != nil { + if !isAlreadyExistsError(err) { + return false, err + } + } else { + migrated = true + } + } + return migrated, nil } +func parseIngestInvariantVerification( + generation string, + coverageJSON string, + mode string, +) c1zstore.IngestInvariantVerification { + if generation == "" { + return c1zstore.IngestInvariantVerification{} + } + var coverage []string + if err := json.Unmarshal([]byte(coverageJSON), &coverage); err != nil { + // Malformed provenance must fail closed: expose it as unverified so a + // future compaction consumer cannot trust a partial/corrupt marker. + return c1zstore.IngestInvariantVerification{} + } + verification := c1zstore.IngestInvariantVerification{ + Generation: generation, + Coverage: coverage, + Mode: c1zstore.IngestInvariantVerificationMode(mode), + } + if !verification.IsVerified() { + return c1zstore.IngestInvariantVerification{} + } + return verification +} + // getCachedViewSyncRun returns the cached sync run for read operations. // This avoids N+1 queries when paginating through listConnectorObjects. // The cache is invalidated when a sync starts or ends. @@ -202,7 +248,12 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connector oneWeekAgo := time.Now().AddDate(0, 0, -7) ret := &c1zstore.SyncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id", "supports_diff", "stats") + q = q.Select( + "sync_id", "started_at", "ended_at", "sync_token", "sync_type", + "parent_sync_id", "linked_sync_id", "supports_diff", + "ingest_invariant_generation", "ingest_invariant_coverage", "ingest_invariant_mode", + "stats", + ) 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()) @@ -218,7 +269,12 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connector row := c.db.QueryRowContext(ctx, query, args...) statsBytes := &[]byte{} - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID, &ret.SupportsDiff, &statsBytes) + var generation, coverageJSON, mode string + err = row.Scan( + &ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, + &ret.ParentSyncID, &ret.LinkedSyncID, &ret.SupportsDiff, + &generation, &coverageJSON, &mode, &statsBytes, + ) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -227,6 +283,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connector } ret.Stats = parseStats(ctx, statsBytes) + ret.IngestInvariantVerification = parseIngestInvariantVerification(generation, coverageJSON, mode) return ret, nil } @@ -248,7 +305,12 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType conn ret := &c1zstore.SyncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id", "supports_diff", "stats") + q = q.Select( + "sync_id", "started_at", "ended_at", "sync_token", "sync_type", + "parent_sync_id", "linked_sync_id", "supports_diff", + "ingest_invariant_generation", "ingest_invariant_coverage", "ingest_invariant_mode", + "stats", + ) q = q.Where(goqu.C("ended_at").IsNotNull()) if syncType != connectorstore.SyncTypeAny { q = q.Where(goqu.C("sync_type").Eq(syncType)) @@ -271,7 +333,12 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType conn row := c.db.QueryRowContext(ctx, query, args...) statsBytes := &[]byte{} - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID, &ret.SupportsDiff, &statsBytes) + var generation, coverageJSON, mode string + err = row.Scan( + &ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, + &ret.ParentSyncID, &ret.LinkedSyncID, &ret.SupportsDiff, + &generation, &coverageJSON, &mode, &statsBytes, + ) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -280,6 +347,7 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType conn } ret.Stats = parseStats(ctx, statsBytes) + ret.IngestInvariantVerification = parseIngestInvariantVerification(generation, coverageJSON, mode) return ret, nil } @@ -312,7 +380,12 @@ 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", "sync_type", "parent_sync_id", "linked_sync_id", "supports_diff", "stats") + q = q.Select( + "id", "sync_id", "started_at", "ended_at", "sync_token", "sync_type", + "parent_sync_id", "linked_sync_id", "supports_diff", + "ingest_invariant_generation", "ingest_invariant_coverage", "ingest_invariant_mode", + "stats", + ) if pageToken != "" { q = q.Where(goqu.C("id").Gte(pageToken)) @@ -348,12 +421,18 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui statsBytes := &[]byte{} rowId := 0 data := &c1zstore.SyncRun{} - err := rows.Scan(&rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken, &data.Type, &data.ParentSyncID, &data.LinkedSyncID, &data.SupportsDiff, &statsBytes) + var generation, coverageJSON, mode string + err := rows.Scan( + &rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken, &data.Type, + &data.ParentSyncID, &data.LinkedSyncID, &data.SupportsDiff, + &generation, &coverageJSON, &mode, &statsBytes, + ) if err != nil { return nil, "", err } data.Stats = parseStats(ctx, statsBytes) + data.IngestInvariantVerification = parseIngestInvariantVerification(generation, coverageJSON, mode) lastRow = rowId ret = append(ret, data) } @@ -445,7 +524,12 @@ func (c *C1File) getSync(ctx context.Context, syncID string) (*c1zstore.SyncRun, ret := &c1zstore.SyncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id", "supports_diff", "stats") + q = q.Select( + "sync_id", "started_at", "ended_at", "sync_token", "sync_type", + "parent_sync_id", "linked_sync_id", "supports_diff", + "ingest_invariant_generation", "ingest_invariant_coverage", "ingest_invariant_mode", + "stats", + ) q = q.Where(goqu.C("sync_id").Eq(syncID)) query, args, err := q.ToSQL() @@ -454,12 +538,18 @@ func (c *C1File) getSync(ctx context.Context, syncID string) (*c1zstore.SyncRun, } row := c.db.QueryRowContext(ctx, query, args...) var statsBytes *[]byte - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID, &ret.SupportsDiff, &statsBytes) + var generation, coverageJSON, mode string + err = row.Scan( + &ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, + &ret.ParentSyncID, &ret.LinkedSyncID, &ret.SupportsDiff, + &generation, &coverageJSON, &mode, &statsBytes, + ) if err != nil { return nil, c1zstore.AdaptNotFound(err) } ret.Stats = parseStats(ctx, statsBytes) + ret.IngestInvariantVerification = parseIngestInvariantVerification(generation, coverageJSON, mode) return ret, nil } @@ -808,6 +898,92 @@ func (c *C1File) SetSupportsDiff(ctx context.Context, syncID string) error { return nil } +func (c *C1File) markIngestInvariantsVerified( + ctx context.Context, + syncID string, + verification c1zstore.IngestInvariantVerification, +) error { + if c.readOnly { + return ErrReadOnly + } + if syncID == "" { + return status.Error(codes.InvalidArgument, "sync id is required") + } + if !verification.IsVerified() { + return status.Error(codes.InvalidArgument, "ingest invariant verification is incomplete") + } + coverage, err := json.Marshal(verification.Coverage) + if err != nil { + return fmt.Errorf("marshal ingest invariant coverage: %w", err) + } + + q := c.db.Update(syncRuns.Name()) + q = q.Set(goqu.Record{ + "ingest_invariant_generation": verification.Generation, + "ingest_invariant_coverage": string(coverage), + "ingest_invariant_mode": string(verification.Mode), + }) + q = q.Where(goqu.C("sync_id").Eq(syncID)) + // The marker is only ever valid on a sealed sync: an unfinished sync's + // data is still mutable, so a verified-but-unfinished row would be a + // lie the moment the next write lands. Callers mark AFTER EndSync. + q = q.Where(goqu.C("ended_at").IsNotNull()) + + query, args, err := q.ToSQL() + if err != nil { + return err + } + result, err := c.db.ExecContext(ctx, query, args...) + if err != nil { + return err + } + rows, err := result.RowsAffected() + if err != nil { + return err + } + if rows == 0 { + return status.Errorf(codes.FailedPrecondition, + "mark ingest invariants verified: sync %s not found or not finished", syncID) + } + c.dbUpdated = true + c.invalidateCachedViewSyncRun() + return nil +} + +func (c *C1File) clearIngestInvariantVerification(ctx context.Context, syncID string) error { + if c.readOnly { + return ErrReadOnly + } + if syncID == "" { + return status.Error(codes.InvalidArgument, "sync id is required") + } + q := c.db.Update(syncRuns.Name()) + q = q.Set(goqu.Record{ + "ingest_invariant_generation": "", + "ingest_invariant_coverage": "", + "ingest_invariant_mode": "", + }) + q = q.Where(goqu.C("sync_id").Eq(syncID)) + query, args, err := q.ToSQL() + if err != nil { + return err + } + result, err := c.db.ExecContext(ctx, query, args...) + if err != nil { + return err + } + rows, err := result.RowsAffected() + if err != nil { + return err + } + if rows == 0 { + return c1zstore.AdaptNotFound(sql.ErrNoRows) + } + c.dbUpdated = true + c.invalidateCachedViewSyncRun() + return nil +} + // SetSyncLink sets the linked_sync_id of an existing sync run. Diff // sync pairs (partial_upserts ↔ partial_deletions) reference each // other bidirectionally; a writer rebuilding such a pair cannot supply diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/to_pebble.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/to_pebble.go index 0b251e3e..8792e552 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/to_pebble.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/to_pebble.go @@ -252,8 +252,17 @@ func (c *C1File) ToPebble(ctx context.Context, outPath string, syncID string, op return nil, fmt.Errorf("to-pebble: load destination sync metadata: %w", err) } rec.SetEndedAt(timestamppb.New(*sync.EndedAt)) + // Verification provenance only rides along with a FINISHED source: + // a marker on an unfinished source (impossible through the writer + // API, but representable in a hand-edited file) must not convert + // into a sealed, verified destination. + if sync.IsVerified() { + rec.SetIngestInvariantGeneration(sync.Generation) + rec.SetIngestInvariantCoverage(append([]string(nil), sync.Coverage...)) + rec.SetIngestInvariantMode(string(sync.Mode)) + } if err := destEng.PutSyncRunRecord(ctx, rec); err != nil { - return nil, fmt.Errorf("to-pebble: preserve source ended_at: %w", err) + return nil, fmt.Errorf("to-pebble: preserve source sync metadata: %w", err) } } endSyncDur := time.Since(endSyncStart) 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 d0d7391c..886bb550 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go @@ -190,22 +190,6 @@ func GetDefaultValue[T SchemaTypes](s SchemaField) (*T, error) { return &value, nil } -// GetExportedDefaultValue returns the value used to populate the default in the -// exported config schema (and thus the c1 GUI). It prefers SuggestedValue when -// set (non-nil), otherwise falls back to DefaultValue. This is used only by the -// schema export path; the CLI/runtime flag default always comes from -// GetDefaultValue. -func GetExportedDefaultValue[T SchemaTypes](s SchemaField) (*T, error) { - if s.SuggestedValue != nil { - value, ok := s.SuggestedValue.(T) - if !ok { - return nil, ErrWrongValueType - } - return &value, nil - } - return GetDefaultValue[T](s) -} - // GetSuggestedValue returns the SuggestedValue type-asserted to T, or nil when // no suggested value is set. It populates the exported schema's suggested_value // field, which pre-populates the c1 GUI without being injected into resolved diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/client.go b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/client.go index df25813c..5440b9c2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/client.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/client.go @@ -7,6 +7,7 @@ import ( "fmt" "slices" "strings" + "time" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lambda" @@ -121,10 +122,19 @@ func (c *clientConn) Invoke(ctx context.Context, method string, args any, reply return status.Errorf(codes.Unknown, "args and reply must satisfy proto.Message") } - // TODO(morgabra): Should we do some of this stuff? (e.g. detect ctx deadline and set grpc-timeout, etc?) - // https://github.com/grpc/grpc-go/blob/9dc22c029c2592b5b6235d9ef6f14d62ecd6a509/internal/transport/http2_client.go#L541 md, _ := metadata.FromOutgoingContext(ctx) + // Propagate the context deadline to the server via the grpc-timeout header, + // mirroring grpc-go's HTTP/2 transport behavior. + if deadline, ok := ctx.Deadline(); ok { + timeout := time.Until(deadline) + if timeout <= 0 { + return status.Errorf(codes.DeadlineExceeded, "context deadline exceeded before invoking method %s", method) + } + md = md.Copy() + md.Set("grpc-timeout", encodeTimeout(timeout)) + } + treq, err := NewRequest(method, req, md) if err != nil { return status.Errorf(codes.Unknown, "failed creating request: %s", err) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/server.go b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/server.go index 2a3da875..969f414d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/server.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/server.go @@ -226,7 +226,7 @@ func PeerForRequest(req *Request) *peer.Peer { func TimeoutForRequest(req *Request) (time.Duration, bool, error) { v := req.Headers().Get("grpc-timeout") - if len(v) > 1 { + if len(v) > 0 { to, err := decodeTimeout(v[0]) if err != nil { return 0, false, status.Errorf(codes.Internal, "malformed grpc-timeout: %v", err) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/util.go b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/util.go index b908abbb..ce75a7b5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/util.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/lambda/grpc/util.go @@ -79,6 +79,44 @@ func decodeTimeout(s string) (time.Duration, error) { return d * time.Duration(t), nil } +const maxTimeoutValue int64 = 100000000 - 1 + +// div does integer division and round-up the result. Note that this is +// equivalent to (d+r-1)/r but has less chance to overflow. +func div(d, r time.Duration) int64 { + if d%r > 0 { + return int64(d/r + 1) + } + return int64(d / r) +} + +// encodeTimeout encodes the duration to the format the grpc-timeout header +// accepts. Ported from grpc-go's internal/grpcutil.EncodeDuration. +// +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests +func encodeTimeout(t time.Duration) string { + if t <= 0 { + return "0n" + } + if d := div(t, time.Nanosecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "n" + } + if d := div(t, time.Microsecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "u" + } + if d := div(t, time.Millisecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "m" + } + if d := div(t, time.Second); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "S" + } + if d := div(t, time.Minute); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "M" + } + // Note that maxTimeoutValue * time.Hour > MaxInt64. + return strconv.FormatInt(div(t, time.Hour), 10) + "H" +} + func parseMethod(method string) (string, string, error) { if method != "" && method[0] == '/' { method = method[1:] 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 4126ad1b..1808659a 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 @@ -128,6 +128,10 @@ func (n *emptyConnector) RotateCredential(ctx context.Context, request *v2.Rotat return nil, status.Errorf(codes.Unimplemented, "empty connector") } +func (n *emptyConnector) IssueCredential(ctx context.Context, request *v2.IssueCredentialRequest, opts ...grpc.CallOption) (*v2.IssueCredentialResponse, 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") } 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 c3a06f90..a37e85b0 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.20.1" +const Version = "v0.20.2" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go index 22b47137..105f9a35 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/ingest_invariants.go @@ -106,6 +106,7 @@ import ( reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/conductorone/baton-sdk/pkg/dotc1z" + "github.com/conductorone/baton-sdk/pkg/dotc1z/c1zstore" ) // ErrIngestInvariantViolated classifies DATA VERDICTS — the store's @@ -281,6 +282,10 @@ type ingestInvariant struct { // full-resource-scan cost is a bad trade for a default-mode // warning). failFastOnly bool + // requiresScheduleEvidence: the check only runs when this process + // retained evidence from the resources phase. Keeping this applicability + // gate here makes persisted coverage reflect checks that truly ran. + requiresScheduleEvidence bool // failFastPromotes: under FailFast the check's tolerated // warn-verdicts become hard failures. Enforced by the fail-fast // test suite; documented here so the matrix is one artifact. @@ -321,10 +326,11 @@ var ingestInvariants = []ingestInvariant{ check: (*ingestInvariantsPass).checkStoredExclusionGroups, }, { - id: "I4", - failFastOnly: true, - failFastPromotes: true, // the whole check exists only under fail-fast - check: (*ingestInvariantsPass).checkChildScheduling, + id: "I4", + failFastOnly: true, + requiresScheduleEvidence: true, + failFastPromotes: true, // the whole check exists only under fail-fast + check: (*ingestInvariantsPass).checkChildScheduling, }, { id: "I7", @@ -366,6 +372,12 @@ const haltStageI9IndexesEnsured = "invariants-I9-indexes-ensured" // entire pass over the same state, so every check must be idempotent. const haltStageInvariantsComplete = "ingest-invariants-complete" +// IngestInvariantGeneration identifies the verification contract persisted in +// sync metadata. Increment it whenever the meaning of a covered invariant +// changes such that an older successful pass is not equivalent to the current +// one. +const IngestInvariantGeneration = "1" + // ingestInvariantHaltStages enumerates every halt seam the pass can // fire, in firing order — the halt sweep iterates this list, so a new // stage is swept by construction, and the meta-test pins @@ -394,21 +406,34 @@ func ingestInvariantHaltStages() []string { // store-level function so store-producing pipelines without a syncer // (the compactor's expand pass) can enforce the same contract. func RunIngestInvariants(ctx context.Context, store connectorstore.Reader, policy IngestInvariantsPolicy) error { + _, err := runIngestInvariants(ctx, store, policy) + return err +} + +// runIngestInvariants returns the IDs of checks that actually completed. The +// public wrapper intentionally retains its existing error-only API; the syncer +// consumes the coverage to persist verification provenance. +func runIngestInvariants( + ctx context.Context, + store connectorstore.Reader, + policy IngestInvariantsPolicy, +) ([]string, error) { if store == nil { - return fmt.Errorf("ingest invariants: store is required") + return nil, fmt.Errorf("ingest invariants: store is required") } // Fail closed on a zero SyncType: connectorstore's zero value is // SyncTypeAny (""), which is not SyncTypeFull — a caller omitting // the field would silently skip every full-keyspace invariant and // read a green pass that validated almost nothing. if policy.SyncType == "" { - return fmt.Errorf("ingest invariants: policy.SyncType is required (the zero value would silently skip the full-keyspace invariants; pass the sync's actual type)") + return nil, fmt.Errorf("ingest invariants: policy.SyncType is required (the zero value would silently skip the full-keyspace invariants; pass the sync's actual type)") } pass := &ingestInvariantsPass{store: store, p: &policy} if facts, ok := store.(dotc1z.IngestInvariantStore); ok { pass.facts = facts } var skippedNoStore []string + coverage := make([]string, 0, len(ingestInvariants)) for i := range ingestInvariants { inv := &ingestInvariants[i] if !inv.runsOnAllSyncTypes && policy.SyncType != connectorstore.SyncTypeFull { @@ -426,27 +451,46 @@ func RunIngestInvariants(ctx context.Context, store connectorstore.Reader, polic if inv.failFastOnly && !policy.FailFast { continue } + if inv.requiresScheduleEvidence && (!policy.resourcesPhaseRan || policy.childSchedule == nil) { + continue + } if err := inv.check(pass, ctx); err != nil { - return err + return nil, err } if inv.haltStage != "" { if err := pass.haltAt(inv.haltStage); err != nil { - return err + return nil, err } } + coverage = append(coverage, inv.id) } if len(skippedNoStore) > 0 { ctxzap.Extract(ctx).Info("ingest invariants: store engine lacks the inspection surface; referential invariants were not evaluated", zap.Strings("skipped_invariants", skippedNoStore), ) } - return nil + return coverage, nil } // runIngestionInvariants is the syncer's call into the pass: policy // from syncer state, evidence from the in-memory schedule set, halt // hook from the test seam. +// +// A successful pass does NOT write the verification marker here — it +// only records the pending verification on the syncer. The marker is +// persisted by persistIngestInvariantVerification AFTER EndSync, so a +// crash anywhere between this pass and the seal leaves the sync +// unverified (fail-closed) instead of claiming verification over an +// unfinished artifact the resume machinery will rewrite. func (s *syncer) runIngestionInvariants(ctx context.Context) error { + s.pendingInvariantVerification = nil + if verificationWriter, ok := s.store.SyncMeta().(c1zstore.IngestInvariantVerificationWriter); ok { + // Invalidate any proof inherited from an earlier pass before + // re-evaluating. A failed rerun must leave the sync unverified. + if err := verificationWriter.ClearIngestInvariantVerification(ctx, s.syncID); err != nil { + return fmt.Errorf("ingest invariants: clear prior verification: %w", err) + } + } policy := IngestInvariantsPolicy{ ActiveSyncID: s.getActiveSyncID(), SyncType: s.syncType, @@ -459,7 +503,50 @@ func (s *syncer) runIngestionInvariants(ctx context.Context) error { if s.testIngestHaltHook != nil { policy.halt = s.testIngestHaltHook } - return RunIngestInvariants(ctx, s.store, policy) + coverage, err := runIngestInvariants(ctx, s.store, policy) + if err != nil { + return err + } + mode := c1zstore.IngestInvariantVerificationModeConnector + switch { + case policy.CompactionMerge && policy.FailFast: + mode = c1zstore.IngestInvariantVerificationModeCompactionMergeFailFast + case policy.CompactionMerge: + mode = c1zstore.IngestInvariantVerificationModeCompactionMerge + case policy.FailFast: + mode = c1zstore.IngestInvariantVerificationModeConnectorFailFast + } + s.pendingInvariantVerification = &c1zstore.IngestInvariantVerification{ + Generation: IngestInvariantGeneration, + Coverage: coverage, + Mode: mode, + } + return nil +} + +// persistIngestInvariantVerification writes the verification marker the last +// successful runIngestionInvariants staged. Called AFTER EndSync: the marker +// must only ever be readable on a sealed sync, so a crash before the seal +// leaves the artifact unverified rather than claiming verification over data +// a resume is free to rewrite. Both built-in writers accept metadata stamps +// on a sealed sync (SQLite updates by sync_id; Pebble's PutSyncRunRecord is +// an AllowSealed path). The inverse crash window — sealed but not yet marked +// — reads as an unverified legacy artifact: fail-closed. +func (s *syncer) persistIngestInvariantVerification(ctx context.Context) error { + if s.pendingInvariantVerification == nil { + return errors.New("ingest invariants: no staged verification to persist") + } + verification := *s.pendingInvariantVerification + s.pendingInvariantVerification = nil + verificationWriter, ok := s.store.SyncMeta().(c1zstore.IngestInvariantVerificationWriter) + if !ok { + // SyncMeta predates verification metadata and is implemented outside + // this repository. Preserve its established behavior; the absent + // marker truthfully distinguishes it from built-in verified stores. + ctxzap.Extract(ctx).Warn("ingest invariants: store cannot persist verification metadata") + return nil + } + return verificationWriter.MarkIngestInvariantsVerified(ctx, s.syncID, verification) } // exclusionGroupTracker is the pure validation core behind invariant I5: 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 64d4b8fc..5c5ebd3d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -79,6 +79,8 @@ var connectorCallMethods = []string{ // IsSyncPreservable returns true if the error returned by Sync() means that the sync artifact is useful. // This either means that there was no error, or that the error is recoverable (we can resume the sync and possibly succeed next time). +// Timeouts (context.DeadlineExceeded or codes.DeadlineExceeded, e.g. an AWS Lambda hard timeout) are +// preservable because the sync can resume from the checkpoint. func IsSyncPreservable(err error) bool { if err == nil { return true @@ -89,6 +91,11 @@ func IsSyncPreservable(err error) bool { if errors.Is(err, ErrSyncNotComplete) || errors.Is(err, ErrTooManyWarnings) { return true } + // A wrapped bare context deadline error carries no gRPC status + // (status.FromError does not map context.DeadlineExceeded), so check it explicitly. + if errors.Is(err, context.DeadlineExceeded) { + return true + } statusErr, ok := status.FromError(err) if !ok { return false @@ -101,7 +108,8 @@ func IsSyncPreservable(err error) bool { codes.FailedPrecondition, codes.Aborted, codes.Unavailable, - codes.Unauthenticated: + codes.Unauthenticated, + codes.DeadlineExceeded: return true default: return false @@ -163,19 +171,26 @@ type syncer struct { // returning an error fails the sync at exactly that boundary. The // halt sweep uses it to prove crash/resume equivalence at every // ordering-sensitive point. Nil in production: one pointer check. - testIngestHaltHook func(stage string) error - connector types.ConnectorClient - state State - runDuration time.Duration - transitionHandler func(s Action) - progressHandler func(p *Progress) - tmpDir string - storageEngine c1zstore.Engine - skipFullSync bool - lastCheckPointTime time.Time - counts *progresslog.ProgressLog - targetedSyncResources []*v2.Resource - onlyExpandGrants bool + testIngestHaltHook func(stage string) error + // pendingInvariantVerification is the verification a successful + // runIngestionInvariants staged, awaiting persistence by + // persistIngestInvariantVerification AFTER EndSync. Deferring the + // write keeps the marker off unfinished syncs: a crash before the + // seal leaves the artifact unverified instead of claiming + // verification over data a resume will rewrite. + pendingInvariantVerification *c1zstore.IngestInvariantVerification + connector types.ConnectorClient + state State + runDuration time.Duration + transitionHandler func(s Action) + progressHandler func(p *Progress) + tmpDir string + storageEngine c1zstore.Engine + skipFullSync bool + lastCheckPointTime time.Time + counts *progresslog.ProgressLog + targetedSyncResources []*v2.Resource + onlyExpandGrants bool // compactionMergedStore marks the store as a pre-sealed artifact // this process did not collect (WithCompactionMergedStore — the // compactor's keep-newer merge and rollback-expansion's replay): @@ -845,6 +860,20 @@ func (s *syncer) Sync(ctx context.Context) error { l.Debug("resuming previous sync", zap.String("sync_id", syncID)) } + // Every run that reaches collection rewrites sync-scoped data, so no + // prior verification may survive into the window where the store is + // being mutated. New syncs carry no marker (no-op); the case that + // matters is a rebound, already-sealed sync (WithSyncID — e.g. the + // compactor's expansion pass, or a reused syncer): without this, its + // stale marker would read as verified while collection rewrites the + // data underneath it. The invariant pass re-stages and the marker is + // re-persisted after EndSync. + if w, ok := s.store.SyncMeta().(c1zstore.IngestInvariantVerificationWriter); ok { + if err := w.ClearIngestInvariantVerification(ctx, syncID); err != nil { + return s.returnSyncError(l, span, fmt.Errorf("clear prior ingest invariant verification: %w", err)) + } + } + currentStep, err := s.store.CurrentSyncStep(ctx) if err != nil { return err @@ -948,6 +977,20 @@ func (s *syncer) Sync(ctx context.Context) error { return s.returnSyncError(l, span, err) } + // The sync is sealed: publish the verification the invariant pass + // staged. Marking only after EndSync keeps the marker off unfinished + // syncs; a crash in the sealed-but-unmarked window reads as an + // unverified legacy artifact (fail-closed). + // + // Log-only on failure: EndSync was the last mutation allowed to fail + // the sync. The artifact is complete and an absent marker is safe by + // design, while a returned error here would read as a FAILED sync — + // IsSyncPreservable callers would discard a finished artifact and a + // retry would re-collect from scratch over it. + if err := s.persistIngestInvariantVerification(ctx); err != nil { + l.Warn("failed to persist ingest invariant verification; the sealed sync remains unverified", zap.Error(err)) + } + if s.recordStats { l.Info("Sync complete.", s.syncSummaryFields(span)...) } else { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor_pebble.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor_pebble.go index 9f13b65d..a718034a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor_pebble.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor_pebble.go @@ -680,6 +680,12 @@ func (c *Compactor) compactPebbleFold(ctx context.Context) (string, error) { baseRec.SetSyncId(newSyncID) baseRec.SetParentSyncId("") baseRec.SetType(unionType) + // The fold mutated the inherited base keyspace. Never publish the base + // artifact's pre-fold verification as proof of the merged output; a later + // expansion/invariant pass will write a fresh marker when one runs. + baseRec.SetIngestInvariantGeneration("") + baseRec.SetIngestInvariantCoverage(nil) + baseRec.SetIngestInvariantMode("") if !maxEnded.IsZero() { baseRec.SetEndedAt(timestamppb.New(maxEnded)) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/issue_credential.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/issue_credential.go new file mode 100644 index 00000000..1b408829 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/issue_credential.go @@ -0,0 +1,59 @@ +package c1api + +import ( + "context" + "errors" + + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" + "google.golang.org/protobuf/proto" + + 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/annotations" + "github.com/conductorone/baton-sdk/pkg/tasks" + "github.com/conductorone/baton-sdk/pkg/types" + "github.com/conductorone/baton-sdk/pkg/uotel" +) + +type issueCredentialHelpers interface { + ConnectorClient() types.ConnectorClient + FinishTask(ctx context.Context, response proto.Message, annos annotations.Annotations, err error) error +} + +type issueCredentialTaskHandler struct { + task *v1.Task + helpers issueCredentialHelpers +} + +func (h *issueCredentialTaskHandler) HandleTask(ctx context.Context) error { + ctx, span := tracer.Start(ctx, "issueCredentialTaskHandler.HandleTask") + var err error + defer func() { uotel.EndSpanWithError(span, err) }() + l := ctxzap.Extract(ctx).With(zap.String("task_id", h.task.GetId()), zap.Stringer("task_type", tasks.GetType(h.task))) + + t := h.task.GetIssueCredential() + if t == nil || t.GetIdentityId() == nil || t.GetCredentialOptions() == nil || len(t.GetEncryptionConfigs()) == 0 { + l.Error("issue credential task is malformed") + return h.helpers.FinishTask(ctx, nil, nil, errors.Join(errors.New("malformed issue credential task"), ErrTaskNonRetryable)) + } + + resp, err := h.helpers.ConnectorClient().IssueCredential(ctx, v2.IssueCredentialRequest_builder{ + IdentityId: t.GetIdentityId(), + CredentialOptions: t.GetCredentialOptions(), + EncryptionConfigs: t.GetEncryptionConfigs(), + RequestId: h.task.GetId(), + ExpiresAt: t.GetExpiresAt(), + }.Build()) + if err != nil { + // Issuance may have succeeded before transport failure. Until a connector + // advertises and implements durable idempotency, never replay ambiguity. + l.Error("failed issuing credential", zap.Error(err)) + return h.helpers.FinishTask(ctx, nil, nil, errors.Join(err, ErrTaskNonRetryable)) + } + return h.helpers.FinishTask(ctx, resp, resp.GetAnnotations(), nil) +} + +func newIssueCredentialTaskHandler(task *v1.Task, helpers issueCredentialHelpers) tasks.TaskHandler { + return &issueCredentialTaskHandler{task: task, helpers: helpers} +} 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 c0df2348..eafc1bce 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 @@ -449,6 +449,8 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. handler = newDeleteResourceTaskHandler(task, tHelpers) case taskTypes.RotateCredentialsType: handler = newRotateCredentialsTaskHandler(task, tHelpers) + case taskTypes.IssueCredentialType: + handler = newIssueCredentialTaskHandler(task, tHelpers) case taskTypes.CreateTicketType: handler = newCreateTicketTaskHandler(task, tHelpers) case taskTypes.ListTicketSchemasType: 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 b5590414..73294fa0 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go @@ -48,6 +48,8 @@ func Is(task *v1.Task, target taskTypes.TaskType) bool { return actualType == v1.Task_DeleteResource_case case taskTypes.RotateCredentialsType: return actualType == v1.Task_RotateCredentials_case + case taskTypes.IssueCredentialType: + return actualType == v1.Task_IssueCredential_case case taskTypes.CreateTicketType: return actualType == v1.Task_CreateTicketTask_case case taskTypes.ListTicketSchemasType: @@ -103,6 +105,8 @@ func GetType(task *v1.Task) taskTypes.TaskType { return taskTypes.DeleteResourceType case v1.Task_RotateCredentials_case: return taskTypes.RotateCredentialsType + case v1.Task_IssueCredential_case: + return taskTypes.IssueCredentialType case v1.Task_CreateTicketTask_case: return taskTypes.CreateTicketType case v1.Task_ListTicketSchemas_case: 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 07e38a89..e35d82cf 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 @@ -24,6 +24,8 @@ func (tt TaskType) String() string { return "delete_resource" case RotateCredentialsType: return "rotate_credential" + case IssueCredentialType: + return "issue_credential" case CreateTicketType: return "create_ticket" case ListTicketSchemasType: @@ -104,4 +106,5 @@ const ( ActionStatusType CreateSyncDiff ListStaticEntitlementsType + IssueCredentialType ) diff --git a/vendor/modules.txt b/vendor/modules.txt index 611fd2d5..efce5acd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -272,7 +272,7 @@ github.com/cockroachdb/swiss # github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 ## explicit; go 1.19 github.com/cockroachdb/tokenbucket -# github.com/conductorone/baton-sdk v0.20.2-0.20260723131150-d8580bf69231 +# github.com/conductorone/baton-sdk v0.20.3 ## explicit; go 1.25.2 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1