From 5be3781aab7322de023d8261ce6fc6b374531910 Mon Sep 17 00:00:00 2001 From: Ravina Dhruve Date: Tue, 5 Sep 2023 12:52:47 -0700 Subject: [PATCH 01/19] SSPROD-29308: Implement CloudAccount client v2 for Secure Change summary: ----------------- Adding a new CloudAccount client v2 for making Secure BE (cloudauth) APIs to support API-only onboarding support. --- sysdig/internal/client/v2/cloud_account_v2.go | 97 +++++++++++++++++++ sysdig/internal/client/v2/model.go | 10 ++ sysdig/internal/client/v2/sysdig.go | 1 + 3 files changed, 108 insertions(+) create mode 100644 sysdig/internal/client/v2/cloud_account_v2.go diff --git a/sysdig/internal/client/v2/cloud_account_v2.go b/sysdig/internal/client/v2/cloud_account_v2.go new file mode 100644 index 000000000..ef138ead4 --- /dev/null +++ b/sysdig/internal/client/v2/cloud_account_v2.go @@ -0,0 +1,97 @@ +package v2 + +import ( + "context" + "fmt" + "net/http" +) + +const ( + cloudAccountsPathV2 = "%s/api/cloudauth/v1/accounts" + cloudAccountPathV2 = "%s/api/cloudauth/v1/accounts/%s" +) + +type CloudAccountSecureInterfaceV2 interface { + Base + CreateCloudAccountSecureV2(ctx context.Context, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) + GetCloudAccountSecureV2(ctx context.Context, accountID string) (*CloudAccountSecureV2, error) + DeleteCloudAccountSecureV2(ctx context.Context, accountID string) error + UpdateCloudAccountSecureV2(ctx context.Context, accountID string, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) +} + +func (client *Client) CreateCloudAccountSecureV2(ctx context.Context, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) { + // TODO: convert payload as per cloudauth API request object OR till API is updated return {}, nil + payload, err := Marshal(cloudAccount) + if err != nil { + return nil, err + } + + response, err := client.requester.Request(ctx, http.MethodPost, client.cloudAccountsV2URL(), payload) + if err != nil { + return nil, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusCreated { + err = client.ErrorFromResponse(response) + return nil, err + } + + // TODO: convert response as per return CloudAccountSecureV2 struct OR till API is updated return {}, nil + return Unmarshal[*CloudAccountSecureV2](response.Body) +} + +func (client *Client) GetCloudAccountSecureV2(ctx context.Context, accountID string) (*CloudAccountSecureV2, error) { + response, err := client.requester.Request(ctx, http.MethodGet, client.cloudAccountV2URL(accountID), nil) + if err != nil { + return nil, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusOK { + return nil, client.ErrorFromResponse(response) + } + + return Unmarshal[*CloudAccountSecureV2](response.Body) +} + +func (client *Client) DeleteCloudAccountSecureV2(ctx context.Context, accountID string) error { + response, err := client.requester.Request(ctx, http.MethodDelete, client.cloudAccountV2URL(accountID), nil) + if err != nil { + return err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusNoContent && response.StatusCode != http.StatusOK { + return client.ErrorFromResponse(response) + } + return nil +} + +func (client *Client) UpdateCloudAccountSecureV2(ctx context.Context, accountID string, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) { + payload, err := Marshal(cloudAccount) + if err != nil { + return nil, err + } + + response, err := client.requester.Request(ctx, http.MethodPut, client.cloudAccountV2URL(accountID), payload) + if err != nil { + return nil, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusOK { + err = client.ErrorFromResponse(response) + return nil, err + } + + return Unmarshal[*CloudAccountSecureV2](response.Body) +} + +func (client *Client) cloudAccountsV2URL() string { + return fmt.Sprintf(cloudAccountsPathV2, client.config.url) +} + +func (client *Client) cloudAccountV2URL(accountID string) string { + return fmt.Sprintf(cloudAccountPathV2, client.config.url, accountID) +} diff --git a/sysdig/internal/client/v2/model.go b/sysdig/internal/client/v2/model.go index 0094d81a4..17d386d85 100644 --- a/sysdig/internal/client/v2/model.go +++ b/sysdig/internal/client/v2/model.go @@ -411,6 +411,16 @@ type CloudAccountSecure struct { WorkLoadIdentityAccountID string `json:"workloadIdentityAccountId,omitempty"` WorkLoadIdentityAccountAlias string `json:"workLoadIdentityAccountAlias,omitempty"` } + +type CloudAccountSecureV2 struct { + // TODO: we might need more fields based on the module definition finalized for each provider & + // feature combination, resulting in the corresponding components info to be passed in here + AccountID string `json:"accountId"` + Provider string `json:"provider"` + IntegrationType string `json:"integrationType"` + AdditionalOptions string `json:"additionalOptions"` +} + type ScanningPolicy struct { ID string `json:"id,omitempty"` Version string `json:"version,omitempty"` diff --git a/sysdig/internal/client/v2/sysdig.go b/sysdig/internal/client/v2/sysdig.go index 0e896a0c9..5c3e6f9ac 100644 --- a/sysdig/internal/client/v2/sysdig.go +++ b/sysdig/internal/client/v2/sysdig.go @@ -43,6 +43,7 @@ type SysdigSecure interface { VulnerabilityExceptionListInterface VulnerabilityExceptionInterface CloudAccountSecureInterface + CloudAccountSecureInterfaceV2 } func (sr *SysdigRequest) Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error) { From f39910a15124673b18048ffcc25660dd365572bc Mon Sep 17 00:00:00 2001 From: Ravina Dhruve Date: Wed, 6 Sep 2023 11:13:00 -0700 Subject: [PATCH 02/19] SSPROD-29308: Update the CloudAccountSecureV2 model object --- sysdig/internal/client/v2/cloud_account_v2.go | 2 -- sysdig/internal/client/v2/model.go | 33 +++++++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/sysdig/internal/client/v2/cloud_account_v2.go b/sysdig/internal/client/v2/cloud_account_v2.go index ef138ead4..fbc634aaf 100644 --- a/sysdig/internal/client/v2/cloud_account_v2.go +++ b/sysdig/internal/client/v2/cloud_account_v2.go @@ -20,7 +20,6 @@ type CloudAccountSecureInterfaceV2 interface { } func (client *Client) CreateCloudAccountSecureV2(ctx context.Context, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) { - // TODO: convert payload as per cloudauth API request object OR till API is updated return {}, nil payload, err := Marshal(cloudAccount) if err != nil { return nil, err @@ -37,7 +36,6 @@ func (client *Client) CreateCloudAccountSecureV2(ctx context.Context, cloudAccou return nil, err } - // TODO: convert response as per return CloudAccountSecureV2 struct OR till API is updated return {}, nil return Unmarshal[*CloudAccountSecureV2](response.Body) } diff --git a/sysdig/internal/client/v2/model.go b/sysdig/internal/client/v2/model.go index 17d386d85..00a588716 100644 --- a/sysdig/internal/client/v2/model.go +++ b/sysdig/internal/client/v2/model.go @@ -1,5 +1,7 @@ package v2 +import "google.golang.org/protobuf/types/known/timestamppb" + type Team struct { UserRoles []UserRoles `json:"userRoles,omitempty"` Description string `json:"description"` @@ -412,13 +414,32 @@ type CloudAccountSecure struct { WorkLoadIdentityAccountAlias string `json:"workLoadIdentityAccountAlias,omitempty"` } +type CloudAccountFeature struct { + // TODO: define fields based on how features are passed in TF resource, + // and in sync with modified cloudAccount API request body +} + +type CloudAccountFeatures struct { + SecureThreatDetection *CloudAccountFeature + SecureConfigPosture *CloudAccountFeature + SecureIdentityEntitlement *CloudAccountFeature + MonitorCloudMetrics *CloudAccountFeature + SecureAgentlessScanning *CloudAccountFeature +} + type CloudAccountSecureV2 struct { - // TODO: we might need more fields based on the module definition finalized for each provider & - // feature combination, resulting in the corresponding components info to be passed in here - AccountID string `json:"accountId"` - Provider string `json:"provider"` - IntegrationType string `json:"integrationType"` - AdditionalOptions string `json:"additionalOptions"` + Id string `json:"id,omitempty"` + CustomerId uint64 `json:"customerId,omitempty"` + Enabled bool `json:"enabled,omitempty"` + OrganizationId string `json:"organizationId,omitempty"` + Name string `json:"name,omitempty"` + ProviderId string `json:"providerId,omitempty"` // cloud provider's account id + ProviderAlias string `json:"providerAlias,omitempty"` // cloud provider alias + Provider string `json:"provider,omitempty"` // cloud provider + Feature *CloudAccountFeatures `json:"feature,omitempty"` + Components []string `json:"components,omitempty"` + CreatedAt *timestamppb.Timestamp `json:"createdAt,omitempty"` + UpdatedAt *timestamppb.Timestamp `json:"updatedAt,omitempty"` } type ScanningPolicy struct { From c0418fcb27f9bb41470cc39b17b65eda218f185e Mon Sep 17 00:00:00 2001 From: Ravina Dhruve Date: Wed, 6 Sep 2023 14:40:35 -0700 Subject: [PATCH 03/19] SSPROD-29308: Use cloudauth proto objects and rename client file --- go.mod | 3 +- go.sum | 53 +---------- sysdig/internal/client/v2/cloud_account_v2.go | 95 ------------------- sysdig/internal/client/v2/cloudauth.go | 95 +++++++++++++++++++ sysdig/internal/client/v2/model.go | 32 +------ sysdig/internal/client/v2/sysdig.go | 2 +- 6 files changed, 106 insertions(+), 174 deletions(-) delete mode 100644 sysdig/internal/client/v2/cloud_account_v2.go create mode 100644 sysdig/internal/client/v2/cloudauth.go diff --git a/go.mod b/go.mod index d59310fd1..f7ce97bb4 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.19 require ( github.com/Jeffail/gabs/v2 v2.7.0 github.com/aws/aws-sdk-go v1.44.280 + github.com/draios/protorepo/cloudauth/go v0.0.0-20230901163632-fcbfe0cb84e0 github.com/falcosecurity/kilt/runtimes/cloudformation v0.0.0-20230606123839-2e4c434d5d88 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-retryablehttp v0.7.4 @@ -75,7 +76,7 @@ require ( golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect + google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect google.golang.org/grpc v1.51.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 13a96b63a..543696945 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Jeffail/gabs/v2 v2.7.0 h1:Y2edYaTcE8ZpRsR2AtmPu5xQdFDIthFG0jYhu5PY8kg= @@ -25,8 +24,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.44.280 h1:UYl/yxhDxP8naok6ftWyQ9/9ZzNwjC9dvEs/j8BkGhw= github.com/aws/aws-sdk-go v1.44.280/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/stargz-snapshotter/estargz v0.12.1 h1:+7nYmHJb0tEkcRaAW+MHqoKaJYZmkikupxCqVtmPuY0= github.com/containerd/stargz-snapshotter/estargz v0.12.1/go.mod h1:12VUuCq3qPq4y8yUW+l5w3+oXV3cx2Po3KSe/SmPGqw= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -43,10 +40,10 @@ github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPa github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/draios/protorepo/cloudauth/go v0.0.0-20230901163632-fcbfe0cb84e0 h1:LKBglxJ55sl7NuP5IrC/SD89ZQFwN8ejh8XGJ0dj5P0= +github.com/draios/protorepo/cloudauth/go v0.0.0-20230901163632-fcbfe0cb84e0/go.mod h1:JmBZh3AOhz4gg83qMw9p2QDCIiLSH9YCyyvDVClIynU= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/falcosecurity/kilt/pkg v0.0.0-20230111165949-b36cdd622de1 h1:7JOAJwPA4FEtowSP133pgicOu+nOfo0wGuXapXKhafk= github.com/falcosecurity/kilt/pkg v0.0.0-20230111165949-b36cdd622de1/go.mod h1:5vLX/acsvZ4KmzUSewi2KVKt6MAm50NIaPB87ofs9j4= github.com/falcosecurity/kilt/runtimes/cloudformation v0.0.0-20230606123839-2e4c434d5d88 h1:vyeIOHLAt+3rBWVBx+eDYiKgiFwoC32dCAKE86HUQKw= @@ -69,26 +66,15 @@ github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -208,7 +194,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= @@ -263,20 +248,13 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -290,17 +268,14 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -339,10 +314,6 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= @@ -353,24 +324,10 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 h1:jmIfw8+gSvXcZSgaFAGyInDXeWzUhvYH57G/5GKMn70= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= @@ -393,5 +350,3 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/sysdig/internal/client/v2/cloud_account_v2.go b/sysdig/internal/client/v2/cloud_account_v2.go deleted file mode 100644 index fbc634aaf..000000000 --- a/sysdig/internal/client/v2/cloud_account_v2.go +++ /dev/null @@ -1,95 +0,0 @@ -package v2 - -import ( - "context" - "fmt" - "net/http" -) - -const ( - cloudAccountsPathV2 = "%s/api/cloudauth/v1/accounts" - cloudAccountPathV2 = "%s/api/cloudauth/v1/accounts/%s" -) - -type CloudAccountSecureInterfaceV2 interface { - Base - CreateCloudAccountSecureV2(ctx context.Context, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) - GetCloudAccountSecureV2(ctx context.Context, accountID string) (*CloudAccountSecureV2, error) - DeleteCloudAccountSecureV2(ctx context.Context, accountID string) error - UpdateCloudAccountSecureV2(ctx context.Context, accountID string, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) -} - -func (client *Client) CreateCloudAccountSecureV2(ctx context.Context, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) { - payload, err := Marshal(cloudAccount) - if err != nil { - return nil, err - } - - response, err := client.requester.Request(ctx, http.MethodPost, client.cloudAccountsV2URL(), payload) - if err != nil { - return nil, err - } - defer response.Body.Close() - - if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusCreated { - err = client.ErrorFromResponse(response) - return nil, err - } - - return Unmarshal[*CloudAccountSecureV2](response.Body) -} - -func (client *Client) GetCloudAccountSecureV2(ctx context.Context, accountID string) (*CloudAccountSecureV2, error) { - response, err := client.requester.Request(ctx, http.MethodGet, client.cloudAccountV2URL(accountID), nil) - if err != nil { - return nil, err - } - defer response.Body.Close() - - if response.StatusCode != http.StatusOK { - return nil, client.ErrorFromResponse(response) - } - - return Unmarshal[*CloudAccountSecureV2](response.Body) -} - -func (client *Client) DeleteCloudAccountSecureV2(ctx context.Context, accountID string) error { - response, err := client.requester.Request(ctx, http.MethodDelete, client.cloudAccountV2URL(accountID), nil) - if err != nil { - return err - } - defer response.Body.Close() - - if response.StatusCode != http.StatusNoContent && response.StatusCode != http.StatusOK { - return client.ErrorFromResponse(response) - } - return nil -} - -func (client *Client) UpdateCloudAccountSecureV2(ctx context.Context, accountID string, cloudAccount *CloudAccountSecureV2) (*CloudAccountSecureV2, error) { - payload, err := Marshal(cloudAccount) - if err != nil { - return nil, err - } - - response, err := client.requester.Request(ctx, http.MethodPut, client.cloudAccountV2URL(accountID), payload) - if err != nil { - return nil, err - } - defer response.Body.Close() - - if response.StatusCode != http.StatusOK { - err = client.ErrorFromResponse(response) - return nil, err - } - - return Unmarshal[*CloudAccountSecureV2](response.Body) -} - -func (client *Client) cloudAccountsV2URL() string { - return fmt.Sprintf(cloudAccountsPathV2, client.config.url) -} - -func (client *Client) cloudAccountV2URL(accountID string) string { - return fmt.Sprintf(cloudAccountPathV2, client.config.url, accountID) -} diff --git a/sysdig/internal/client/v2/cloudauth.go b/sysdig/internal/client/v2/cloudauth.go new file mode 100644 index 000000000..91484a4fb --- /dev/null +++ b/sysdig/internal/client/v2/cloudauth.go @@ -0,0 +1,95 @@ +package v2 + +import ( + "context" + "fmt" + "net/http" +) + +const ( + cloudauthAccountsPath = "%s/api/cloudauth/v1/accounts" + cloudauthAccountPath = "%s/api/cloudauth/v1/accounts/%s" +) + +type CloudauthAccountSecureInterface interface { + Base + CreateCloudauthAccountSecure(ctx context.Context, cloudAccount *CloudauthAccountSecure) (*CloudauthAccountSecure, error) + GetCloudauthAccountSecure(ctx context.Context, accountID string) (*CloudauthAccountSecure, error) + DeleteCloudauthAccountSecure(ctx context.Context, accountID string) error + UpdateCloudauthAccountSecure(ctx context.Context, accountID string, cloudAccount *CloudauthAccountSecure) (*CloudauthAccountSecure, error) +} + +func (client *Client) CreateCloudauthAccountSecure(ctx context.Context, cloudAccount *CloudauthAccountSecure) (*CloudauthAccountSecure, error) { + payload, err := Marshal(cloudAccount) + if err != nil { + return nil, err + } + + response, err := client.requester.Request(ctx, http.MethodPost, client.cloudauthAccountsURL(), payload) + if err != nil { + return nil, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusCreated { + err = client.ErrorFromResponse(response) + return nil, err + } + + return Unmarshal[*CloudauthAccountSecure](response.Body) +} + +func (client *Client) GetCloudauthAccountSecure(ctx context.Context, accountID string) (*CloudauthAccountSecure, error) { + response, err := client.requester.Request(ctx, http.MethodGet, client.cloudauthAccountURL(accountID), nil) + if err != nil { + return nil, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusOK { + return nil, client.ErrorFromResponse(response) + } + + return Unmarshal[*CloudauthAccountSecure](response.Body) +} + +func (client *Client) DeleteCloudauthAccountSecure(ctx context.Context, accountID string) error { + response, err := client.requester.Request(ctx, http.MethodDelete, client.cloudauthAccountURL(accountID), nil) + if err != nil { + return err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusNoContent && response.StatusCode != http.StatusOK { + return client.ErrorFromResponse(response) + } + return nil +} + +func (client *Client) UpdateCloudauthAccountSecure(ctx context.Context, accountID string, cloudAccount *CloudauthAccountSecure) (*CloudauthAccountSecure, error) { + payload, err := Marshal(cloudAccount) + if err != nil { + return nil, err + } + + response, err := client.requester.Request(ctx, http.MethodPut, client.cloudauthAccountURL(accountID), payload) + if err != nil { + return nil, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusOK { + err = client.ErrorFromResponse(response) + return nil, err + } + + return Unmarshal[*CloudauthAccountSecure](response.Body) +} + +func (client *Client) cloudauthAccountsURL() string { + return fmt.Sprintf(cloudauthAccountsPath, client.config.url) +} + +func (client *Client) cloudauthAccountURL(accountID string) string { + return fmt.Sprintf(cloudauthAccountPath, client.config.url, accountID) +} diff --git a/sysdig/internal/client/v2/model.go b/sysdig/internal/client/v2/model.go index 00a588716..e51e512b5 100644 --- a/sysdig/internal/client/v2/model.go +++ b/sysdig/internal/client/v2/model.go @@ -1,6 +1,8 @@ package v2 -import "google.golang.org/protobuf/types/known/timestamppb" +import ( + proto "github.com/draios/protorepo/cloudauth/go" +) type Team struct { UserRoles []UserRoles `json:"userRoles,omitempty"` @@ -414,33 +416,7 @@ type CloudAccountSecure struct { WorkLoadIdentityAccountAlias string `json:"workLoadIdentityAccountAlias,omitempty"` } -type CloudAccountFeature struct { - // TODO: define fields based on how features are passed in TF resource, - // and in sync with modified cloudAccount API request body -} - -type CloudAccountFeatures struct { - SecureThreatDetection *CloudAccountFeature - SecureConfigPosture *CloudAccountFeature - SecureIdentityEntitlement *CloudAccountFeature - MonitorCloudMetrics *CloudAccountFeature - SecureAgentlessScanning *CloudAccountFeature -} - -type CloudAccountSecureV2 struct { - Id string `json:"id,omitempty"` - CustomerId uint64 `json:"customerId,omitempty"` - Enabled bool `json:"enabled,omitempty"` - OrganizationId string `json:"organizationId,omitempty"` - Name string `json:"name,omitempty"` - ProviderId string `json:"providerId,omitempty"` // cloud provider's account id - ProviderAlias string `json:"providerAlias,omitempty"` // cloud provider alias - Provider string `json:"provider,omitempty"` // cloud provider - Feature *CloudAccountFeatures `json:"feature,omitempty"` - Components []string `json:"components,omitempty"` - CreatedAt *timestamppb.Timestamp `json:"createdAt,omitempty"` - UpdatedAt *timestamppb.Timestamp `json:"updatedAt,omitempty"` -} +type CloudauthAccountSecure proto.CloudAccount type ScanningPolicy struct { ID string `json:"id,omitempty"` diff --git a/sysdig/internal/client/v2/sysdig.go b/sysdig/internal/client/v2/sysdig.go index 5c3e6f9ac..f79c43ba4 100644 --- a/sysdig/internal/client/v2/sysdig.go +++ b/sysdig/internal/client/v2/sysdig.go @@ -43,7 +43,7 @@ type SysdigSecure interface { VulnerabilityExceptionListInterface VulnerabilityExceptionInterface CloudAccountSecureInterface - CloudAccountSecureInterfaceV2 + CloudauthAccountSecureInterface } func (sr *SysdigRequest) Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error) { From cba58df022071f5d09a03ec27cc4bd54aa08b26b Mon Sep 17 00:00:00 2001 From: Ravina Dhruve Date: Wed, 6 Sep 2023 17:15:02 -0700 Subject: [PATCH 04/19] SSPROD-29308: Add cloudauth pb.go files copy --- .../v2/cloudauth/go/account_component.pb.go | 2693 +++++++++++++++++ .../v2/cloudauth/go/cloud_account.pb.go | 649 ++++ .../v2/cloudauth/go/cloud_organization.pb.go | 258 ++ sysdig/internal/client/v2/model.go | 4 +- 4 files changed, 3602 insertions(+), 2 deletions(-) create mode 100644 sysdig/internal/client/v2/cloudauth/go/account_component.pb.go create mode 100644 sysdig/internal/client/v2/cloudauth/go/cloud_account.pb.go create mode 100644 sysdig/internal/client/v2/cloudauth/go/cloud_organization.pb.go diff --git a/sysdig/internal/client/v2/cloudauth/go/account_component.pb.go b/sysdig/internal/client/v2/cloudauth/go/account_component.pb.go new file mode 100644 index 000000000..969b7bb63 --- /dev/null +++ b/sysdig/internal/client/v2/cloudauth/go/account_component.pb.go @@ -0,0 +1,2693 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: account_component.proto + +package draiosproto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Component enumerates all available component types +type Component int32 + +const ( + Component_COMPONENT_UNSPECIFIED Component = 0 // noop component; default value + Component_COMPONENT_CLOUD_CONNECTOR Component = 1 + Component_COMPONENT_TRUSTED_ROLE Component = 3 + Component_COMPONENT_EVENT_BRIDGE Component = 2 + Component_COMPONENT_SERVICE_PRINCIPAL Component = 4 + Component_COMPONENT_WEBHOOK_DATASOURCE Component = 5 + Component_COMPONENT_CRYPTO_KEY Component = 6 + Component_COMPONENT_CLOUD_LOGS Component = 7 +) + +// Enum value maps for Component. +var ( + Component_name = map[int32]string{ + 0: "COMPONENT_UNSPECIFIED", + 1: "COMPONENT_CLOUD_CONNECTOR", + 3: "COMPONENT_TRUSTED_ROLE", + 2: "COMPONENT_EVENT_BRIDGE", + 4: "COMPONENT_SERVICE_PRINCIPAL", + 5: "COMPONENT_WEBHOOK_DATASOURCE", + 6: "COMPONENT_CRYPTO_KEY", + 7: "COMPONENT_CLOUD_LOGS", + } + Component_value = map[string]int32{ + "COMPONENT_UNSPECIFIED": 0, + "COMPONENT_CLOUD_CONNECTOR": 1, + "COMPONENT_TRUSTED_ROLE": 3, + "COMPONENT_EVENT_BRIDGE": 2, + "COMPONENT_SERVICE_PRINCIPAL": 4, + "COMPONENT_WEBHOOK_DATASOURCE": 5, + "COMPONENT_CRYPTO_KEY": 6, + "COMPONENT_CLOUD_LOGS": 7, + } +) + +func (x Component) Enum() *Component { + p := new(Component) + *p = x + return p +} + +func (x Component) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Component) Descriptor() protoreflect.EnumDescriptor { + return file_account_component_proto_enumTypes[0].Descriptor() +} + +func (Component) Type() protoreflect.EnumType { + return &file_account_component_proto_enumTypes[0] +} + +func (x Component) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Component.Descriptor instead. +func (Component) EnumDescriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{0} +} + +// FeatureComponents enumerates all components available to a feature +type FeatureComponents struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CloudConnector *AccountComponent `protobuf:"bytes,1,opt,name=cloud_connector,json=cloudConnector,proto3,oneof" json:"cloud_connector,omitempty"` + EventBridge *AccountComponent `protobuf:"bytes,2,opt,name=event_bridge,json=eventBridge,proto3,oneof" json:"event_bridge,omitempty"` + TrustedRole *AccountComponent `protobuf:"bytes,3,opt,name=trusted_role,json=trustedRole,proto3,oneof" json:"trusted_role,omitempty"` + ServicePrincipal *AccountComponent `protobuf:"bytes,4,opt,name=service_principal,json=servicePrincipal,proto3,oneof" json:"service_principal,omitempty"` + WebhookDatasource *AccountComponent `protobuf:"bytes,5,opt,name=webhook_datasource,json=webhookDatasource,proto3,oneof" json:"webhook_datasource,omitempty"` + CryptoKey *AccountComponent `protobuf:"bytes,6,opt,name=crypto_key,json=cryptoKey,proto3,oneof" json:"crypto_key,omitempty"` + CloudLogs *AccountComponent `protobuf:"bytes,7,opt,name=cloud_logs,json=cloudLogs,proto3,oneof" json:"cloud_logs,omitempty"` +} + +func (x *FeatureComponents) Reset() { + *x = FeatureComponents{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureComponents) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureComponents) ProtoMessage() {} + +func (x *FeatureComponents) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureComponents.ProtoReflect.Descriptor instead. +func (*FeatureComponents) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{0} +} + +func (x *FeatureComponents) GetCloudConnector() *AccountComponent { + if x != nil { + return x.CloudConnector + } + return nil +} + +func (x *FeatureComponents) GetEventBridge() *AccountComponent { + if x != nil { + return x.EventBridge + } + return nil +} + +func (x *FeatureComponents) GetTrustedRole() *AccountComponent { + if x != nil { + return x.TrustedRole + } + return nil +} + +func (x *FeatureComponents) GetServicePrincipal() *AccountComponent { + if x != nil { + return x.ServicePrincipal + } + return nil +} + +func (x *FeatureComponents) GetWebhookDatasource() *AccountComponent { + if x != nil { + return x.WebhookDatasource + } + return nil +} + +func (x *FeatureComponents) GetCryptoKey() *AccountComponent { + if x != nil { + return x.CryptoKey + } + return nil +} + +func (x *FeatureComponents) GetCloudLogs() *AccountComponent { + if x != nil { + return x.CloudLogs + } + return nil +} + +// AccountComponent captures resourced deployed to a cloud +type AccountComponent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type Component `protobuf:"varint,1,opt,name=type,proto3,enum=draiosproto.Component" json:"type,omitempty"` + Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + ValidatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=validated_at,json=validatedAt,proto3" json:"validated_at,omitempty"` + Account *CloudAccount `protobuf:"bytes,7,opt,name=account,proto3" json:"account,omitempty"` + // Types that are assignable to Metadata: + // + // *AccountComponent_CloudConnectorMetadata + // *AccountComponent_TrustedRoleMetadata + // *AccountComponent_EventBridgeMetadata + // *AccountComponent_ServicePrincipalMetadata + // *AccountComponent_WebhookDatasourceMetadata + // *AccountComponent_CryptoKeyMetadata + // *AccountComponent_CloudLogsMetadata + Metadata isAccountComponent_Metadata `protobuf_oneof:"metadata"` +} + +func (x *AccountComponent) Reset() { + *x = AccountComponent{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountComponent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountComponent) ProtoMessage() {} + +func (x *AccountComponent) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountComponent.ProtoReflect.Descriptor instead. +func (*AccountComponent) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{1} +} + +func (x *AccountComponent) GetType() Component { + if x != nil { + return x.Type + } + return Component_COMPONENT_UNSPECIFIED +} + +func (x *AccountComponent) GetInstance() string { + if x != nil { + return x.Instance + } + return "" +} + +func (x *AccountComponent) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *AccountComponent) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *AccountComponent) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *AccountComponent) GetValidatedAt() *timestamppb.Timestamp { + if x != nil { + return x.ValidatedAt + } + return nil +} + +func (x *AccountComponent) GetAccount() *CloudAccount { + if x != nil { + return x.Account + } + return nil +} + +func (m *AccountComponent) GetMetadata() isAccountComponent_Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (x *AccountComponent) GetCloudConnectorMetadata() *CloudConnectorMetadata { + if x, ok := x.GetMetadata().(*AccountComponent_CloudConnectorMetadata); ok { + return x.CloudConnectorMetadata + } + return nil +} + +func (x *AccountComponent) GetTrustedRoleMetadata() *TrustedRoleMetadata { + if x, ok := x.GetMetadata().(*AccountComponent_TrustedRoleMetadata); ok { + return x.TrustedRoleMetadata + } + return nil +} + +func (x *AccountComponent) GetEventBridgeMetadata() *EventBridgeMetadata { + if x, ok := x.GetMetadata().(*AccountComponent_EventBridgeMetadata); ok { + return x.EventBridgeMetadata + } + return nil +} + +func (x *AccountComponent) GetServicePrincipalMetadata() *ServicePrincipalMetadata { + if x, ok := x.GetMetadata().(*AccountComponent_ServicePrincipalMetadata); ok { + return x.ServicePrincipalMetadata + } + return nil +} + +func (x *AccountComponent) GetWebhookDatasourceMetadata() *WebhookDatasourceMetadata { + if x, ok := x.GetMetadata().(*AccountComponent_WebhookDatasourceMetadata); ok { + return x.WebhookDatasourceMetadata + } + return nil +} + +func (x *AccountComponent) GetCryptoKeyMetadata() *CryptoKeyMetadata { + if x, ok := x.GetMetadata().(*AccountComponent_CryptoKeyMetadata); ok { + return x.CryptoKeyMetadata + } + return nil +} + +func (x *AccountComponent) GetCloudLogsMetadata() *CloudLogsMetadata { + if x, ok := x.GetMetadata().(*AccountComponent_CloudLogsMetadata); ok { + return x.CloudLogsMetadata + } + return nil +} + +type isAccountComponent_Metadata interface { + isAccountComponent_Metadata() +} + +type AccountComponent_CloudConnectorMetadata struct { + CloudConnectorMetadata *CloudConnectorMetadata `protobuf:"bytes,10,opt,name=cloud_connector_metadata,json=cloudConnectorMetadata,proto3,oneof"` +} + +type AccountComponent_TrustedRoleMetadata struct { + TrustedRoleMetadata *TrustedRoleMetadata `protobuf:"bytes,11,opt,name=trusted_role_metadata,json=trustedRoleMetadata,proto3,oneof"` +} + +type AccountComponent_EventBridgeMetadata struct { + EventBridgeMetadata *EventBridgeMetadata `protobuf:"bytes,12,opt,name=event_bridge_metadata,json=eventBridgeMetadata,proto3,oneof"` +} + +type AccountComponent_ServicePrincipalMetadata struct { + ServicePrincipalMetadata *ServicePrincipalMetadata `protobuf:"bytes,13,opt,name=service_principal_metadata,json=servicePrincipalMetadata,proto3,oneof"` +} + +type AccountComponent_WebhookDatasourceMetadata struct { + WebhookDatasourceMetadata *WebhookDatasourceMetadata `protobuf:"bytes,14,opt,name=webhook_datasource_metadata,json=webhookDatasourceMetadata,proto3,oneof"` +} + +type AccountComponent_CryptoKeyMetadata struct { + CryptoKeyMetadata *CryptoKeyMetadata `protobuf:"bytes,15,opt,name=crypto_key_metadata,json=cryptoKeyMetadata,proto3,oneof"` +} + +type AccountComponent_CloudLogsMetadata struct { + CloudLogsMetadata *CloudLogsMetadata `protobuf:"bytes,16,opt,name=cloud_logs_metadata,json=cloudLogsMetadata,proto3,oneof"` +} + +func (*AccountComponent_CloudConnectorMetadata) isAccountComponent_Metadata() {} + +func (*AccountComponent_TrustedRoleMetadata) isAccountComponent_Metadata() {} + +func (*AccountComponent_EventBridgeMetadata) isAccountComponent_Metadata() {} + +func (*AccountComponent_ServicePrincipalMetadata) isAccountComponent_Metadata() {} + +func (*AccountComponent_WebhookDatasourceMetadata) isAccountComponent_Metadata() {} + +func (*AccountComponent_CryptoKeyMetadata) isAccountComponent_Metadata() {} + +func (*AccountComponent_CloudLogsMetadata) isAccountComponent_Metadata() {} + +// CloudConnectorMetadata captures the metadata associated with a cloud connector deployment, segmented by provider type +type CloudConnectorMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // + // *CloudConnectorMetadata_Aws + // *CloudConnectorMetadata_Azure_ + // *CloudConnectorMetadata_Gcp + Provider isCloudConnectorMetadata_Provider `protobuf_oneof:"provider"` +} + +func (x *CloudConnectorMetadata) Reset() { + *x = CloudConnectorMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudConnectorMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudConnectorMetadata) ProtoMessage() {} + +func (x *CloudConnectorMetadata) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudConnectorMetadata.ProtoReflect.Descriptor instead. +func (*CloudConnectorMetadata) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{2} +} + +func (m *CloudConnectorMetadata) GetProvider() isCloudConnectorMetadata_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *CloudConnectorMetadata) GetAws() *CloudConnectorMetadata_AWS { + if x, ok := x.GetProvider().(*CloudConnectorMetadata_Aws); ok { + return x.Aws + } + return nil +} + +func (x *CloudConnectorMetadata) GetAzure() *CloudConnectorMetadata_Azure { + if x, ok := x.GetProvider().(*CloudConnectorMetadata_Azure_); ok { + return x.Azure + } + return nil +} + +func (x *CloudConnectorMetadata) GetGcp() *CloudConnectorMetadata_GCP { + if x, ok := x.GetProvider().(*CloudConnectorMetadata_Gcp); ok { + return x.Gcp + } + return nil +} + +type isCloudConnectorMetadata_Provider interface { + isCloudConnectorMetadata_Provider() +} + +type CloudConnectorMetadata_Aws struct { + Aws *CloudConnectorMetadata_AWS `protobuf:"bytes,1,opt,name=aws,proto3,oneof"` +} + +type CloudConnectorMetadata_Azure_ struct { + Azure *CloudConnectorMetadata_Azure `protobuf:"bytes,2,opt,name=azure,proto3,oneof"` +} + +type CloudConnectorMetadata_Gcp struct { + Gcp *CloudConnectorMetadata_GCP `protobuf:"bytes,3,opt,name=gcp,proto3,oneof"` +} + +func (*CloudConnectorMetadata_Aws) isCloudConnectorMetadata_Provider() {} + +func (*CloudConnectorMetadata_Azure_) isCloudConnectorMetadata_Provider() {} + +func (*CloudConnectorMetadata_Gcp) isCloudConnectorMetadata_Provider() {} + +// TrustedRoleMetadata captures the metadata associated with a trusted role resource, segmented by provider type +type TrustedRoleMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // + // *TrustedRoleMetadata_Aws + Provider isTrustedRoleMetadata_Provider `protobuf_oneof:"provider"` +} + +func (x *TrustedRoleMetadata) Reset() { + *x = TrustedRoleMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrustedRoleMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrustedRoleMetadata) ProtoMessage() {} + +func (x *TrustedRoleMetadata) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TrustedRoleMetadata.ProtoReflect.Descriptor instead. +func (*TrustedRoleMetadata) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{3} +} + +func (m *TrustedRoleMetadata) GetProvider() isTrustedRoleMetadata_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *TrustedRoleMetadata) GetAws() *TrustedRoleMetadata_AWS { + if x, ok := x.GetProvider().(*TrustedRoleMetadata_Aws); ok { + return x.Aws + } + return nil +} + +type isTrustedRoleMetadata_Provider interface { + isTrustedRoleMetadata_Provider() +} + +type TrustedRoleMetadata_Aws struct { + Aws *TrustedRoleMetadata_AWS `protobuf:"bytes,1,opt,name=aws,proto3,oneof"` +} + +func (*TrustedRoleMetadata_Aws) isTrustedRoleMetadata_Provider() {} + +// EventBridgeMetadata captures the metadata associated with an event bridge, segmented by provider type +type EventBridgeMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // + // *EventBridgeMetadata_Aws + Provider isEventBridgeMetadata_Provider `protobuf_oneof:"provider"` +} + +func (x *EventBridgeMetadata) Reset() { + *x = EventBridgeMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventBridgeMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventBridgeMetadata) ProtoMessage() {} + +func (x *EventBridgeMetadata) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventBridgeMetadata.ProtoReflect.Descriptor instead. +func (*EventBridgeMetadata) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{4} +} + +func (m *EventBridgeMetadata) GetProvider() isEventBridgeMetadata_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *EventBridgeMetadata) GetAws() *EventBridgeMetadata_AWS { + if x, ok := x.GetProvider().(*EventBridgeMetadata_Aws); ok { + return x.Aws + } + return nil +} + +type isEventBridgeMetadata_Provider interface { + isEventBridgeMetadata_Provider() +} + +type EventBridgeMetadata_Aws struct { + Aws *EventBridgeMetadata_AWS `protobuf:"bytes,1,opt,name=aws,proto3,oneof"` +} + +func (*EventBridgeMetadata_Aws) isEventBridgeMetadata_Provider() {} + +// ServicePrincipalMetadata captures the metadata associated with a service principal, segmented by provider type +type ServicePrincipalMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // + // *ServicePrincipalMetadata_Gcp + // *ServicePrincipalMetadata_Okta_ + Provider isServicePrincipalMetadata_Provider `protobuf_oneof:"provider"` +} + +func (x *ServicePrincipalMetadata) Reset() { + *x = ServicePrincipalMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServicePrincipalMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServicePrincipalMetadata) ProtoMessage() {} + +func (x *ServicePrincipalMetadata) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServicePrincipalMetadata.ProtoReflect.Descriptor instead. +func (*ServicePrincipalMetadata) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{5} +} + +func (m *ServicePrincipalMetadata) GetProvider() isServicePrincipalMetadata_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *ServicePrincipalMetadata) GetGcp() *ServicePrincipalMetadata_GCP { + if x, ok := x.GetProvider().(*ServicePrincipalMetadata_Gcp); ok { + return x.Gcp + } + return nil +} + +func (x *ServicePrincipalMetadata) GetOkta() *ServicePrincipalMetadata_Okta { + if x, ok := x.GetProvider().(*ServicePrincipalMetadata_Okta_); ok { + return x.Okta + } + return nil +} + +type isServicePrincipalMetadata_Provider interface { + isServicePrincipalMetadata_Provider() +} + +type ServicePrincipalMetadata_Gcp struct { + Gcp *ServicePrincipalMetadata_GCP `protobuf:"bytes,1,opt,name=gcp,proto3,oneof"` +} + +type ServicePrincipalMetadata_Okta_ struct { + Okta *ServicePrincipalMetadata_Okta `protobuf:"bytes,2,opt,name=okta,proto3,oneof"` +} + +func (*ServicePrincipalMetadata_Gcp) isServicePrincipalMetadata_Provider() {} + +func (*ServicePrincipalMetadata_Okta_) isServicePrincipalMetadata_Provider() {} + +// WebhookDatasourceMetadata captures the metadata associated with a webhook integration that forwards data from the customer's premises to us, segmented by provider type +type WebhookDatasourceMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // + // *WebhookDatasourceMetadata_Okta_ + // *WebhookDatasourceMetadata_Github_ + Provider isWebhookDatasourceMetadata_Provider `protobuf_oneof:"provider"` +} + +func (x *WebhookDatasourceMetadata) Reset() { + *x = WebhookDatasourceMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebhookDatasourceMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebhookDatasourceMetadata) ProtoMessage() {} + +func (x *WebhookDatasourceMetadata) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebhookDatasourceMetadata.ProtoReflect.Descriptor instead. +func (*WebhookDatasourceMetadata) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{6} +} + +func (m *WebhookDatasourceMetadata) GetProvider() isWebhookDatasourceMetadata_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *WebhookDatasourceMetadata) GetOkta() *WebhookDatasourceMetadata_Okta { + if x, ok := x.GetProvider().(*WebhookDatasourceMetadata_Okta_); ok { + return x.Okta + } + return nil +} + +func (x *WebhookDatasourceMetadata) GetGithub() *WebhookDatasourceMetadata_Github { + if x, ok := x.GetProvider().(*WebhookDatasourceMetadata_Github_); ok { + return x.Github + } + return nil +} + +type isWebhookDatasourceMetadata_Provider interface { + isWebhookDatasourceMetadata_Provider() +} + +type WebhookDatasourceMetadata_Okta_ struct { + Okta *WebhookDatasourceMetadata_Okta `protobuf:"bytes,1,opt,name=okta,proto3,oneof"` +} + +type WebhookDatasourceMetadata_Github_ struct { + Github *WebhookDatasourceMetadata_Github `protobuf:"bytes,2,opt,name=github,proto3,oneof"` +} + +func (*WebhookDatasourceMetadata_Okta_) isWebhookDatasourceMetadata_Provider() {} + +func (*WebhookDatasourceMetadata_Github_) isWebhookDatasourceMetadata_Provider() {} + +// CryptoKeyMetadata captures the metadata associated with a KMS Key +type CryptoKeyMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // + // *CryptoKeyMetadata_Aws + Provider isCryptoKeyMetadata_Provider `protobuf_oneof:"provider"` +} + +func (x *CryptoKeyMetadata) Reset() { + *x = CryptoKeyMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CryptoKeyMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CryptoKeyMetadata) ProtoMessage() {} + +func (x *CryptoKeyMetadata) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CryptoKeyMetadata.ProtoReflect.Descriptor instead. +func (*CryptoKeyMetadata) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{7} +} + +func (m *CryptoKeyMetadata) GetProvider() isCryptoKeyMetadata_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *CryptoKeyMetadata) GetAws() *CryptoKeyMetadata_AWS { + if x, ok := x.GetProvider().(*CryptoKeyMetadata_Aws); ok { + return x.Aws + } + return nil +} + +type isCryptoKeyMetadata_Provider interface { + isCryptoKeyMetadata_Provider() +} + +type CryptoKeyMetadata_Aws struct { + Aws *CryptoKeyMetadata_AWS `protobuf:"bytes,1,opt,name=aws,proto3,oneof"` +} + +func (*CryptoKeyMetadata_Aws) isCryptoKeyMetadata_Provider() {} + +// CloudLogsMetadata captures the metadata associated cloud logs component +type CloudLogsMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Provider: + // + // *CloudLogsMetadata_Aws + Provider isCloudLogsMetadata_Provider `protobuf_oneof:"provider"` +} + +func (x *CloudLogsMetadata) Reset() { + *x = CloudLogsMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudLogsMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudLogsMetadata) ProtoMessage() {} + +func (x *CloudLogsMetadata) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudLogsMetadata.ProtoReflect.Descriptor instead. +func (*CloudLogsMetadata) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{8} +} + +func (m *CloudLogsMetadata) GetProvider() isCloudLogsMetadata_Provider { + if m != nil { + return m.Provider + } + return nil +} + +func (x *CloudLogsMetadata) GetAws() *CloudLogsMetadata_AWS { + if x, ok := x.GetProvider().(*CloudLogsMetadata_Aws); ok { + return x.Aws + } + return nil +} + +type isCloudLogsMetadata_Provider interface { + isCloudLogsMetadata_Provider() +} + +type CloudLogsMetadata_Aws struct { + Aws *CloudLogsMetadata_AWS `protobuf:"bytes,1,opt,name=aws,proto3,oneof"` +} + +func (*CloudLogsMetadata_Aws) isCloudLogsMetadata_Provider() {} + +type CloudConnectorMetadata_AWS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CloudConnectorMetadata_AWS) Reset() { + *x = CloudConnectorMetadata_AWS{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudConnectorMetadata_AWS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudConnectorMetadata_AWS) ProtoMessage() {} + +func (x *CloudConnectorMetadata_AWS) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudConnectorMetadata_AWS.ProtoReflect.Descriptor instead. +func (*CloudConnectorMetadata_AWS) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{2, 0} +} + +type CloudConnectorMetadata_Azure struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CloudConnectorMetadata_Azure) Reset() { + *x = CloudConnectorMetadata_Azure{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudConnectorMetadata_Azure) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudConnectorMetadata_Azure) ProtoMessage() {} + +func (x *CloudConnectorMetadata_Azure) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudConnectorMetadata_Azure.ProtoReflect.Descriptor instead. +func (*CloudConnectorMetadata_Azure) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{2, 1} +} + +type CloudConnectorMetadata_GCP struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CloudConnectorMetadata_GCP) Reset() { + *x = CloudConnectorMetadata_GCP{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudConnectorMetadata_GCP) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudConnectorMetadata_GCP) ProtoMessage() {} + +func (x *CloudConnectorMetadata_GCP) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudConnectorMetadata_GCP.ProtoReflect.Descriptor instead. +func (*CloudConnectorMetadata_GCP) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{2, 2} +} + +type TrustedRoleMetadata_AWS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoleName string `protobuf:"bytes,1,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` +} + +func (x *TrustedRoleMetadata_AWS) Reset() { + *x = TrustedRoleMetadata_AWS{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrustedRoleMetadata_AWS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrustedRoleMetadata_AWS) ProtoMessage() {} + +func (x *TrustedRoleMetadata_AWS) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TrustedRoleMetadata_AWS.ProtoReflect.Descriptor instead. +func (*TrustedRoleMetadata_AWS) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *TrustedRoleMetadata_AWS) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +type EventBridgeMetadata_AWS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoleName string `protobuf:"bytes,1,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` + RuleName string `protobuf:"bytes,2,opt,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` +} + +func (x *EventBridgeMetadata_AWS) Reset() { + *x = EventBridgeMetadata_AWS{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventBridgeMetadata_AWS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventBridgeMetadata_AWS) ProtoMessage() {} + +func (x *EventBridgeMetadata_AWS) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventBridgeMetadata_AWS.ProtoReflect.Descriptor instead. +func (*EventBridgeMetadata_AWS) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *EventBridgeMetadata_AWS) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +func (x *EventBridgeMetadata_AWS) GetRuleName() string { + if x != nil { + return x.RuleName + } + return "" +} + +type ServicePrincipalMetadata_GCP struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *ServicePrincipalMetadata_GCP_Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *ServicePrincipalMetadata_GCP) Reset() { + *x = ServicePrincipalMetadata_GCP{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServicePrincipalMetadata_GCP) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServicePrincipalMetadata_GCP) ProtoMessage() {} + +func (x *ServicePrincipalMetadata_GCP) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServicePrincipalMetadata_GCP.ProtoReflect.Descriptor instead. +func (*ServicePrincipalMetadata_GCP) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ServicePrincipalMetadata_GCP) GetKey() *ServicePrincipalMetadata_GCP_Key { + if x != nil { + return x.Key + } + return nil +} + +type ServicePrincipalMetadata_Okta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OauthApp *ServicePrincipalMetadata_Okta_OAuthApp `protobuf:"bytes,1,opt,name=oauth_app,json=oauthApp,proto3" json:"oauth_app,omitempty"` +} + +func (x *ServicePrincipalMetadata_Okta) Reset() { + *x = ServicePrincipalMetadata_Okta{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServicePrincipalMetadata_Okta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServicePrincipalMetadata_Okta) ProtoMessage() {} + +func (x *ServicePrincipalMetadata_Okta) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServicePrincipalMetadata_Okta.ProtoReflect.Descriptor instead. +func (*ServicePrincipalMetadata_Okta) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *ServicePrincipalMetadata_Okta) GetOauthApp() *ServicePrincipalMetadata_Okta_OAuthApp { + if x != nil { + return x.OauthApp + } + return nil +} + +type ServicePrincipalMetadata_GCP_Key struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + PrivateKeyId string `protobuf:"bytes,3,opt,name=private_key_id,json=privateKeyId,proto3" json:"private_key_id,omitempty"` + PrivateKey string `protobuf:"bytes,4,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` + ClientEmail string `protobuf:"bytes,5,opt,name=client_email,json=clientEmail,proto3" json:"client_email,omitempty"` + ClientId string `protobuf:"bytes,6,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + AuthUri string `protobuf:"bytes,7,opt,name=auth_uri,json=authUri,proto3" json:"auth_uri,omitempty"` + TokenUri string `protobuf:"bytes,8,opt,name=token_uri,json=tokenUri,proto3" json:"token_uri,omitempty"` + AuthProviderX509CertUrl string `protobuf:"bytes,9,opt,name=auth_provider_x509_cert_url,json=authProviderX509CertUrl,proto3" json:"auth_provider_x509_cert_url,omitempty"` + ClientX509CertUrl string `protobuf:"bytes,10,opt,name=client_x509_cert_url,json=clientX509CertUrl,proto3" json:"client_x509_cert_url,omitempty"` +} + +func (x *ServicePrincipalMetadata_GCP_Key) Reset() { + *x = ServicePrincipalMetadata_GCP_Key{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServicePrincipalMetadata_GCP_Key) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServicePrincipalMetadata_GCP_Key) ProtoMessage() {} + +func (x *ServicePrincipalMetadata_GCP_Key) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServicePrincipalMetadata_GCP_Key.ProtoReflect.Descriptor instead. +func (*ServicePrincipalMetadata_GCP_Key) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{5, 0, 0} +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetPrivateKeyId() string { + if x != nil { + return x.PrivateKeyId + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetPrivateKey() string { + if x != nil { + return x.PrivateKey + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetClientEmail() string { + if x != nil { + return x.ClientEmail + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetAuthUri() string { + if x != nil { + return x.AuthUri + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetTokenUri() string { + if x != nil { + return x.TokenUri + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetAuthProviderX509CertUrl() string { + if x != nil { + return x.AuthProviderX509CertUrl + } + return "" +} + +func (x *ServicePrincipalMetadata_GCP_Key) GetClientX509CertUrl() string { + if x != nil { + return x.ClientX509CertUrl + } + return "" +} + +type ServicePrincipalMetadata_Okta_OAuthApp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IngestionId string `protobuf:"bytes,1,opt,name=ingestion_id,json=ingestionId,proto3" json:"ingestion_id,omitempty"` + OktaUrl string `protobuf:"bytes,2,opt,name=okta_url,json=oktaUrl,proto3" json:"okta_url,omitempty"` + ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientSecret string `protobuf:"bytes,4,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` +} + +func (x *ServicePrincipalMetadata_Okta_OAuthApp) Reset() { + *x = ServicePrincipalMetadata_Okta_OAuthApp{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServicePrincipalMetadata_Okta_OAuthApp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServicePrincipalMetadata_Okta_OAuthApp) ProtoMessage() {} + +func (x *ServicePrincipalMetadata_Okta_OAuthApp) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServicePrincipalMetadata_Okta_OAuthApp.ProtoReflect.Descriptor instead. +func (*ServicePrincipalMetadata_Okta_OAuthApp) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{5, 1, 0} +} + +func (x *ServicePrincipalMetadata_Okta_OAuthApp) GetIngestionId() string { + if x != nil { + return x.IngestionId + } + return "" +} + +func (x *ServicePrincipalMetadata_Okta_OAuthApp) GetOktaUrl() string { + if x != nil { + return x.OktaUrl + } + return "" +} + +func (x *ServicePrincipalMetadata_Okta_OAuthApp) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *ServicePrincipalMetadata_Okta_OAuthApp) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +type WebhookDatasourceMetadata_Okta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WebhookDatasource *WebhookDatasourceMetadata_Okta_WebhookDatasource `protobuf:"bytes,1,opt,name=webhook_datasource,json=webhookDatasource,proto3" json:"webhook_datasource,omitempty"` +} + +func (x *WebhookDatasourceMetadata_Okta) Reset() { + *x = WebhookDatasourceMetadata_Okta{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebhookDatasourceMetadata_Okta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebhookDatasourceMetadata_Okta) ProtoMessage() {} + +func (x *WebhookDatasourceMetadata_Okta) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebhookDatasourceMetadata_Okta.ProtoReflect.Descriptor instead. +func (*WebhookDatasourceMetadata_Okta) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *WebhookDatasourceMetadata_Okta) GetWebhookDatasource() *WebhookDatasourceMetadata_Okta_WebhookDatasource { + if x != nil { + return x.WebhookDatasource + } + return nil +} + +type WebhookDatasourceMetadata_Github struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WebhookDatasource *WebhookDatasourceMetadata_Github_WebhookDatasource `protobuf:"bytes,1,opt,name=webhook_datasource,json=webhookDatasource,proto3" json:"webhook_datasource,omitempty"` +} + +func (x *WebhookDatasourceMetadata_Github) Reset() { + *x = WebhookDatasourceMetadata_Github{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebhookDatasourceMetadata_Github) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebhookDatasourceMetadata_Github) ProtoMessage() {} + +func (x *WebhookDatasourceMetadata_Github) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebhookDatasourceMetadata_Github.ProtoReflect.Descriptor instead. +func (*WebhookDatasourceMetadata_Github) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{6, 1} +} + +func (x *WebhookDatasourceMetadata_Github) GetWebhookDatasource() *WebhookDatasourceMetadata_Github_WebhookDatasource { + if x != nil { + return x.WebhookDatasource + } + return nil +} + +type WebhookDatasourceMetadata_Okta_WebhookDatasource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HookId string `protobuf:"bytes,1,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + IngestionId string `protobuf:"bytes,2,opt,name=ingestion_id,json=ingestionId,proto3" json:"ingestion_id,omitempty"` + IngestionUrl string `protobuf:"bytes,3,opt,name=ingestion_url,json=ingestionUrl,proto3" json:"ingestion_url,omitempty"` + OktaEventTypes []string `protobuf:"bytes,4,rep,name=okta_event_types,json=oktaEventTypes,proto3" json:"okta_event_types,omitempty"` +} + +func (x *WebhookDatasourceMetadata_Okta_WebhookDatasource) Reset() { + *x = WebhookDatasourceMetadata_Okta_WebhookDatasource{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebhookDatasourceMetadata_Okta_WebhookDatasource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebhookDatasourceMetadata_Okta_WebhookDatasource) ProtoMessage() {} + +func (x *WebhookDatasourceMetadata_Okta_WebhookDatasource) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebhookDatasourceMetadata_Okta_WebhookDatasource.ProtoReflect.Descriptor instead. +func (*WebhookDatasourceMetadata_Okta_WebhookDatasource) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{6, 0, 0} +} + +func (x *WebhookDatasourceMetadata_Okta_WebhookDatasource) GetHookId() string { + if x != nil { + return x.HookId + } + return "" +} + +func (x *WebhookDatasourceMetadata_Okta_WebhookDatasource) GetIngestionId() string { + if x != nil { + return x.IngestionId + } + return "" +} + +func (x *WebhookDatasourceMetadata_Okta_WebhookDatasource) GetIngestionUrl() string { + if x != nil { + return x.IngestionUrl + } + return "" +} + +func (x *WebhookDatasourceMetadata_Okta_WebhookDatasource) GetOktaEventTypes() []string { + if x != nil { + return x.OktaEventTypes + } + return nil +} + +type WebhookDatasourceMetadata_Github_WebhookDatasource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HookId int64 `protobuf:"varint,1,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + IngestionId string `protobuf:"bytes,2,opt,name=ingestion_id,json=ingestionId,proto3" json:"ingestion_id,omitempty"` + IngestionUrl string `protobuf:"bytes,3,opt,name=ingestion_url,json=ingestionUrl,proto3" json:"ingestion_url,omitempty"` + GithubInstallationId int64 `protobuf:"varint,4,opt,name=github_installation_id,json=githubInstallationId,proto3" json:"github_installation_id,omitempty"` +} + +func (x *WebhookDatasourceMetadata_Github_WebhookDatasource) Reset() { + *x = WebhookDatasourceMetadata_Github_WebhookDatasource{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebhookDatasourceMetadata_Github_WebhookDatasource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebhookDatasourceMetadata_Github_WebhookDatasource) ProtoMessage() {} + +func (x *WebhookDatasourceMetadata_Github_WebhookDatasource) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebhookDatasourceMetadata_Github_WebhookDatasource.ProtoReflect.Descriptor instead. +func (*WebhookDatasourceMetadata_Github_WebhookDatasource) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{6, 1, 0} +} + +func (x *WebhookDatasourceMetadata_Github_WebhookDatasource) GetHookId() int64 { + if x != nil { + return x.HookId + } + return 0 +} + +func (x *WebhookDatasourceMetadata_Github_WebhookDatasource) GetIngestionId() string { + if x != nil { + return x.IngestionId + } + return "" +} + +func (x *WebhookDatasourceMetadata_Github_WebhookDatasource) GetIngestionUrl() string { + if x != nil { + return x.IngestionUrl + } + return "" +} + +func (x *WebhookDatasourceMetadata_Github_WebhookDatasource) GetGithubInstallationId() int64 { + if x != nil { + return x.GithubInstallationId + } + return 0 +} + +type CryptoKeyMetadata_AWS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kms *CryptoKeyMetadata_AWS_KMS `protobuf:"bytes,1,opt,name=kms,proto3" json:"kms,omitempty"` +} + +func (x *CryptoKeyMetadata_AWS) Reset() { + *x = CryptoKeyMetadata_AWS{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CryptoKeyMetadata_AWS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CryptoKeyMetadata_AWS) ProtoMessage() {} + +func (x *CryptoKeyMetadata_AWS) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CryptoKeyMetadata_AWS.ProtoReflect.Descriptor instead. +func (*CryptoKeyMetadata_AWS) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *CryptoKeyMetadata_AWS) GetKms() *CryptoKeyMetadata_AWS_KMS { + if x != nil { + return x.Kms + } + return nil +} + +type CryptoKeyMetadata_AWS_KMS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Alias string `protobuf:"bytes,1,opt,name=alias,proto3" json:"alias,omitempty"` + Regions []string `protobuf:"bytes,2,rep,name=regions,proto3" json:"regions,omitempty"` +} + +func (x *CryptoKeyMetadata_AWS_KMS) Reset() { + *x = CryptoKeyMetadata_AWS_KMS{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CryptoKeyMetadata_AWS_KMS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CryptoKeyMetadata_AWS_KMS) ProtoMessage() {} + +func (x *CryptoKeyMetadata_AWS_KMS) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CryptoKeyMetadata_AWS_KMS.ProtoReflect.Descriptor instead. +func (*CryptoKeyMetadata_AWS_KMS) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{7, 0, 0} +} + +func (x *CryptoKeyMetadata_AWS_KMS) GetAlias() string { + if x != nil { + return x.Alias + } + return "" +} + +func (x *CryptoKeyMetadata_AWS_KMS) GetRegions() []string { + if x != nil { + return x.Regions + } + return nil +} + +type CloudLogsMetadata_AWS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cloudtrail_S3Bucket *CloudLogsMetadata_AWS_CloudTrailS3Bucket `protobuf:"bytes,1,opt,name=cloudtrail_S3_bucket,json=cloudtrailS3Bucket,proto3" json:"cloudtrail_S3_bucket,omitempty"` +} + +func (x *CloudLogsMetadata_AWS) Reset() { + *x = CloudLogsMetadata_AWS{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudLogsMetadata_AWS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudLogsMetadata_AWS) ProtoMessage() {} + +func (x *CloudLogsMetadata_AWS) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudLogsMetadata_AWS.ProtoReflect.Descriptor instead. +func (*CloudLogsMetadata_AWS) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *CloudLogsMetadata_AWS) GetCloudtrail_S3Bucket() *CloudLogsMetadata_AWS_CloudTrailS3Bucket { + if x != nil { + return x.Cloudtrail_S3Bucket + } + return nil +} + +type CloudLogsMetadata_AWS_CloudTrailS3Bucket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BucketName string `protobuf:"bytes,1,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` + BucketRegion string `protobuf:"bytes,2,opt,name=bucket_region,json=bucketRegion,proto3" json:"bucket_region,omitempty"` + ExternalId string `protobuf:"bytes,3,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + RoleName string `protobuf:"bytes,4,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` + PathPrefix string `protobuf:"bytes,5,opt,name=path_prefix,json=pathPrefix,proto3" json:"path_prefix,omitempty"` +} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) Reset() { + *x = CloudLogsMetadata_AWS_CloudTrailS3Bucket{} + if protoimpl.UnsafeEnabled { + mi := &file_account_component_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudLogsMetadata_AWS_CloudTrailS3Bucket) ProtoMessage() {} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) ProtoReflect() protoreflect.Message { + mi := &file_account_component_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudLogsMetadata_AWS_CloudTrailS3Bucket.ProtoReflect.Descriptor instead. +func (*CloudLogsMetadata_AWS_CloudTrailS3Bucket) Descriptor() ([]byte, []int) { + return file_account_component_proto_rawDescGZIP(), []int{8, 0, 0} +} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) GetBucketName() string { + if x != nil { + return x.BucketName + } + return "" +} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) GetBucketRegion() string { + if x != nil { + return x.BucketRegion + } + return "" +} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) GetExternalId() string { + if x != nil { + return x.ExternalId + } + return "" +} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +func (x *CloudLogsMetadata_AWS_CloudTrailS3Bucket) GetPathPrefix() string { + if x != nil { + return x.PathPrefix + } + return "" +} + +var file_account_component_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 50001, + Name: "draiosproto.encryption", + Tag: "bytes,50001,opt,name=encryption", + Filename: "account_component.proto", + }, +} + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional string encryption = 50001; + E_Encryption = &file_account_component_proto_extTypes[0] +) + +var File_account_component_proto protoreflect.FileDescriptor + +var file_account_component_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x72, 0x61, 0x69, 0x6f, + 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x99, + 0x05, 0x0a, 0x11, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x88, 0x01, + 0x01, 0x12, 0x45, 0x0a, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x01, 0x52, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, + 0x72, 0x69, 0x64, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x45, 0x0a, 0x0c, 0x74, 0x72, 0x75, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x02, 0x52, + 0x0b, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x4f, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, + 0x69, 0x70, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x72, 0x61, + 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x03, 0x52, 0x10, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x88, 0x01, 0x01, + 0x12, 0x51, 0x0a, 0x12, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, + 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x04, 0x52, 0x11, 0x77, + 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a, 0x0a, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x05, 0x52, 0x09, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, + 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x72, 0x61, + 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x06, 0x52, 0x09, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x42, 0x0f, 0x0a, + 0x0d, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x42, 0x0f, + 0x0a, 0x0d, 0x5f, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x42, + 0x14, 0x0a, 0x12, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x6e, + 0x63, 0x69, 0x70, 0x61, 0x6c, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0d, 0x0a, 0x0b, + 0x5f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0xf0, 0x07, 0x0a, 0x10, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, + 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, + 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x5f, 0x0a, 0x18, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x56, 0x0a, 0x15, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x72, + 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, + 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, + 0x13, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x56, 0x0a, 0x15, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x13, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x65, 0x0a, 0x1a, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, + 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x68, 0x0a, 0x1b, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, + 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, + 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x48, 0x00, 0x52, 0x19, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x50, 0x0a, + 0x13, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x72, 0x61, + 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, + 0x65, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x11, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x50, 0x0a, 0x13, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, + 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x6f, 0x67, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x11, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x42, 0x0a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf8, 0x01, + 0x0a, 0x16, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x57, 0x53, 0x48, 0x00, + 0x52, 0x03, 0x61, 0x77, 0x73, 0x12, 0x41, 0x0a, 0x05, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x48, + 0x00, 0x52, 0x05, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x12, 0x3b, 0x0a, 0x03, 0x67, 0x63, 0x70, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x43, 0x50, 0x48, 0x00, + 0x52, 0x03, 0x67, 0x63, 0x70, 0x1a, 0x05, 0x0a, 0x03, 0x41, 0x57, 0x53, 0x1a, 0x07, 0x0a, 0x05, + 0x41, 0x7a, 0x75, 0x72, 0x65, 0x1a, 0x05, 0x0a, 0x03, 0x47, 0x43, 0x50, 0x42, 0x0a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x13, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x38, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, + 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, + 0x57, 0x53, 0x48, 0x00, 0x52, 0x03, 0x61, 0x77, 0x73, 0x1a, 0x22, 0x0a, 0x03, 0x41, 0x57, 0x53, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0a, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x38, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x41, 0x57, 0x53, 0x48, 0x00, 0x52, 0x03, 0x61, 0x77, 0x73, 0x1a, 0x3f, 0x0a, 0x03, 0x41, + 0x57, 0x53, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x81, 0x07, 0x0a, 0x18, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3d, 0x0a, 0x03, 0x67, 0x63, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, + 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x43, 0x50, 0x48, 0x00, 0x52, + 0x03, 0x67, 0x63, 0x70, 0x12, 0x40, 0x0a, 0x04, 0x6f, 0x6b, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, + 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6b, 0x74, 0x61, 0x48, 0x00, + 0x52, 0x04, 0x6f, 0x6b, 0x74, 0x61, 0x1a, 0xcf, 0x03, 0x0a, 0x03, 0x47, 0x43, 0x50, 0x12, 0x3f, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x72, + 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x47, 0x43, 0x50, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x1a, + 0x86, 0x03, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x0e, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0x8a, 0xb5, 0x18, 0x0a, 0x41, 0x45, 0x53, 0x32, 0x35, 0x36, 0x5f, 0x47, + 0x43, 0x4d, 0x52, 0x0c, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x49, 0x64, + 0x12, 0x2f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0x8a, 0xb5, 0x18, 0x0a, 0x41, 0x45, 0x53, 0x32, 0x35, + 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x72, 0x69, 0x12, 0x1b, 0x0a, 0x09, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x3c, 0x0a, 0x1b, 0x61, 0x75, 0x74, + 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x78, 0x35, 0x30, 0x39, 0x5f, + 0x63, 0x65, 0x72, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, + 0x61, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x58, 0x35, 0x30, 0x39, + 0x43, 0x65, 0x72, 0x74, 0x55, 0x72, 0x6c, 0x12, 0x2f, 0x0a, 0x14, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x78, 0x35, 0x30, 0x39, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x35, 0x30, + 0x39, 0x43, 0x65, 0x72, 0x74, 0x55, 0x72, 0x6c, 0x1a, 0x85, 0x02, 0x0a, 0x04, 0x4f, 0x6b, 0x74, + 0x61, 0x12, 0x50, 0x0a, 0x09, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x61, 0x70, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, + 0x70, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6b, 0x74, 0x61, + 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x41, 0x70, 0x70, 0x52, 0x08, 0x6f, 0x61, 0x75, 0x74, 0x68, + 0x41, 0x70, 0x70, 0x1a, 0xaa, 0x01, 0x0a, 0x08, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x41, 0x70, 0x70, + 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6b, 0x74, 0x61, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x6b, 0x74, 0x61, 0x55, 0x72, 0x6c, 0x12, 0x2b, + 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0x8a, 0xb5, 0x18, 0x0a, 0x41, 0x45, 0x53, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, + 0x4d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x0d, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0x8a, 0xb5, 0x18, 0x0a, 0x41, 0x45, 0x53, 0x32, 0x35, 0x36, 0x5f, 0x47, + 0x43, 0x4d, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x42, 0x0a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0xf3, 0x05, 0x0a, + 0x19, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x41, 0x0a, 0x04, 0x6f, 0x6b, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, + 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, + 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x4f, 0x6b, 0x74, 0x61, 0x48, 0x00, 0x52, 0x04, 0x6f, 0x6b, 0x74, 0x61, 0x12, 0x47, 0x0a, + 0x06, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x65, 0x62, 0x68, + 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x48, 0x00, 0x52, 0x06, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x1a, 0x95, 0x02, 0x0a, 0x04, 0x4f, 0x6b, 0x74, 0x61, 0x12, + 0x6c, 0x0a, 0x12, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x64, 0x72, + 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6b, 0x74, 0x61, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, + 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x11, 0x77, 0x65, 0x62, 0x68, + 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x9e, 0x01, + 0x0a, 0x11, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x28, 0x0a, 0x10, 0x6f, 0x6b, 0x74, 0x61, 0x5f, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, + 0x6f, 0x6b, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x1a, 0xa5, + 0x02, 0x0a, 0x06, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x12, 0x6e, 0x0a, 0x12, 0x77, 0x65, 0x62, + 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x11, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, + 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0xaa, 0x01, 0x0a, 0x11, 0x57, 0x65, + 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x67, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x69, + 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, + 0x12, 0x34, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x14, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x22, 0xcf, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x57, 0x53, 0x48, 0x00, 0x52, 0x03, 0x61, 0x77, 0x73, + 0x1a, 0x76, 0x0a, 0x03, 0x41, 0x57, 0x53, 0x12, 0x38, 0x0a, 0x03, 0x6b, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x57, 0x53, 0x2e, 0x4b, 0x4d, 0x53, 0x52, 0x03, 0x6b, 0x6d, + 0x73, 0x1a, 0x35, 0x0a, 0x03, 0x4b, 0x4d, 0x53, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x22, 0x94, 0x03, 0x0a, 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x6f, + 0x67, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x03, 0x61, 0x77, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x57, 0x53, 0x48, 0x00, 0x52, 0x03, 0x61, + 0x77, 0x73, 0x1a, 0xba, 0x02, 0x0a, 0x03, 0x41, 0x57, 0x53, 0x12, 0x67, 0x0a, 0x14, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x5f, 0x53, 0x33, 0x5f, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, + 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x6f, 0x67, 0x73, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x57, 0x53, 0x2e, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x53, 0x33, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x12, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x53, 0x33, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x1a, 0xc9, 0x01, 0x0a, 0x12, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x54, 0x72, 0x61, + 0x69, 0x6c, 0x53, 0x33, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x12, 0x2f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0x8a, 0xb5, 0x18, 0x0a, 0x41, 0x45, 0x53, 0x32, 0x35, + 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x74, 0x68, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x42, + 0x0a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2a, 0xf4, 0x01, 0x0a, 0x09, + 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, 0x4d, + 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, + 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x4f, + 0x52, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x52, 0x55, 0x53, 0x54, 0x45, 0x44, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x10, 0x03, 0x12, + 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x45, 0x56, 0x45, + 0x4e, 0x54, 0x5f, 0x42, 0x52, 0x49, 0x44, 0x47, 0x45, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x43, + 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, + 0x5f, 0x50, 0x52, 0x49, 0x4e, 0x43, 0x49, 0x50, 0x41, 0x4c, 0x10, 0x04, 0x12, 0x20, 0x0a, 0x1c, + 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, + 0x4b, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x05, 0x12, 0x18, + 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x52, 0x59, 0x50, + 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x10, 0x06, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x50, + 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x5f, 0x4c, 0x4f, 0x47, 0x53, + 0x10, 0x07, 0x3a, 0x3f, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xd1, 0x86, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x5f, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, + 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x42, 0x19, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x48, 0x01, 0x5a, 0x25, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x75, + 0x74, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_account_component_proto_rawDescOnce sync.Once + file_account_component_proto_rawDescData = file_account_component_proto_rawDesc +) + +func file_account_component_proto_rawDescGZIP() []byte { + file_account_component_proto_rawDescOnce.Do(func() { + file_account_component_proto_rawDescData = protoimpl.X.CompressGZIP(file_account_component_proto_rawDescData) + }) + return file_account_component_proto_rawDescData +} + +var file_account_component_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_account_component_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_account_component_proto_goTypes = []interface{}{ + (Component)(0), // 0: draiosproto.Component + (*FeatureComponents)(nil), // 1: draiosproto.FeatureComponents + (*AccountComponent)(nil), // 2: draiosproto.AccountComponent + (*CloudConnectorMetadata)(nil), // 3: draiosproto.CloudConnectorMetadata + (*TrustedRoleMetadata)(nil), // 4: draiosproto.TrustedRoleMetadata + (*EventBridgeMetadata)(nil), // 5: draiosproto.EventBridgeMetadata + (*ServicePrincipalMetadata)(nil), // 6: draiosproto.ServicePrincipalMetadata + (*WebhookDatasourceMetadata)(nil), // 7: draiosproto.WebhookDatasourceMetadata + (*CryptoKeyMetadata)(nil), // 8: draiosproto.CryptoKeyMetadata + (*CloudLogsMetadata)(nil), // 9: draiosproto.CloudLogsMetadata + (*CloudConnectorMetadata_AWS)(nil), // 10: draiosproto.CloudConnectorMetadata.AWS + (*CloudConnectorMetadata_Azure)(nil), // 11: draiosproto.CloudConnectorMetadata.Azure + (*CloudConnectorMetadata_GCP)(nil), // 12: draiosproto.CloudConnectorMetadata.GCP + (*TrustedRoleMetadata_AWS)(nil), // 13: draiosproto.TrustedRoleMetadata.AWS + (*EventBridgeMetadata_AWS)(nil), // 14: draiosproto.EventBridgeMetadata.AWS + (*ServicePrincipalMetadata_GCP)(nil), // 15: draiosproto.ServicePrincipalMetadata.GCP + (*ServicePrincipalMetadata_Okta)(nil), // 16: draiosproto.ServicePrincipalMetadata.Okta + (*ServicePrincipalMetadata_GCP_Key)(nil), // 17: draiosproto.ServicePrincipalMetadata.GCP.Key + (*ServicePrincipalMetadata_Okta_OAuthApp)(nil), // 18: draiosproto.ServicePrincipalMetadata.Okta.OAuthApp + (*WebhookDatasourceMetadata_Okta)(nil), // 19: draiosproto.WebhookDatasourceMetadata.Okta + (*WebhookDatasourceMetadata_Github)(nil), // 20: draiosproto.WebhookDatasourceMetadata.Github + (*WebhookDatasourceMetadata_Okta_WebhookDatasource)(nil), // 21: draiosproto.WebhookDatasourceMetadata.Okta.WebhookDatasource + (*WebhookDatasourceMetadata_Github_WebhookDatasource)(nil), // 22: draiosproto.WebhookDatasourceMetadata.Github.WebhookDatasource + (*CryptoKeyMetadata_AWS)(nil), // 23: draiosproto.CryptoKeyMetadata.AWS + (*CryptoKeyMetadata_AWS_KMS)(nil), // 24: draiosproto.CryptoKeyMetadata.AWS.KMS + (*CloudLogsMetadata_AWS)(nil), // 25: draiosproto.CloudLogsMetadata.AWS + (*CloudLogsMetadata_AWS_CloudTrailS3Bucket)(nil), // 26: draiosproto.CloudLogsMetadata.AWS.CloudTrailS3Bucket + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*CloudAccount)(nil), // 28: draiosproto.CloudAccount + (*descriptorpb.FieldOptions)(nil), // 29: google.protobuf.FieldOptions +} +var file_account_component_proto_depIdxs = []int32{ + 2, // 0: draiosproto.FeatureComponents.cloud_connector:type_name -> draiosproto.AccountComponent + 2, // 1: draiosproto.FeatureComponents.event_bridge:type_name -> draiosproto.AccountComponent + 2, // 2: draiosproto.FeatureComponents.trusted_role:type_name -> draiosproto.AccountComponent + 2, // 3: draiosproto.FeatureComponents.service_principal:type_name -> draiosproto.AccountComponent + 2, // 4: draiosproto.FeatureComponents.webhook_datasource:type_name -> draiosproto.AccountComponent + 2, // 5: draiosproto.FeatureComponents.crypto_key:type_name -> draiosproto.AccountComponent + 2, // 6: draiosproto.FeatureComponents.cloud_logs:type_name -> draiosproto.AccountComponent + 0, // 7: draiosproto.AccountComponent.type:type_name -> draiosproto.Component + 27, // 8: draiosproto.AccountComponent.created_at:type_name -> google.protobuf.Timestamp + 27, // 9: draiosproto.AccountComponent.updated_at:type_name -> google.protobuf.Timestamp + 27, // 10: draiosproto.AccountComponent.validated_at:type_name -> google.protobuf.Timestamp + 28, // 11: draiosproto.AccountComponent.account:type_name -> draiosproto.CloudAccount + 3, // 12: draiosproto.AccountComponent.cloud_connector_metadata:type_name -> draiosproto.CloudConnectorMetadata + 4, // 13: draiosproto.AccountComponent.trusted_role_metadata:type_name -> draiosproto.TrustedRoleMetadata + 5, // 14: draiosproto.AccountComponent.event_bridge_metadata:type_name -> draiosproto.EventBridgeMetadata + 6, // 15: draiosproto.AccountComponent.service_principal_metadata:type_name -> draiosproto.ServicePrincipalMetadata + 7, // 16: draiosproto.AccountComponent.webhook_datasource_metadata:type_name -> draiosproto.WebhookDatasourceMetadata + 8, // 17: draiosproto.AccountComponent.crypto_key_metadata:type_name -> draiosproto.CryptoKeyMetadata + 9, // 18: draiosproto.AccountComponent.cloud_logs_metadata:type_name -> draiosproto.CloudLogsMetadata + 10, // 19: draiosproto.CloudConnectorMetadata.aws:type_name -> draiosproto.CloudConnectorMetadata.AWS + 11, // 20: draiosproto.CloudConnectorMetadata.azure:type_name -> draiosproto.CloudConnectorMetadata.Azure + 12, // 21: draiosproto.CloudConnectorMetadata.gcp:type_name -> draiosproto.CloudConnectorMetadata.GCP + 13, // 22: draiosproto.TrustedRoleMetadata.aws:type_name -> draiosproto.TrustedRoleMetadata.AWS + 14, // 23: draiosproto.EventBridgeMetadata.aws:type_name -> draiosproto.EventBridgeMetadata.AWS + 15, // 24: draiosproto.ServicePrincipalMetadata.gcp:type_name -> draiosproto.ServicePrincipalMetadata.GCP + 16, // 25: draiosproto.ServicePrincipalMetadata.okta:type_name -> draiosproto.ServicePrincipalMetadata.Okta + 19, // 26: draiosproto.WebhookDatasourceMetadata.okta:type_name -> draiosproto.WebhookDatasourceMetadata.Okta + 20, // 27: draiosproto.WebhookDatasourceMetadata.github:type_name -> draiosproto.WebhookDatasourceMetadata.Github + 23, // 28: draiosproto.CryptoKeyMetadata.aws:type_name -> draiosproto.CryptoKeyMetadata.AWS + 25, // 29: draiosproto.CloudLogsMetadata.aws:type_name -> draiosproto.CloudLogsMetadata.AWS + 17, // 30: draiosproto.ServicePrincipalMetadata.GCP.key:type_name -> draiosproto.ServicePrincipalMetadata.GCP.Key + 18, // 31: draiosproto.ServicePrincipalMetadata.Okta.oauth_app:type_name -> draiosproto.ServicePrincipalMetadata.Okta.OAuthApp + 21, // 32: draiosproto.WebhookDatasourceMetadata.Okta.webhook_datasource:type_name -> draiosproto.WebhookDatasourceMetadata.Okta.WebhookDatasource + 22, // 33: draiosproto.WebhookDatasourceMetadata.Github.webhook_datasource:type_name -> draiosproto.WebhookDatasourceMetadata.Github.WebhookDatasource + 24, // 34: draiosproto.CryptoKeyMetadata.AWS.kms:type_name -> draiosproto.CryptoKeyMetadata.AWS.KMS + 26, // 35: draiosproto.CloudLogsMetadata.AWS.cloudtrail_S3_bucket:type_name -> draiosproto.CloudLogsMetadata.AWS.CloudTrailS3Bucket + 29, // 36: draiosproto.encryption:extendee -> google.protobuf.FieldOptions + 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 + 36, // [36:37] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name +} + +func init() { file_account_component_proto_init() } +func file_account_component_proto_init() { + if File_account_component_proto != nil { + return + } + file_cloud_account_proto_init() + if !protoimpl.UnsafeEnabled { + file_account_component_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeatureComponents); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountComponent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudConnectorMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrustedRoleMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventBridgeMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServicePrincipalMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebhookDatasourceMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CryptoKeyMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudLogsMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudConnectorMetadata_AWS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudConnectorMetadata_Azure); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudConnectorMetadata_GCP); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrustedRoleMetadata_AWS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventBridgeMetadata_AWS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServicePrincipalMetadata_GCP); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServicePrincipalMetadata_Okta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServicePrincipalMetadata_GCP_Key); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServicePrincipalMetadata_Okta_OAuthApp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebhookDatasourceMetadata_Okta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebhookDatasourceMetadata_Github); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebhookDatasourceMetadata_Okta_WebhookDatasource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebhookDatasourceMetadata_Github_WebhookDatasource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CryptoKeyMetadata_AWS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CryptoKeyMetadata_AWS_KMS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudLogsMetadata_AWS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_component_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudLogsMetadata_AWS_CloudTrailS3Bucket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_account_component_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_account_component_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*AccountComponent_CloudConnectorMetadata)(nil), + (*AccountComponent_TrustedRoleMetadata)(nil), + (*AccountComponent_EventBridgeMetadata)(nil), + (*AccountComponent_ServicePrincipalMetadata)(nil), + (*AccountComponent_WebhookDatasourceMetadata)(nil), + (*AccountComponent_CryptoKeyMetadata)(nil), + (*AccountComponent_CloudLogsMetadata)(nil), + } + file_account_component_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*CloudConnectorMetadata_Aws)(nil), + (*CloudConnectorMetadata_Azure_)(nil), + (*CloudConnectorMetadata_Gcp)(nil), + } + file_account_component_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*TrustedRoleMetadata_Aws)(nil), + } + file_account_component_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*EventBridgeMetadata_Aws)(nil), + } + file_account_component_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*ServicePrincipalMetadata_Gcp)(nil), + (*ServicePrincipalMetadata_Okta_)(nil), + } + file_account_component_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*WebhookDatasourceMetadata_Okta_)(nil), + (*WebhookDatasourceMetadata_Github_)(nil), + } + file_account_component_proto_msgTypes[7].OneofWrappers = []interface{}{ + (*CryptoKeyMetadata_Aws)(nil), + } + file_account_component_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*CloudLogsMetadata_Aws)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_account_component_proto_rawDesc, + NumEnums: 1, + NumMessages: 26, + NumExtensions: 1, + NumServices: 0, + }, + GoTypes: file_account_component_proto_goTypes, + DependencyIndexes: file_account_component_proto_depIdxs, + EnumInfos: file_account_component_proto_enumTypes, + MessageInfos: file_account_component_proto_msgTypes, + ExtensionInfos: file_account_component_proto_extTypes, + }.Build() + File_account_component_proto = out.File + file_account_component_proto_rawDesc = nil + file_account_component_proto_goTypes = nil + file_account_component_proto_depIdxs = nil +} \ No newline at end of file diff --git a/sysdig/internal/client/v2/cloudauth/go/cloud_account.pb.go b/sysdig/internal/client/v2/cloudauth/go/cloud_account.pb.go new file mode 100644 index 000000000..e2a7337f4 --- /dev/null +++ b/sysdig/internal/client/v2/cloudauth/go/cloud_account.pb.go @@ -0,0 +1,649 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: cloud_account.proto + +package draiosproto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Provider enumerates the vendor, platform, and service class of the cloud account +type Provider int32 + +const ( + Provider_PROVIDER_UNSPECIFIED Provider = 0 + Provider_PROVIDER_AWS Provider = 1 + Provider_PROVIDER_AZURE Provider = 2 + Provider_PROVIDER_GCP Provider = 3 + Provider_PROVIDER_OKTA Provider = 4 + Provider_PROVIDER_GITHUB Provider = 5 +) + +// Enum value maps for Provider. +var ( + Provider_name = map[int32]string{ + 0: "PROVIDER_UNSPECIFIED", + 1: "PROVIDER_AWS", + 2: "PROVIDER_AZURE", + 3: "PROVIDER_GCP", + 4: "PROVIDER_OKTA", + 5: "PROVIDER_GITHUB", + } + Provider_value = map[string]int32{ + "PROVIDER_UNSPECIFIED": 0, + "PROVIDER_AWS": 1, + "PROVIDER_AZURE": 2, + "PROVIDER_GCP": 3, + "PROVIDER_OKTA": 4, + "PROVIDER_GITHUB": 5, + } +) + +func (x Provider) Enum() *Provider { + p := new(Provider) + *p = x + return p +} + +func (x Provider) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Provider) Descriptor() protoreflect.EnumDescriptor { + return file_cloud_account_proto_enumTypes[0].Descriptor() +} + +func (Provider) Type() protoreflect.EnumType { + return &file_cloud_account_proto_enumTypes[0] +} + +func (x Provider) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Provider.Descriptor instead. +func (Provider) EnumDescriptor() ([]byte, []int) { + return file_cloud_account_proto_rawDescGZIP(), []int{0} +} + +// Feature enumerates all available feature types across monitor and secure +type Feature int32 + +const ( + Feature_FEATURE_UNSPECIFIED Feature = 0 // noop feature; default value + Feature_FEATURE_SECURE_THREAT_DETECTION Feature = 1 + Feature_FEATURE_SECURE_CONFIG_POSTURE Feature = 2 + Feature_FEATURE_SECURE_IDENTITY_ENTITLEMENT Feature = 3 + Feature_FEATURE_MONITOR_CLOUD_METRICS Feature = 4 + Feature_FEATURE_SECURE_AGENTLESS_SCANNING Feature = 5 +) + +// Enum value maps for Feature. +var ( + Feature_name = map[int32]string{ + 0: "FEATURE_UNSPECIFIED", + 1: "FEATURE_SECURE_THREAT_DETECTION", + 2: "FEATURE_SECURE_CONFIG_POSTURE", + 3: "FEATURE_SECURE_IDENTITY_ENTITLEMENT", + 4: "FEATURE_MONITOR_CLOUD_METRICS", + 5: "FEATURE_SECURE_AGENTLESS_SCANNING", + } + Feature_value = map[string]int32{ + "FEATURE_UNSPECIFIED": 0, + "FEATURE_SECURE_THREAT_DETECTION": 1, + "FEATURE_SECURE_CONFIG_POSTURE": 2, + "FEATURE_SECURE_IDENTITY_ENTITLEMENT": 3, + "FEATURE_MONITOR_CLOUD_METRICS": 4, + "FEATURE_SECURE_AGENTLESS_SCANNING": 5, + } +) + +func (x Feature) Enum() *Feature { + p := new(Feature) + *p = x + return p +} + +func (x Feature) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Feature) Descriptor() protoreflect.EnumDescriptor { + return file_cloud_account_proto_enumTypes[1].Descriptor() +} + +func (Feature) Type() protoreflect.EnumType { + return &file_cloud_account_proto_enumTypes[1] +} + +func (x Feature) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Feature.Descriptor instead. +func (Feature) EnumDescriptor() ([]byte, []int) { + return file_cloud_account_proto_rawDescGZIP(), []int{1} +} + +// CloudAccount captures a snapshot of basic metadata fields associated with a cloud. +type CloudAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // unique identifier for the customer's cloud account + CustomerId uint64 `protobuf:"varint,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // the associated customer id + Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` // enablement of the account + OrganizationId string `protobuf:"bytes,4,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` // string identifier of the owning Cloud Organization + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` // name of the cloud account. typically AWS alias/GCP Project/Azure subscription + ProviderId string `protobuf:"bytes,6,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"` // cloud provider's account identifier + ProviderAlias string `protobuf:"bytes,7,opt,name=provider_alias,json=providerAlias,proto3" json:"provider_alias,omitempty"` // cloud provider's account alias + Provider Provider `protobuf:"varint,8,opt,name=provider,proto3,enum=draiosproto.Provider" json:"provider,omitempty"` // cloud provider type + Feature *AccountFeatures `protobuf:"bytes,9,opt,name=feature,proto3" json:"feature,omitempty"` // features of the account + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // account create time + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // account update time + Components []string `protobuf:"bytes,12,rep,name=components,proto3" json:"components,omitempty"` // string identifiers of installed components +} + +func (x *CloudAccount) Reset() { + *x = CloudAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_cloud_account_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudAccount) ProtoMessage() {} + +func (x *CloudAccount) ProtoReflect() protoreflect.Message { + mi := &file_cloud_account_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudAccount.ProtoReflect.Descriptor instead. +func (*CloudAccount) Descriptor() ([]byte, []int) { + return file_cloud_account_proto_rawDescGZIP(), []int{0} +} + +func (x *CloudAccount) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CloudAccount) GetCustomerId() uint64 { + if x != nil { + return x.CustomerId + } + return 0 +} + +func (x *CloudAccount) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *CloudAccount) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *CloudAccount) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CloudAccount) GetProviderId() string { + if x != nil { + return x.ProviderId + } + return "" +} + +func (x *CloudAccount) GetProviderAlias() string { + if x != nil { + return x.ProviderAlias + } + return "" +} + +func (x *CloudAccount) GetProvider() Provider { + if x != nil { + return x.Provider + } + return Provider_PROVIDER_UNSPECIFIED +} + +func (x *CloudAccount) GetFeature() *AccountFeatures { + if x != nil { + return x.Feature + } + return nil +} + +func (x *CloudAccount) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *CloudAccount) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *CloudAccount) GetComponents() []string { + if x != nil { + return x.Components + } + return nil +} + +type AccountFeatures struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SecureThreatDetection *AccountFeature `protobuf:"bytes,1,opt,name=secure_threat_detection,json=secureThreatDetection,proto3" json:"secure_threat_detection,omitempty"` + SecureConfigPosture *AccountFeature `protobuf:"bytes,2,opt,name=secure_config_posture,json=secureConfigPosture,proto3" json:"secure_config_posture,omitempty"` + SecureIdentityEntitlement *AccountFeature `protobuf:"bytes,3,opt,name=secure_identity_entitlement,json=secureIdentityEntitlement,proto3" json:"secure_identity_entitlement,omitempty"` + MonitorCloudMetrics *AccountFeature `protobuf:"bytes,4,opt,name=monitor_cloud_metrics,json=monitorCloudMetrics,proto3" json:"monitor_cloud_metrics,omitempty"` + SecureAgentlessScanning *AccountFeature `protobuf:"bytes,5,opt,name=secure_agentless_scanning,json=secureAgentlessScanning,proto3" json:"secure_agentless_scanning,omitempty"` +} + +func (x *AccountFeatures) Reset() { + *x = AccountFeatures{} + if protoimpl.UnsafeEnabled { + mi := &file_cloud_account_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountFeatures) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountFeatures) ProtoMessage() {} + +func (x *AccountFeatures) ProtoReflect() protoreflect.Message { + mi := &file_cloud_account_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountFeatures.ProtoReflect.Descriptor instead. +func (*AccountFeatures) Descriptor() ([]byte, []int) { + return file_cloud_account_proto_rawDescGZIP(), []int{1} +} + +func (x *AccountFeatures) GetSecureThreatDetection() *AccountFeature { + if x != nil { + return x.SecureThreatDetection + } + return nil +} + +func (x *AccountFeatures) GetSecureConfigPosture() *AccountFeature { + if x != nil { + return x.SecureConfigPosture + } + return nil +} + +func (x *AccountFeatures) GetSecureIdentityEntitlement() *AccountFeature { + if x != nil { + return x.SecureIdentityEntitlement + } + return nil +} + +func (x *AccountFeatures) GetMonitorCloudMetrics() *AccountFeature { + if x != nil { + return x.MonitorCloudMetrics + } + return nil +} + +func (x *AccountFeatures) GetSecureAgentlessScanning() *AccountFeature { + if x != nil { + return x.SecureAgentlessScanning + } + return nil +} + +// AccountFeature captures a sysdig feature enabled on a cloud account +type AccountFeature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type Feature `protobuf:"varint,1,opt,name=type,proto3,enum=draiosproto.Feature" json:"type,omitempty"` + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` + Available bool `protobuf:"varint,3,opt,name=available,proto3" json:"available,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Components []string `protobuf:"bytes,5,rep,name=components,proto3" json:"components,omitempty"` // string identifiers of components associated with the feature +} + +func (x *AccountFeature) Reset() { + *x = AccountFeature{} + if protoimpl.UnsafeEnabled { + mi := &file_cloud_account_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountFeature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountFeature) ProtoMessage() {} + +func (x *AccountFeature) ProtoReflect() protoreflect.Message { + mi := &file_cloud_account_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountFeature.ProtoReflect.Descriptor instead. +func (*AccountFeature) Descriptor() ([]byte, []int) { + return file_cloud_account_proto_rawDescGZIP(), []int{2} +} + +func (x *AccountFeature) GetType() Feature { + if x != nil { + return x.Type + } + return Feature_FEATURE_UNSPECIFIED +} + +func (x *AccountFeature) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *AccountFeature) GetAvailable() bool { + if x != nil { + return x.Available + } + return false +} + +func (x *AccountFeature) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *AccountFeature) GetComponents() []string { + if x != nil { + return x.Components + } + return nil +} + +var File_cloud_account_proto protoreflect.FileDescriptor + +var file_cloud_account_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xdf, 0x03, 0x0a, 0x0c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, + 0x0e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x41, + 0x6c, 0x69, 0x61, 0x73, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, + 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, + 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xbe, 0x03, 0x0a, 0x0f, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x17, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x74, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x64, 0x72, 0x61, + 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x15, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, + 0x68, 0x72, 0x65, 0x61, 0x74, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f, + 0x0a, 0x15, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, + 0x70, 0x6f, 0x73, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x13, 0x73, 0x65, 0x63, 0x75, + 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x5b, 0x0a, 0x1b, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x52, 0x19, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4f, 0x0a, 0x15, + 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x64, 0x72, + 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x13, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, + 0x72, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x57, 0x0a, + 0x19, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x65, 0x73, + 0x73, 0x5f, 0x73, 0x63, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x17, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x65, 0x73, 0x73, 0x53, 0x63, + 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0xcd, 0x01, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2a, 0x84, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, + 0x0c, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x41, 0x57, 0x53, 0x10, 0x01, 0x12, + 0x12, 0x0a, 0x0e, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x41, 0x5a, 0x55, 0x52, + 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, + 0x47, 0x43, 0x50, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, + 0x52, 0x5f, 0x4f, 0x4b, 0x54, 0x41, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x52, 0x4f, 0x56, + 0x49, 0x44, 0x45, 0x52, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x05, 0x2a, 0xdd, 0x01, + 0x0a, 0x07, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x46, 0x45, 0x41, + 0x54, 0x55, 0x52, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x45, + 0x43, 0x55, 0x52, 0x45, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x41, 0x54, 0x5f, 0x44, 0x45, 0x54, 0x45, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x46, 0x45, 0x41, 0x54, 0x55, + 0x52, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x55, 0x52, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, + 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x55, 0x52, 0x45, 0x10, 0x02, 0x12, 0x27, 0x0a, 0x23, 0x46, 0x45, + 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x55, 0x52, 0x45, 0x5f, 0x49, 0x44, 0x45, + 0x4e, 0x54, 0x49, 0x54, 0x59, 0x5f, 0x45, 0x4e, 0x54, 0x49, 0x54, 0x4c, 0x45, 0x4d, 0x45, 0x4e, + 0x54, 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4d, + 0x4f, 0x4e, 0x49, 0x54, 0x4f, 0x52, 0x5f, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x5f, 0x4d, 0x45, 0x54, + 0x52, 0x49, 0x43, 0x53, 0x10, 0x04, 0x12, 0x25, 0x0a, 0x21, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, + 0x45, 0x5f, 0x53, 0x45, 0x43, 0x55, 0x52, 0x45, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x4c, 0x45, + 0x53, 0x53, 0x5f, 0x53, 0x43, 0x41, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x42, 0x56, 0x0a, + 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x48, 0x01, 0x5a, 0x25, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, + 0x75, 0x74, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cloud_account_proto_rawDescOnce sync.Once + file_cloud_account_proto_rawDescData = file_cloud_account_proto_rawDesc +) + +func file_cloud_account_proto_rawDescGZIP() []byte { + file_cloud_account_proto_rawDescOnce.Do(func() { + file_cloud_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_cloud_account_proto_rawDescData) + }) + return file_cloud_account_proto_rawDescData +} + +var file_cloud_account_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_cloud_account_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_cloud_account_proto_goTypes = []interface{}{ + (Provider)(0), // 0: draiosproto.Provider + (Feature)(0), // 1: draiosproto.Feature + (*CloudAccount)(nil), // 2: draiosproto.CloudAccount + (*AccountFeatures)(nil), // 3: draiosproto.AccountFeatures + (*AccountFeature)(nil), // 4: draiosproto.AccountFeature + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp +} +var file_cloud_account_proto_depIdxs = []int32{ + 0, // 0: draiosproto.CloudAccount.provider:type_name -> draiosproto.Provider + 3, // 1: draiosproto.CloudAccount.feature:type_name -> draiosproto.AccountFeatures + 5, // 2: draiosproto.CloudAccount.created_at:type_name -> google.protobuf.Timestamp + 5, // 3: draiosproto.CloudAccount.updated_at:type_name -> google.protobuf.Timestamp + 4, // 4: draiosproto.AccountFeatures.secure_threat_detection:type_name -> draiosproto.AccountFeature + 4, // 5: draiosproto.AccountFeatures.secure_config_posture:type_name -> draiosproto.AccountFeature + 4, // 6: draiosproto.AccountFeatures.secure_identity_entitlement:type_name -> draiosproto.AccountFeature + 4, // 7: draiosproto.AccountFeatures.monitor_cloud_metrics:type_name -> draiosproto.AccountFeature + 4, // 8: draiosproto.AccountFeatures.secure_agentless_scanning:type_name -> draiosproto.AccountFeature + 1, // 9: draiosproto.AccountFeature.type:type_name -> draiosproto.Feature + 5, // 10: draiosproto.AccountFeature.created_at:type_name -> google.protobuf.Timestamp + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_cloud_account_proto_init() } +func file_cloud_account_proto_init() { + if File_cloud_account_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cloud_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudAccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cloud_account_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountFeatures); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cloud_account_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountFeature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cloud_account_proto_rawDesc, + NumEnums: 2, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cloud_account_proto_goTypes, + DependencyIndexes: file_cloud_account_proto_depIdxs, + EnumInfos: file_cloud_account_proto_enumTypes, + MessageInfos: file_cloud_account_proto_msgTypes, + }.Build() + File_cloud_account_proto = out.File + file_cloud_account_proto_rawDesc = nil + file_cloud_account_proto_goTypes = nil + file_cloud_account_proto_depIdxs = nil +} \ No newline at end of file diff --git a/sysdig/internal/client/v2/cloudauth/go/cloud_organization.pb.go b/sysdig/internal/client/v2/cloudauth/go/cloud_organization.pb.go new file mode 100644 index 000000000..a1e841419 --- /dev/null +++ b/sysdig/internal/client/v2/cloudauth/go/cloud_organization.pb.go @@ -0,0 +1,258 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: cloud_organization.proto + +package draiosproto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CloudOrganization struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ManagementAccountId string `protobuf:"bytes,3,opt,name=management_account_id,json=managementAccountId,proto3" json:"management_account_id,omitempty"` + Accounts []*CloudAccount `protobuf:"bytes,4,rep,name=accounts,proto3" json:"accounts,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + ProviderId string `protobuf:"bytes,7,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"` // cloud provider's organization identifier + Provider Provider `protobuf:"varint,8,opt,name=provider,proto3,enum=draiosproto.Provider" json:"provider,omitempty"` // cloud provider type + CustomerId uint64 `protobuf:"varint,9,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // the associated customer id + OrganizationalUnitIds []string `protobuf:"bytes,10,rep,name=organizational_unit_ids,json=organizationalUnitIds,proto3" json:"organizational_unit_ids,omitempty"` // an optional sub OU to target for the organization +} + +func (x *CloudOrganization) Reset() { + *x = CloudOrganization{} + if protoimpl.UnsafeEnabled { + mi := &file_cloud_organization_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloudOrganization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudOrganization) ProtoMessage() {} + +func (x *CloudOrganization) ProtoReflect() protoreflect.Message { + mi := &file_cloud_organization_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudOrganization.ProtoReflect.Descriptor instead. +func (*CloudOrganization) Descriptor() ([]byte, []int) { + return file_cloud_organization_proto_rawDescGZIP(), []int{0} +} + +func (x *CloudOrganization) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CloudOrganization) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CloudOrganization) GetManagementAccountId() string { + if x != nil { + return x.ManagementAccountId + } + return "" +} + +func (x *CloudOrganization) GetAccounts() []*CloudAccount { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *CloudOrganization) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *CloudOrganization) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *CloudOrganization) GetProviderId() string { + if x != nil { + return x.ProviderId + } + return "" +} + +func (x *CloudOrganization) GetProvider() Provider { + if x != nil { + return x.Provider + } + return Provider_PROVIDER_UNSPECIFIED +} + +func (x *CloudOrganization) GetCustomerId() uint64 { + if x != nil { + return x.CustomerId + } + return 0 +} + +func (x *CloudOrganization) GetOrganizationalUnitIds() []string { + if x != nil { + return x.OrganizationalUnitIds + } + return nil +} + +var File_cloud_organization_proto protoreflect.FileDescriptor + +var file_cloud_organization_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x72, 0x61, 0x69, + 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x03, + 0x0a, 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x64, 0x72, + 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x36, 0x0a, + 0x17, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, + 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, + 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, + 0x69, 0x74, 0x49, 0x64, 0x73, 0x42, 0x5b, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x72, 0x61, + 0x69, 0x6f, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x42, 0x15, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x01, 0x5a, 0x25, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x64, 0x72, 0x61, 0x69, 0x6f, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cloud_organization_proto_rawDescOnce sync.Once + file_cloud_organization_proto_rawDescData = file_cloud_organization_proto_rawDesc +) + +func file_cloud_organization_proto_rawDescGZIP() []byte { + file_cloud_organization_proto_rawDescOnce.Do(func() { + file_cloud_organization_proto_rawDescData = protoimpl.X.CompressGZIP(file_cloud_organization_proto_rawDescData) + }) + return file_cloud_organization_proto_rawDescData +} + +var file_cloud_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cloud_organization_proto_goTypes = []interface{}{ + (*CloudOrganization)(nil), // 0: draiosproto.CloudOrganization + (*CloudAccount)(nil), // 1: draiosproto.CloudAccount + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (Provider)(0), // 3: draiosproto.Provider +} +var file_cloud_organization_proto_depIdxs = []int32{ + 1, // 0: draiosproto.CloudOrganization.accounts:type_name -> draiosproto.CloudAccount + 2, // 1: draiosproto.CloudOrganization.created_at:type_name -> google.protobuf.Timestamp + 2, // 2: draiosproto.CloudOrganization.updated_at:type_name -> google.protobuf.Timestamp + 3, // 3: draiosproto.CloudOrganization.provider:type_name -> draiosproto.Provider + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cloud_organization_proto_init() } +func file_cloud_organization_proto_init() { + if File_cloud_organization_proto != nil { + return + } + file_cloud_account_proto_init() + if !protoimpl.UnsafeEnabled { + file_cloud_organization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloudOrganization); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cloud_organization_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cloud_organization_proto_goTypes, + DependencyIndexes: file_cloud_organization_proto_depIdxs, + MessageInfos: file_cloud_organization_proto_msgTypes, + }.Build() + File_cloud_organization_proto = out.File + file_cloud_organization_proto_rawDesc = nil + file_cloud_organization_proto_goTypes = nil + file_cloud_organization_proto_depIdxs = nil +} \ No newline at end of file diff --git a/sysdig/internal/client/v2/model.go b/sysdig/internal/client/v2/model.go index e51e512b5..cb5ded97d 100644 --- a/sysdig/internal/client/v2/model.go +++ b/sysdig/internal/client/v2/model.go @@ -1,7 +1,7 @@ package v2 import ( - proto "github.com/draios/protorepo/cloudauth/go" + cloudauth "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2/cloudauth/go" ) type Team struct { @@ -416,7 +416,7 @@ type CloudAccountSecure struct { WorkLoadIdentityAccountAlias string `json:"workLoadIdentityAccountAlias,omitempty"` } -type CloudauthAccountSecure proto.CloudAccount +type CloudauthAccountSecure cloudauth.CloudAccount type ScanningPolicy struct { ID string `json:"id,omitempty"` From f8fb75d11bffe4d066a2011c8b40902d4a4ede28 Mon Sep 17 00:00:00 2001 From: Ravina Dhruve Date: Wed, 6 Sep 2023 17:23:01 -0700 Subject: [PATCH 05/19] SSPROD-29308: Remove not required protorepo module --- go.mod | 3 +-- go.sum | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/go.mod b/go.mod index f7ce97bb4..d0e210bde 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.19 require ( github.com/Jeffail/gabs/v2 v2.7.0 github.com/aws/aws-sdk-go v1.44.280 - github.com/draios/protorepo/cloudauth/go v0.0.0-20230901163632-fcbfe0cb84e0 github.com/falcosecurity/kilt/runtimes/cloudformation v0.0.0-20230606123839-2e4c434d5d88 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-retryablehttp v0.7.4 @@ -14,6 +13,7 @@ require ( github.com/rs/zerolog v1.29.1 github.com/spf13/cast v1.5.1 github.com/stretchr/testify v1.8.4 + google.golang.org/protobuf v1.28.1 ) require ( @@ -78,6 +78,5 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect google.golang.org/grpc v1.51.0 // indirect - google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 543696945..3d9525aad 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,6 @@ github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPa github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= -github.com/draios/protorepo/cloudauth/go v0.0.0-20230901163632-fcbfe0cb84e0 h1:LKBglxJ55sl7NuP5IrC/SD89ZQFwN8ejh8XGJ0dj5P0= -github.com/draios/protorepo/cloudauth/go v0.0.0-20230901163632-fcbfe0cb84e0/go.mod h1:JmBZh3AOhz4gg83qMw9p2QDCIiLSH9YCyyvDVClIynU= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/falcosecurity/kilt/pkg v0.0.0-20230111165949-b36cdd622de1 h1:7JOAJwPA4FEtowSP133pgicOu+nOfo0wGuXapXKhafk= From f26cb07f27b1489dfb1631a748328361bb54101a Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Tue, 5 Sep 2023 12:37:27 -0700 Subject: [PATCH 06/19] Initial draft of resource --- ...resource_sysdig_secure_cloud_account_v2.go | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sysdig/resource_sysdig_secure_cloud_account_v2.go diff --git a/sysdig/resource_sysdig_secure_cloud_account_v2.go b/sysdig/resource_sysdig_secure_cloud_account_v2.go new file mode 100644 index 000000000..9efa9ad33 --- /dev/null +++ b/sysdig/resource_sysdig_secure_cloud_account_v2.go @@ -0,0 +1,96 @@ +package sysdig + +import ( + "context" + "time" + + v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +func resourceSysdigSecureCloudAccountV2() *schema.Resource { + timeout := 5 * time.Minute + + return &schema.Resource{ + // CreateContext: resourceSysdigSecureCloudAccountCreate, + // UpdateContext: resourceSysdigSecureCloudAccountUpdate, + // ReadContext: resourceSysdigSecureCloudAccountRead, + // DeleteContext: resourceSysdigSecureCloudAccountDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(timeout), + Update: schema.DefaultTimeout(timeout), + Read: schema.DefaultTimeout(timeout), + Delete: schema.DefaultTimeout(timeout), + }, + Schema: map[string]*schema.Schema{ + "account_id": { + Type: schema.TypeString, + Required: true, + }, + "cloud_provider": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{"gcp"}, false), + }, + "alias": { + Type: schema.TypeString, + Optional: true, + }, + "role_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "role_name": { + Type: schema.TypeString, + Optional: true, + Default: "SysdigCloudBench", + }, + "external_id": { + Type: schema.TypeString, + Computed: true, + }, + "workload_identity_account_id": { + Type: schema.TypeString, + Optional: true, + }, + "workload_identity_account_alias": { + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +func resourceSysdigSecureCloudAccountV2Create(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func resourceSysdigSecureCloudAccountV2Read(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func resourceSysdigSecureCloudAccountV2Update(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func resourceSysdigSecureCloudAccountV2Delete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func cloudAccountFromResourceDataV2(d *schema.ResourceData) *v2.CloudAccountSecure { + return &v2.CloudAccountSecure{ + AccountID: d.Get("account_id").(string), + Provider: d.Get("cloud_provider").(string), + Alias: d.Get("alias").(string), + RoleAvailable: d.Get("role_enabled").(bool), + RoleName: d.Get("role_name").(string), + WorkLoadIdentityAccountID: d.Get("workload_identity_account_id").(string), + WorkLoadIdentityAccountAlias: d.Get("workload_identity_account_alias").(string), + } +} From 07aa6b94442442fa8105eb4a1bd6ed5d91e6e3e0 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Wed, 6 Sep 2023 10:11:34 -0700 Subject: [PATCH 07/19] go fmt file --- ...resource_sysdig_secure_cloud_account_v2.go | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_account_v2.go b/sysdig/resource_sysdig_secure_cloud_account_v2.go index 9efa9ad33..712a4aa44 100644 --- a/sysdig/resource_sysdig_secure_cloud_account_v2.go +++ b/sysdig/resource_sysdig_secure_cloud_account_v2.go @@ -24,43 +24,43 @@ func resourceSysdigSecureCloudAccountV2() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), Update: schema.DefaultTimeout(timeout), - Read: schema.DefaultTimeout(timeout), + Read: schema.DefaultTimeout(timeout), Delete: schema.DefaultTimeout(timeout), }, Schema: map[string]*schema.Schema{ "account_id": { - Type: schema.TypeString, + Type: schema.TypeString, Required: true, }, "cloud_provider": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, ValidateFunc: validation.StringInSlice([]string{"gcp"}, false), }, "alias": { - Type: schema.TypeString, + Type: schema.TypeString, Optional: true, }, "role_enabled": { - Type: schema.TypeBool, + Type: schema.TypeBool, Optional: true, - Default: false, + Default: false, }, "role_name": { - Type: schema.TypeString, + Type: schema.TypeString, Optional: true, - Default: "SysdigCloudBench", + Default: "SysdigCloudBench", }, "external_id": { - Type: schema.TypeString, + Type: schema.TypeString, Computed: true, }, "workload_identity_account_id": { - Type: schema.TypeString, + Type: schema.TypeString, Optional: true, }, "workload_identity_account_alias": { - Type: schema.TypeString, + Type: schema.TypeString, Optional: true, }, }, @@ -85,12 +85,12 @@ func resourceSysdigSecureCloudAccountV2Delete(ctx context.Context, d *schema.Res func cloudAccountFromResourceDataV2(d *schema.ResourceData) *v2.CloudAccountSecure { return &v2.CloudAccountSecure{ - AccountID: d.Get("account_id").(string), - Provider: d.Get("cloud_provider").(string), - Alias: d.Get("alias").(string), - RoleAvailable: d.Get("role_enabled").(bool), - RoleName: d.Get("role_name").(string), - WorkLoadIdentityAccountID: d.Get("workload_identity_account_id").(string), + AccountID: d.Get("account_id").(string), + Provider: d.Get("cloud_provider").(string), + Alias: d.Get("alias").(string), + RoleAvailable: d.Get("role_enabled").(bool), + RoleName: d.Get("role_name").(string), + WorkLoadIdentityAccountID: d.Get("workload_identity_account_id").(string), WorkLoadIdentityAccountAlias: d.Get("workload_identity_account_alias").(string), } } From c4fa199e82986ead04519451e921b23307e99207 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Wed, 6 Sep 2023 10:33:29 -0700 Subject: [PATCH 08/19] Use declared functions --- sysdig/resource_sysdig_secure_cloud_account_v2.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_account_v2.go b/sysdig/resource_sysdig_secure_cloud_account_v2.go index 712a4aa44..629bd3716 100644 --- a/sysdig/resource_sysdig_secure_cloud_account_v2.go +++ b/sysdig/resource_sysdig_secure_cloud_account_v2.go @@ -14,10 +14,10 @@ func resourceSysdigSecureCloudAccountV2() *schema.Resource { timeout := 5 * time.Minute return &schema.Resource{ - // CreateContext: resourceSysdigSecureCloudAccountCreate, - // UpdateContext: resourceSysdigSecureCloudAccountUpdate, - // ReadContext: resourceSysdigSecureCloudAccountRead, - // DeleteContext: resourceSysdigSecureCloudAccountDelete, + CreateContext: resourceSysdigSecureCloudAccountV2Create, + UpdateContext: resourceSysdigSecureCloudAccountV2Update, + ReadContext: resourceSysdigSecureCloudAccountV2Read, + DeleteContext: resourceSysdigSecureCloudAccountV2Delete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, From 256dba920236d683f9eb9e9c9ff2b7ab2442c2dd Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Wed, 6 Sep 2023 12:06:24 -0700 Subject: [PATCH 09/19] Rename and add resource --- sysdig/provider.go | 1 + ...source_sysdig_secure_cloud_auth_account.go | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 sysdig/resource_sysdig_secure_cloud_auth_account.go diff --git a/sysdig/provider.go b/sysdig/provider.go index 47afe8ca0..5a61dc33b 100644 --- a/sysdig/provider.go +++ b/sysdig/provider.go @@ -133,6 +133,7 @@ func Provider() *schema.Provider { "sysdig_secure_cloud_account": resourceSysdigSecureCloudAccount(), "sysdig_secure_scanning_policy": resourceSysdigSecureScanningPolicy(), "sysdig_secure_scanning_policy_assignment": resourceSysdigSecureScanningPolicyAssignment(), + "sysdig_secure_cloud_auth_account": resourceSysdigSecureCloudAccount(), "sysdig_monitor_silence_rule": resourceSysdigMonitorSilenceRule(), "sysdig_monitor_alert_downtime": resourceSysdigMonitorAlertDowntime(), diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go new file mode 100644 index 000000000..da892b17f --- /dev/null +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -0,0 +1,96 @@ +package sysdig + +import ( + "context" + "time" + + v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +func resourceSysdigSecureCloudauthAccount() *schema.Resource { + timeout := 5 * time.Minute + + return &schema.Resource{ + CreateContext: resourceSysdigSecureCloudauthAccountCreate, + UpdateContext: resourceSysdigSecureCloudauthAccountUpdate, + ReadContext: resourceSysdigSecureCloudauthAccountRead, + DeleteContext: resourceSysdigSecureCloudauthAccountDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(timeout), + Update: schema.DefaultTimeout(timeout), + Read: schema.DefaultTimeout(timeout), + Delete: schema.DefaultTimeout(timeout), + }, + Schema: map[string]*schema.Schema{ + "account_id": { + Type: schema.TypeString, + Required: true, + }, + "cloud_provider": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{"gcp"}, false), + }, + "alias": { + Type: schema.TypeString, + Optional: true, + }, + "role_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "role_name": { + Type: schema.TypeString, + Optional: true, + Default: "SysdigCloudBench", + }, + "external_id": { + Type: schema.TypeString, + Computed: true, + }, + "workload_identity_account_id": { + Type: schema.TypeString, + Optional: true, + }, + "workload_identity_account_alias": { + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +func resourceSysdigSecureCloudauthAccountCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func resourceSysdigSecureCloudauthAccountRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func resourceSysdigSecureCloudauthAccountUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} + +func cloudAccountFromResourceDataV2(d *schema.ResourceData) *v2.CloudAccountSecure { + return &v2.CloudAccountSecure{ + AccountID: d.Get("account_id").(string), + Provider: d.Get("cloud_provider").(string), + Alias: d.Get("alias").(string), + RoleAvailable: d.Get("role_enabled").(bool), + RoleName: d.Get("role_name").(string), + WorkLoadIdentityAccountID: d.Get("workload_identity_account_id").(string), + WorkLoadIdentityAccountAlias: d.Get("workload_identity_account_alias").(string), + } +} From 1e99f7545427477541263a0da72a290791981857 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Wed, 6 Sep 2023 12:18:24 -0700 Subject: [PATCH 10/19] Remove unused file --- sysdig/provider.go | 2 +- ...resource_sysdig_secure_cloud_account_v2.go | 96 ------------------- ...source_sysdig_secure_cloud_auth_account.go | 2 +- 3 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 sysdig/resource_sysdig_secure_cloud_account_v2.go diff --git a/sysdig/provider.go b/sysdig/provider.go index 5a61dc33b..11fda2183 100644 --- a/sysdig/provider.go +++ b/sysdig/provider.go @@ -133,7 +133,7 @@ func Provider() *schema.Provider { "sysdig_secure_cloud_account": resourceSysdigSecureCloudAccount(), "sysdig_secure_scanning_policy": resourceSysdigSecureScanningPolicy(), "sysdig_secure_scanning_policy_assignment": resourceSysdigSecureScanningPolicyAssignment(), - "sysdig_secure_cloud_auth_account": resourceSysdigSecureCloudAccount(), + "sysdig_secure_cloud_auth_account": resourceSysdigSecureCloudauthAccount(), "sysdig_monitor_silence_rule": resourceSysdigMonitorSilenceRule(), "sysdig_monitor_alert_downtime": resourceSysdigMonitorAlertDowntime(), diff --git a/sysdig/resource_sysdig_secure_cloud_account_v2.go b/sysdig/resource_sysdig_secure_cloud_account_v2.go deleted file mode 100644 index 629bd3716..000000000 --- a/sysdig/resource_sysdig_secure_cloud_account_v2.go +++ /dev/null @@ -1,96 +0,0 @@ -package sysdig - -import ( - "context" - "time" - - v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" -) - -func resourceSysdigSecureCloudAccountV2() *schema.Resource { - timeout := 5 * time.Minute - - return &schema.Resource{ - CreateContext: resourceSysdigSecureCloudAccountV2Create, - UpdateContext: resourceSysdigSecureCloudAccountV2Update, - ReadContext: resourceSysdigSecureCloudAccountV2Read, - DeleteContext: resourceSysdigSecureCloudAccountV2Delete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(timeout), - Update: schema.DefaultTimeout(timeout), - Read: schema.DefaultTimeout(timeout), - Delete: schema.DefaultTimeout(timeout), - }, - Schema: map[string]*schema.Schema{ - "account_id": { - Type: schema.TypeString, - Required: true, - }, - "cloud_provider": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"gcp"}, false), - }, - "alias": { - Type: schema.TypeString, - Optional: true, - }, - "role_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "role_name": { - Type: schema.TypeString, - Optional: true, - Default: "SysdigCloudBench", - }, - "external_id": { - Type: schema.TypeString, - Computed: true, - }, - "workload_identity_account_id": { - Type: schema.TypeString, - Optional: true, - }, - "workload_identity_account_alias": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} - -func resourceSysdigSecureCloudAccountV2Create(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return nil -} - -func resourceSysdigSecureCloudAccountV2Read(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return nil -} - -func resourceSysdigSecureCloudAccountV2Update(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return nil -} - -func resourceSysdigSecureCloudAccountV2Delete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return nil -} - -func cloudAccountFromResourceDataV2(d *schema.ResourceData) *v2.CloudAccountSecure { - return &v2.CloudAccountSecure{ - AccountID: d.Get("account_id").(string), - Provider: d.Get("cloud_provider").(string), - Alias: d.Get("alias").(string), - RoleAvailable: d.Get("role_enabled").(bool), - RoleName: d.Get("role_name").(string), - WorkLoadIdentityAccountID: d.Get("workload_identity_account_id").(string), - WorkLoadIdentityAccountAlias: d.Get("workload_identity_account_alias").(string), - } -} diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index da892b17f..a33426048 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -83,7 +83,7 @@ func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, d *schema.R return nil } -func cloudAccountFromResourceDataV2(d *schema.ResourceData) *v2.CloudAccountSecure { +func cloudauthAccountFromResourceData(d *schema.ResourceData) *v2.CloudAccountSecure { return &v2.CloudAccountSecure{ AccountID: d.Get("account_id").(string), Provider: d.Get("cloud_provider").(string), From 3d08ad00c61ec9c615146542f64df70fcaa15756 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Wed, 6 Sep 2023 12:19:54 -0700 Subject: [PATCH 11/19] Reformat files --- sysdig/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdig/provider.go b/sysdig/provider.go index 11fda2183..e575800dc 100644 --- a/sysdig/provider.go +++ b/sysdig/provider.go @@ -133,7 +133,7 @@ func Provider() *schema.Provider { "sysdig_secure_cloud_account": resourceSysdigSecureCloudAccount(), "sysdig_secure_scanning_policy": resourceSysdigSecureScanningPolicy(), "sysdig_secure_scanning_policy_assignment": resourceSysdigSecureScanningPolicyAssignment(), - "sysdig_secure_cloud_auth_account": resourceSysdigSecureCloudauthAccount(), + "sysdig_secure_cloud_auth_account": resourceSysdigSecureCloudauthAccount(), "sysdig_monitor_silence_rule": resourceSysdigMonitorSilenceRule(), "sysdig_monitor_alert_downtime": resourceSysdigMonitorAlertDowntime(), From a2644f4f25e46683d4309273d628e06be428e301 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Wed, 6 Sep 2023 15:43:06 -0700 Subject: [PATCH 12/19] Add alias field --- ...source_sysdig_secure_cloud_auth_account.go | 46 +++++++------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index a33426048..d412b4ffb 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -28,40 +28,26 @@ func resourceSysdigSecureCloudauthAccount() *schema.Resource { Delete: schema.DefaultTimeout(timeout), }, Schema: map[string]*schema.Schema{ - "account_id": { + "cloud_provider_id": { Type: schema.TypeString, Required: true, }, - "cloud_provider": { + "cloud_provider_type": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"gcp"}, false), + ValidateFunc: validation.StringInSlice([]string{"aws", "gcp", "azure"}, false), }, - "alias": { + "cloud_provider_alias": { Type: schema.TypeString, Optional: true, }, - "role_enabled": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "role_name": { + "customer_id": { Type: schema.TypeString, - Optional: true, - Default: "SysdigCloudBench", - }, - "external_id": { - Type: schema.TypeString, - Computed: true, - }, - "workload_identity_account_id": { - Type: schema.TypeString, - Optional: true, + Required: true, }, - "workload_identity_account_alias": { + "account_id": { Type: schema.TypeString, - Optional: true, + Required: true, }, }, } @@ -83,14 +69,14 @@ func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, d *schema.R return nil } -func cloudauthAccountFromResourceData(d *schema.ResourceData) *v2.CloudAccountSecure { +func cloudauthAccountFromResourceData(data *schema.ResourceData) *v2.CloudAccountSecure { return &v2.CloudAccountSecure{ - AccountID: d.Get("account_id").(string), - Provider: d.Get("cloud_provider").(string), - Alias: d.Get("alias").(string), - RoleAvailable: d.Get("role_enabled").(bool), - RoleName: d.Get("role_name").(string), - WorkLoadIdentityAccountID: d.Get("workload_identity_account_id").(string), - WorkLoadIdentityAccountAlias: d.Get("workload_identity_account_alias").(string), + AccountID: data.Get("account_id").(string), + Provider: data.Get("cloud_provider").(string), + Alias: data.Get("alias").(string), + RoleAvailable: data.Get("role_enabled").(bool), + RoleName: data.Get("role_name").(string), + WorkLoadIdentityAccountID: data.Get("workload_identity_account_id").(string), + WorkLoadIdentityAccountAlias: data.Get("workload_identity_account_alias").(string), } } From 9f737f53909c8b3bb9b442d46d5deb37c6841812 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Wed, 6 Sep 2023 16:01:42 -0700 Subject: [PATCH 13/19] Rebase and add toResourceData function --- ...source_sysdig_secure_cloud_auth_account.go | 51 +++++++++++++++---- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index d412b4ffb..fbb6e166a 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -4,6 +4,7 @@ import ( "context" "time" + draiosproto "github.com/draios/protorepo/cloudauth/go" v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -69,14 +70,46 @@ func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, d *schema.R return nil } -func cloudauthAccountFromResourceData(data *schema.ResourceData) *v2.CloudAccountSecure { - return &v2.CloudAccountSecure{ - AccountID: data.Get("account_id").(string), - Provider: data.Get("cloud_provider").(string), - Alias: data.Get("alias").(string), - RoleAvailable: data.Get("role_enabled").(bool), - RoleName: data.Get("role_name").(string), - WorkLoadIdentityAccountID: data.Get("workload_identity_account_id").(string), - WorkLoadIdentityAccountAlias: data.Get("workload_identity_account_alias").(string), +func cloudauthAccountFromResourceData(data *schema.ResourceData) *v2.CloudauthAccountSecure { + return &v2.CloudauthAccountSecure{ + Id: data.Get("account_id").(string), + CustomerId: data.Get("customer_id").(uint64), + ProviderId: data.Get("cloud_provider_id").(string), + Provider: data.Get("cloud_provider_type").(draiosproto.Provider), + ProviderAlias: data.Get("cloud_provider_alias").(string), } } + +func cloudauthAccountToResourceData(data *schema.ResourceData, cloudAccount *v2.CloudauthAccountSecure) error { + err := data.Set("account_id", cloudAccount.Id) + + if err != nil { + return err + } + + err = data.Set("customer_id", cloudAccount.CustomerId) + + if err != nil { + return err + } + + err = data.Set("cloud_provider_id", cloudAccount.ProviderId) + + if err != nil { + return err + } + + err = data.Set("cloud_provider_type", cloudAccount.Provider) + + if err != nil { + return err + } + + err = data.Set("cloud_provider_alias", cloudAccount.ProviderAlias) + + if err != nil { + return err + } + + return nil +} From 7b6df828790519eafb951adeb37f1e697d9db168 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Thu, 7 Sep 2023 10:26:03 -0700 Subject: [PATCH 14/19] Implement CRUD operations in resource --- ...source_sysdig_secure_cloud_auth_account.go | 78 ++++++++++++++++++- 1 file changed, 74 insertions(+), 4 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index fbb6e166a..5a7681011 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -2,6 +2,7 @@ package sysdig import ( "context" + "strings" "time" draiosproto "github.com/draios/protorepo/cloudauth/go" @@ -54,19 +55,88 @@ func resourceSysdigSecureCloudauthAccount() *schema.Resource { } } -func resourceSysdigSecureCloudauthAccountCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func getSecureCloudauthAccountClient(client SysdigClients) (v2.CloudauthAccountSecureInterface, error) { + return client.sysdigSecureClientV2() +} + +func resourceSysdigSecureCloudauthAccountCreate(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + client, err := getSecureCloudauthAccountClient((meta.(SysdigClients))) + + if err != nil { + return diag.FromErr(err) + } + + cloudauthAccount, err := client.CreateCloudauthAccountSecure(ctx, cloudauthAccountFromResourceData(data)) + + if err != nil { + return diag.FromErr(err) + } + + data.SetId(cloudauthAccount.Id) + return nil } -func resourceSysdigSecureCloudauthAccountRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func resourceSysdigSecureCloudauthAccountRead(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + client, err := getSecureCloudauthAccountClient(meta.(SysdigClients)) + + if err != nil { + data.SetId("") + return diag.FromErr(err) + } + + cloudauthAccount, err := client.GetCloudauthAccountSecure(ctx, data.Id()) + + if err != nil { + data.SetId("") + + if strings.Contains(err.Error(), "404") { + return nil + } + return diag.FromErr(err) + } + + err = cloudauthAccountToResourceData(data, cloudauthAccount) + + if err != nil { + return diag.FromErr(err) + } + return nil } -func resourceSysdigSecureCloudauthAccountUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func resourceSysdigSecureCloudauthAccountUpdate(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + client, err := getSecureCloudauthAccountClient(meta.(SysdigClients)) + + if err != nil { + return diag.FromErr(err) + } + + _, err = client.UpdateCloudauthAccountSecure(ctx, data.Id(), cloudauthAccountFromResourceData(data)) + + if err != nil { + if strings.Contains(err.Error(), "404") { + return nil + } + return diag.FromErr(err) + } + return nil } -func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + client, err := getSecureCloudauthAccountClient(meta.(SysdigClients)) + + if err != nil { + return diag.FromErr(err) + } + + err = client.DeleteCloudauthAccountSecure(ctx, data.Id()) + + if err != nil { + return diag.FromErr(err) + } + return nil } From 2f176abe9e48701cbd0c167263592c72da2b0d20 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Thu, 7 Sep 2023 11:01:07 -0700 Subject: [PATCH 15/19] Add enabled field --- ...source_sysdig_secure_cloud_auth_account.go | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index 5a7681011..74d69e942 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -30,6 +30,10 @@ func resourceSysdigSecureCloudauthAccount() *schema.Resource { Delete: schema.DefaultTimeout(timeout), }, Schema: map[string]*schema.Schema{ + "account_id": { + Type: schema.TypeString, + Required: true, + }, "cloud_provider_id": { Type: schema.TypeString, Required: true, @@ -39,16 +43,8 @@ func resourceSysdigSecureCloudauthAccount() *schema.Resource { Required: true, ValidateFunc: validation.StringInSlice([]string{"aws", "gcp", "azure"}, false), }, - "cloud_provider_alias": { - Type: schema.TypeString, - Optional: true, - }, - "customer_id": { - Type: schema.TypeString, - Required: true, - }, - "account_id": { - Type: schema.TypeString, + "enabled": { + Type: schema.TypeBool, Required: true, }, }, @@ -89,7 +85,7 @@ func resourceSysdigSecureCloudauthAccountRead(ctx context.Context, data *schema. if err != nil { data.SetId("") - + if strings.Contains(err.Error(), "404") { return nil } @@ -142,11 +138,10 @@ func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, data *schem func cloudauthAccountFromResourceData(data *schema.ResourceData) *v2.CloudauthAccountSecure { return &v2.CloudauthAccountSecure{ - Id: data.Get("account_id").(string), - CustomerId: data.Get("customer_id").(uint64), - ProviderId: data.Get("cloud_provider_id").(string), - Provider: data.Get("cloud_provider_type").(draiosproto.Provider), - ProviderAlias: data.Get("cloud_provider_alias").(string), + Id: data.Get("account_id").(string), + Enabled: data.Get("enabled").(bool), + ProviderId: data.Get("cloud_provider_id").(string), + Provider: data.Get("cloud_provider_type").(draiosproto.Provider), } } @@ -157,7 +152,7 @@ func cloudauthAccountToResourceData(data *schema.ResourceData, cloudAccount *v2. return err } - err = data.Set("customer_id", cloudAccount.CustomerId) + err = data.Set("enabled", cloudAccount.Enabled) if err != nil { return err @@ -175,11 +170,5 @@ func cloudauthAccountToResourceData(data *schema.ResourceData, cloudAccount *v2. return err } - err = data.Set("cloud_provider_alias", cloudAccount.ProviderAlias) - - if err != nil { - return err - } - return nil } From 9395145f7dc97cf6f16bfe16d39b67c3a515212c Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Thu, 7 Sep 2023 11:16:35 -0700 Subject: [PATCH 16/19] Change type for provider type --- sysdig/resource_sysdig_secure_cloud_auth_account.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index 74d69e942..5232a2f35 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -7,6 +7,7 @@ import ( draiosproto "github.com/draios/protorepo/cloudauth/go" v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" + cloudauth "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2/cloudauth/go" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -39,9 +40,9 @@ func resourceSysdigSecureCloudauthAccount() *schema.Resource { Required: true, }, "cloud_provider_type": { - Type: schema.TypeString, + Type: schema.TypeInt, Required: true, - ValidateFunc: validation.StringInSlice([]string{"aws", "gcp", "azure"}, false), + ValidateFunc: validation.StringInSlice([]string{cloudauth.Provider_PROVIDER_AWS.String(), cloudauth.Provider_PROVIDER_GCP.String(), cloudauth.Provider_PROVIDER_AZURE.String()}, false), }, "enabled": { Type: schema.TypeBool, From f20e1cb816ec646f2ff3ca8890f0f1e02754fe5d Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Thu, 7 Sep 2023 11:21:57 -0700 Subject: [PATCH 17/19] Remove unused proto import --- sysdig/resource_sysdig_secure_cloud_auth_account.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index 5232a2f35..e6951304d 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -5,7 +5,6 @@ import ( "strings" "time" - draiosproto "github.com/draios/protorepo/cloudauth/go" v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" cloudauth "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2/cloudauth/go" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -142,7 +141,7 @@ func cloudauthAccountFromResourceData(data *schema.ResourceData) *v2.CloudauthAc Id: data.Get("account_id").(string), Enabled: data.Get("enabled").(bool), ProviderId: data.Get("cloud_provider_id").(string), - Provider: data.Get("cloud_provider_type").(draiosproto.Provider), + Provider: data.Get("cloud_provider_type").(cloudauth.Provider), } } From b88e0fef65b60142e4e3787bbbc94250707262c6 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Thu, 7 Sep 2023 11:56:47 -0700 Subject: [PATCH 18/19] Remove setId to empty --- sysdig/resource_sysdig_secure_cloud_auth_account.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index e6951304d..fd5a7473a 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -77,15 +77,12 @@ func resourceSysdigSecureCloudauthAccountRead(ctx context.Context, data *schema. client, err := getSecureCloudauthAccountClient(meta.(SysdigClients)) if err != nil { - data.SetId("") return diag.FromErr(err) } cloudauthAccount, err := client.GetCloudauthAccountSecure(ctx, data.Id()) if err != nil { - data.SetId("") - if strings.Contains(err.Error(), "404") { return nil } From b57f31f16481032a01dc4e47eb93a9fe51b6a4d6 Mon Sep 17 00:00:00 2001 From: Raghav Anandan Date: Thu, 7 Sep 2023 14:06:06 -0700 Subject: [PATCH 19/19] Change account_id to id --- sysdig/resource_sysdig_secure_cloud_auth_account.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sysdig/resource_sysdig_secure_cloud_auth_account.go b/sysdig/resource_sysdig_secure_cloud_auth_account.go index fd5a7473a..7b610d693 100644 --- a/sysdig/resource_sysdig_secure_cloud_auth_account.go +++ b/sysdig/resource_sysdig_secure_cloud_auth_account.go @@ -30,7 +30,7 @@ func resourceSysdigSecureCloudauthAccount() *schema.Resource { Delete: schema.DefaultTimeout(timeout), }, Schema: map[string]*schema.Schema{ - "account_id": { + "id": { Type: schema.TypeString, Required: true, }, @@ -135,7 +135,6 @@ func resourceSysdigSecureCloudauthAccountDelete(ctx context.Context, data *schem func cloudauthAccountFromResourceData(data *schema.ResourceData) *v2.CloudauthAccountSecure { return &v2.CloudauthAccountSecure{ - Id: data.Get("account_id").(string), Enabled: data.Get("enabled").(bool), ProviderId: data.Get("cloud_provider_id").(string), Provider: data.Get("cloud_provider_type").(cloudauth.Provider), @@ -143,7 +142,7 @@ func cloudauthAccountFromResourceData(data *schema.ResourceData) *v2.CloudauthAc } func cloudauthAccountToResourceData(data *schema.ResourceData, cloudAccount *v2.CloudauthAccountSecure) error { - err := data.Set("account_id", cloudAccount.Id) + err := data.Set("id", cloudAccount.Id) if err != nil { return err