From f26a195654061e58bbda150ea4484a87ab005e4e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 14 Feb 2024 14:33:42 +0000 Subject: [PATCH] Regenerate client from commit ffc670cf of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v1/openapi.yaml | 12 ++++ .generator/schemas/v2/openapi.yaml | 12 ++++ api/datadogV1/model_gcp_account.go | 38 ++++++++++- ...model_gcpsts_service_account_attributes.go | 38 ++++++++++- .../gcp-integration/CreateGCPIntegration.go | 15 ++-- .../UpdateGCPIntegration_3544259255.go | 48 +++++++++++++ .../CreateGCPSTSAccount_194782945.go | 41 +++++++++++ .../UpdateGCPSTSAccount_2241994060.go | 44 ++++++++++++ ...GCP_integration_returns_OK_response.freeze | 2 +- ...a_GCP_integration_returns_OK_response.yaml | 4 +- ...evision_filters_returns_OK_response.freeze | 1 + ..._revision_filters_returns_OK_response.yaml | 68 +++++++++++++++++++ ...filters_enabled_returns_OK_response.freeze | 1 + ...n_filters_enabled_returns_OK_response.yaml | 41 +++++++++++ ...nse_with_cloud_run_revision_filters.freeze | 1 + ...ponse_with_cloud_run_revision_filters.yaml | 63 +++++++++++++++++ .../features/v1/gcp_integration.feature | 16 +++-- .../features/v2/gcp_integration.feature | 27 ++++++-- 19 files changed, 457 insertions(+), 23 deletions(-) create mode 100644 examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go create mode 100644 examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go create mode 100644 examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go create mode 100644 tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.yaml diff --git a/.apigentools-info b/.apigentools-info index 8a6764c0849..92e7569dccb 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-14 10:50:03.602357", - "spec_repo_commit": "9348385b" + "regenerated": "2024-02-14 14:32:10.755184", + "spec_repo_commit": "ffc670cf" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-14 10:50:03.618501", - "spec_repo_commit": "9348385b" + "regenerated": "2024-02-14 14:32:10.770793", + "spec_repo_commit": "ffc670cf" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 99631ba18dc..6867fb920c2 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3207,6 +3207,18 @@ components: key.' example: https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL type: string + cloud_run_revision_filters: + description: 'Limit the Cloud Run revisions that are pulled into Datadog + by using tags. + + Only Cloud Run revision resources that apply to specified filters are + imported into Datadog.' + example: + - $KEY:$VALUE + items: + description: Cloud Run Filters + type: string + type: array errors: description: An array of errors. example: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3a7820429e6..e14f8cda3ec 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7388,6 +7388,18 @@ components: description: Your service account email address. example: datadog-service-account@test-project.iam.gserviceaccount.com type: string + cloud_run_revision_filters: + description: 'List of filters to limit the Cloud Run revisions that are + pulled into Datadog by using tags. + + Only Cloud Run revision resources that apply to specified filters are + imported into Datadog.' + example: + - $KEY:$VALUE + items: + description: Cloud Run Filters + type: string + type: array host_filters: description: Your Host Filters. items: diff --git a/api/datadogV1/model_gcp_account.go b/api/datadogV1/model_gcp_account.go index 9b941e37f00..25daa34fba8 100644 --- a/api/datadogV1/model_gcp_account.go +++ b/api/datadogV1/model_gcp_account.go @@ -23,6 +23,9 @@ type GCPAccount struct { // Should be `https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL` // where `$CLIENT_EMAIL` is the email found in your JSON service account key. ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"` + // Limit the Cloud Run revisions that are pulled into Datadog by using tags. + // Only Cloud Run revision resources that apply to specified filters are imported into Datadog. + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` // An array of errors. Errors []string `json:"errors,omitempty"` // Limit the GCE instances that are pulled into Datadog by using tags. @@ -238,6 +241,34 @@ func (o *GCPAccount) SetClientX509CertUrl(v string) { o.ClientX509CertUrl = &v } +// GetCloudRunRevisionFilters returns the CloudRunRevisionFilters field value if set, zero value otherwise. +func (o *GCPAccount) GetCloudRunRevisionFilters() []string { + if o == nil || o.CloudRunRevisionFilters == nil { + var ret []string + return ret + } + return o.CloudRunRevisionFilters +} + +// GetCloudRunRevisionFiltersOk returns a tuple with the CloudRunRevisionFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GCPAccount) GetCloudRunRevisionFiltersOk() (*[]string, bool) { + if o == nil || o.CloudRunRevisionFilters == nil { + return nil, false + } + return &o.CloudRunRevisionFilters, true +} + +// HasCloudRunRevisionFilters returns a boolean if a field has been set. +func (o *GCPAccount) HasCloudRunRevisionFilters() bool { + return o != nil && o.CloudRunRevisionFilters != nil +} + +// SetCloudRunRevisionFilters gets a reference to the given []string and assigns it to the CloudRunRevisionFilters field. +func (o *GCPAccount) SetCloudRunRevisionFilters(v []string) { + o.CloudRunRevisionFilters = v +} + // GetErrors returns the Errors field value if set, zero value otherwise. func (o *GCPAccount) GetErrors() []string { if o == nil || o.Errors == nil { @@ -542,6 +573,9 @@ func (o GCPAccount) MarshalJSON() ([]byte, error) { if o.ClientX509CertUrl != nil { toSerialize["client_x509_cert_url"] = o.ClientX509CertUrl } + if o.CloudRunRevisionFilters != nil { + toSerialize["cloud_run_revision_filters"] = o.CloudRunRevisionFilters + } if o.Errors != nil { toSerialize["errors"] = o.Errors } @@ -588,6 +622,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) { ClientEmail *string `json:"client_email,omitempty"` ClientId *string `json:"client_id,omitempty"` ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"` + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` Errors []string `json:"errors,omitempty"` HostFilters *string `json:"host_filters,omitempty"` IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"` @@ -604,7 +639,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth_provider_x509_cert_url", "auth_uri", "automute", "client_email", "client_id", "client_x509_cert_url", "errors", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "private_key", "private_key_id", "project_id", "resource_collection_enabled", "token_uri", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth_provider_x509_cert_url", "auth_uri", "automute", "client_email", "client_id", "client_x509_cert_url", "cloud_run_revision_filters", "errors", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "private_key", "private_key_id", "project_id", "resource_collection_enabled", "token_uri", "type"}) } else { return err } @@ -614,6 +649,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) { o.ClientEmail = all.ClientEmail o.ClientId = all.ClientId o.ClientX509CertUrl = all.ClientX509CertUrl + o.CloudRunRevisionFilters = all.CloudRunRevisionFilters o.Errors = all.Errors o.HostFilters = all.HostFilters o.IsCspmEnabled = all.IsCspmEnabled diff --git a/api/datadogV2/model_gcpsts_service_account_attributes.go b/api/datadogV2/model_gcpsts_service_account_attributes.go index adc7357b555..d24a4f5ff83 100644 --- a/api/datadogV2/model_gcpsts_service_account_attributes.go +++ b/api/datadogV2/model_gcpsts_service_account_attributes.go @@ -16,6 +16,9 @@ type GCPSTSServiceAccountAttributes struct { Automute *bool `json:"automute,omitempty"` // Your service account email address. ClientEmail *string `json:"client_email,omitempty"` + // List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. + // Only Cloud Run revision resources that apply to specified filters are imported into Datadog. + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` // Your Host Filters. HostFilters []string `json:"host_filters,omitempty"` // When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true. @@ -134,6 +137,34 @@ func (o *GCPSTSServiceAccountAttributes) SetClientEmail(v string) { o.ClientEmail = &v } +// GetCloudRunRevisionFilters returns the CloudRunRevisionFilters field value if set, zero value otherwise. +func (o *GCPSTSServiceAccountAttributes) GetCloudRunRevisionFilters() []string { + if o == nil || o.CloudRunRevisionFilters == nil { + var ret []string + return ret + } + return o.CloudRunRevisionFilters +} + +// GetCloudRunRevisionFiltersOk returns a tuple with the CloudRunRevisionFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GCPSTSServiceAccountAttributes) GetCloudRunRevisionFiltersOk() (*[]string, bool) { + if o == nil || o.CloudRunRevisionFilters == nil { + return nil, false + } + return &o.CloudRunRevisionFilters, true +} + +// HasCloudRunRevisionFilters returns a boolean if a field has been set. +func (o *GCPSTSServiceAccountAttributes) HasCloudRunRevisionFilters() bool { + return o != nil && o.CloudRunRevisionFilters != nil +} + +// SetCloudRunRevisionFilters gets a reference to the given []string and assigns it to the CloudRunRevisionFilters field. +func (o *GCPSTSServiceAccountAttributes) SetCloudRunRevisionFilters(v []string) { + o.CloudRunRevisionFilters = v +} + // GetHostFilters returns the HostFilters field value if set, zero value otherwise. func (o *GCPSTSServiceAccountAttributes) GetHostFilters() []string { if o == nil || o.HostFilters == nil { @@ -261,6 +292,9 @@ func (o GCPSTSServiceAccountAttributes) MarshalJSON() ([]byte, error) { if o.ClientEmail != nil { toSerialize["client_email"] = o.ClientEmail } + if o.CloudRunRevisionFilters != nil { + toSerialize["cloud_run_revision_filters"] = o.CloudRunRevisionFilters + } if o.HostFilters != nil { toSerialize["host_filters"] = o.HostFilters } @@ -286,6 +320,7 @@ func (o *GCPSTSServiceAccountAttributes) UnmarshalJSON(bytes []byte) (err error) AccountTags []string `json:"account_tags,omitempty"` Automute *bool `json:"automute,omitempty"` ClientEmail *string `json:"client_email,omitempty"` + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` HostFilters []string `json:"host_filters,omitempty"` IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"` IsSecurityCommandCenterEnabled *bool `json:"is_security_command_center_enabled,omitempty"` @@ -296,13 +331,14 @@ func (o *GCPSTSServiceAccountAttributes) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"account_tags", "automute", "client_email", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "resource_collection_enabled"}) + datadog.DeleteKeys(additionalProperties, &[]string{"account_tags", "automute", "client_email", "cloud_run_revision_filters", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "resource_collection_enabled"}) } else { return err } o.AccountTags = all.AccountTags o.Automute = all.Automute o.ClientEmail = all.ClientEmail + o.CloudRunRevisionFilters = all.CloudRunRevisionFilters o.HostFilters = all.HostFilters o.IsCspmEnabled = all.IsCspmEnabled o.IsSecurityCommandCenterEnabled = all.IsSecurityCommandCenterEnabled diff --git a/examples/v1/gcp-integration/CreateGCPIntegration.go b/examples/v1/gcp-integration/CreateGCPIntegration.go index fb22eb53e69..24d97410367 100644 --- a/examples/v1/gcp-integration/CreateGCPIntegration.go +++ b/examples/v1/gcp-integration/CreateGCPIntegration.go @@ -14,12 +14,15 @@ import ( func main() { body := datadogV1.GCPAccount{ - AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"), - AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"), - ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), - ClientId: datadog.PtrString("163662907116366290710"), - ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"), - HostFilters: datadog.PtrString("key:value,filter:example"), + AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"), + AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"), + ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), + ClientId: datadog.PtrString("163662907116366290710"), + ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"), + HostFilters: datadog.PtrString("key:value,filter:example"), + CloudRunRevisionFilters: []string{ + "dr:dre", + }, IsCspmEnabled: datadog.PtrBool(true), IsSecurityCommandCenterEnabled: datadog.PtrBool(true), PrivateKey: datadog.PtrString("private_key"), diff --git a/examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go b/examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go new file mode 100644 index 00000000000..a75447ba3bd --- /dev/null +++ b/examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go @@ -0,0 +1,48 @@ +// Update a GCP integration cloud run revision filters returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" +) + +func main() { + body := datadogV1.GCPAccount{ + AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"), + AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"), + ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), + ClientId: datadog.PtrString("163662907116366290710"), + ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"), + HostFilters: datadog.PtrString("key:value,filter:example"), + CloudRunRevisionFilters: []string{ + "merp:derp", + }, + IsCspmEnabled: datadog.PtrBool(true), + IsSecurityCommandCenterEnabled: datadog.PtrBool(true), + PrivateKey: datadog.PtrString("private_key"), + PrivateKeyId: datadog.PtrString("123456789abcdefghi123456789abcdefghijklm"), + ProjectId: datadog.PtrString("datadog-apitest"), + ResourceCollectionEnabled: datadog.PtrBool(true), + TokenUri: datadog.PtrString("https://accounts.google.com/o/oauth2/token"), + Type: datadog.PtrString("service_account"), + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV1.NewGCPIntegrationApi(apiClient) + resp, r, err := api.UpdateGCPIntegration(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPIntegration`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPIntegration`:\n%s\n", responseContent) +} diff --git a/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go b/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go new file mode 100644 index 00000000000..f376f43c287 --- /dev/null +++ b/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go @@ -0,0 +1,41 @@ +// Create a new entry for your service account with cloud run revision filters enabled returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.GCPSTSServiceAccountCreateRequest{ + Data: &datadogV2.GCPSTSServiceAccountData{ + Attributes: &datadogV2.GCPSTSServiceAccountAttributes{ + CloudRunRevisionFilters: []string{ + "meh:bleh", + }, + ClientEmail: datadog.PtrString("252bf553ef04b351@test-project.iam.gserviceaccount.com"), + HostFilters: []string{}, + }, + Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewGCPIntegrationApi(apiClient) + resp, r, err := api.CreateGCPSTSAccount(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.CreateGCPSTSAccount`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.CreateGCPSTSAccount`:\n%s\n", responseContent) +} diff --git a/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go b/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go new file mode 100644 index 00000000000..bcfcb18cb74 --- /dev/null +++ b/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go @@ -0,0 +1,44 @@ +// Update STS Service Account returns "OK" response with cloud run revision filters + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "gcp_sts_account" in the system + GcpStsAccountDataID := os.Getenv("GCP_STS_ACCOUNT_DATA_ID") + + body := datadogV2.GCPSTSServiceAccountUpdateRequest{ + Data: &datadogV2.GCPSTSServiceAccountUpdateRequestData{ + Attributes: &datadogV2.GCPSTSServiceAccountAttributes{ + ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), + CloudRunRevisionFilters: []string{ + "merp:derp", + }, + }, + Id: datadog.PtrString(GcpStsAccountDataID), + Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewGCPIntegrationApi(apiClient) + resp, r, err := api.UpdateGCPSTSAccount(ctx, GcpStsAccountDataID, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPSTSAccount`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPSTSAccount`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze index 3677f3cb1d1..3898833e13c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze @@ -1 +1 @@ -2023-12-20T13:18:07.717Z \ No newline at end of file +2024-01-31T21:16:03.254Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml index 612f2d25ec9..deaa8e381ec 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"e5bbc86fb86ab202@example.com","client_id":"170307828717030782870","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"3af93b0f1c973838@example.com","client_id":"170673576317067357630","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","cloud_run_revision_filters":["dr:dre"],"host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} form: {} headers: Accept: @@ -23,7 +23,7 @@ interactions: status: 200 OK - request: body: | - {"client_email":"e5bbc86fb86ab202@example.com","client_id":"170307828717030782870","project_id":"datadog-apitest"} + {"client_email":"3af93b0f1c973838@example.com","client_id":"170673576317067357630","project_id":"datadog-apitest"} form: {} headers: Accept: diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze new file mode 100644 index 00000000000..6f951f6ba55 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-01-31T21:16:03.829Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.yaml new file mode 100644 index 00000000000..28d936b7cf0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.yaml @@ -0,0 +1,68 @@ +interactions: +- request: + body: | + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"edcdf6542ac6e6b6@example.com","client_id":"170673576317067357630","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v1/integration/gcp + response: + body: '{} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: | + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"edcdf6542ac6e6b6@example.com","client_id":"170673576317067357630","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","cloud_run_revision_filters":["merp:derp"],"host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: PUT + url: https://api.datadoghq.com/api/v1/integration/gcp + response: + body: '{} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: | + {"client_email":"edcdf6542ac6e6b6@example.com","client_id":"170673576317067357630","project_id":"datadog-apitest"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v1/integration/gcp + response: + body: '{} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.freeze new file mode 100644 index 00000000000..5078f78fe6d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-01-31T21:16:04.924Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.yaml new file mode 100644 index 00000000000..ef851ad9670 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"client_email":"feb37f50ee7be467@test-project.iam.gserviceaccount.com","cloud_run_revision_filters":["meh:bleh"],"host_filters":[]},"type":"gcp_service_account"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts + response: + body: '{"data":{"type":"gcp_service_account","attributes":{"cloud_run_revision_filters":["meh:bleh"],"resource_collection_enabled":false,"host_filters":[],"automute":false,"is_cspm_enabled":false,"account_tags":[],"client_email":"feb37f50ee7be467@test-project.iam.gserviceaccount.com","is_security_command_center_enabled":false},"id":"e1157377-8d5c-4a94-9730-10c3fa9d6ff5"}} + + ' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts/e1157377-8d5c-4a94-9730-10c3fa9d6ff5 + response: + body: '' + code: 204 + duration: 0ms + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.freeze new file mode 100644 index 00000000000..92757ea39aa --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.freeze @@ -0,0 +1 @@ +2024-01-31T21:16:05.705Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.yaml new file mode 100644 index 00000000000..ea3561eeef3 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.yaml @@ -0,0 +1,63 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"client_email":"a8e08a7fa29a1adb@example.com","host_filters":[]},"type":"gcp_service_account"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts + response: + body: '{"data":{"type":"gcp_service_account","id":"3e6ad31b-2da5-4ad4-878a-4d290520173b","attributes":{"account_tags":[],"resource_collection_enabled":false,"is_cspm_enabled":false,"automute":false,"host_filters":[],"is_security_command_center_enabled":false,"cloud_run_revision_filters":[],"client_email":"a8e08a7fa29a1adb@example.com"}}} + + ' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"client_email":"a8e08a7fa29a1adb@example.com","cloud_run_revision_filters":["merp:derp"]},"id":"3e6ad31b-2da5-4ad4-878a-4d290520173b","type":"gcp_service_account"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts/3e6ad31b-2da5-4ad4-878a-4d290520173b + response: + body: '{"data":{"type":"gcp_service_account","id":"3e6ad31b-2da5-4ad4-878a-4d290520173b","attributes":{"cloud_run_revision_filters":["merp:derp"],"host_filters":[],"automute":false,"is_security_command_center_enabled":false,"account_tags":[],"client_email":"a8e08a7fa29a1adb@example.com","is_cspm_enabled":false,"resource_collection_enabled":false}}} + + ' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts/3e6ad31b-2da5-4ad4-878a-4d290520173b + response: + body: '' + code: 204 + duration: 0ms + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +version: 2 diff --git a/tests/scenarios/features/v1/gcp_integration.feature b/tests/scenarios/features/v1/gcp_integration.feature index cc078be2f03..2b656ab2023 100644 --- a/tests/scenarios/features/v1/gcp_integration.feature +++ b/tests/scenarios/features/v1/gcp_integration.feature @@ -13,21 +13,21 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a GCP integration returns "Bad Request" response Given new "CreateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request @team:DataDog/gcp-integrations Scenario: Create a GCP integration returns "OK" response Given new "CreateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "{{unique_hash}}@example.com", "client_id": "{{ timestamp("now") }}{{ timestamp("now") }}0", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "{{unique_hash}}@example.com", "client_id": "{{ timestamp("now") }}{{ timestamp("now") }}0", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "cloud_run_revision_filters": ["dr:dre"], "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/gcp-integrations Scenario: Delete a GCP integration returns "Bad Request" response Given new "DeleteGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request @@ -51,10 +51,18 @@ Feature: GCP Integration When the request is sent Then the response status is 200 OK + @team:DataDog/gcp-integrations + Scenario: Update a GCP integration cloud run revision filters returns "OK" response + Given there is a valid "gcp_account" in the system + And new "UpdateGCPIntegration" request + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "{{unique_hash}}@example.com", "client_id": "{{ timestamp("now") }}{{ timestamp("now") }}0", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "cloud_run_revision_filters": ["merp:derp"], "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/gcp-integrations Scenario: Update a GCP integration returns "Bad Request" response Given new "UpdateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request diff --git a/tests/scenarios/features/v2/gcp_integration.feature b/tests/scenarios/features/v2/gcp_integration.feature index e18714ba2e8..6085d6ed2f8 100644 --- a/tests/scenarios/features/v2/gcp_integration.feature +++ b/tests/scenarios/features/v2/gcp_integration.feature @@ -34,14 +34,14 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Bad Request" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Conflict" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} When the request is sent Then the response status is 409 Conflict @@ -64,6 +64,16 @@ Feature: GCP Integration And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com" And the response "data.attributes.account_tags" is equal to ["lorem", "ipsum"] + @team:DataDog/gcp-integrations + Scenario: Create a new entry for your service account with cloud run revision filters enabled returns "OK" response + Given new "CreateGCPSTSAccount" request + And body with value {"data": {"attributes": {"cloud_run_revision_filters": ["meh:bleh"], "client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}} + When the request is sent + Then the response status is 201 OK + And the response "data.type" is equal to "gcp_service_account" + And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com" + And the response "data.attributes.cloud_run_revision_filters" is equal to ["meh:bleh"] + @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account with cspm enabled returns "OK" response Given new "CreateGCPSTSAccount" request @@ -140,7 +150,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Bad Request" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @@ -148,7 +158,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Not Found" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 404 Not Found @@ -161,6 +171,15 @@ Feature: GCP Integration When the request is sent Then the response status is 201 OK + @team:DataDog/gcp-integrations + Scenario: Update STS Service Account returns "OK" response with cloud run revision filters + Given there is a valid "gcp_sts_account" in the system + And new "UpdateGCPSTSAccount" request + And request contains "account_id" parameter from "gcp_sts_account.data.id" + And body with value {"data": {"attributes": {"client_email": "{{ unique_hash }}@example.com", "cloud_run_revision_filters": ["merp:derp"]}, "id": "{{ gcp_sts_account.data.id }}", "type": "gcp_service_account"}} + When the request is sent + Then the response status is 201 OK + @team:DataDog/gcp-integrations Scenario: Update STS Service Account returns "OK" response with enable resource collection turned on Given there is a valid "gcp_sts_account" in the system