diff --git a/.apigentools-info b/.apigentools-info index 886b5c3fda..b3213016f9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-12-14 19:38:24.188378", - "spec_repo_commit": "cdc82e06" + "regenerated": "2023-12-15 17:29:36.806700", + "spec_repo_commit": "0285f23a" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-12-14 19:38:24.201899", - "spec_repo_commit": "cdc82e06" + "regenerated": "2023-12-15 17:29:36.827320", + "spec_repo_commit": "0285f23a" } } } \ No newline at end of file diff --git a/.generator/conftest.py b/.generator/conftest.py index bdb8f8b43c..7cae6b12c8 100644 --- a/.generator/conftest.py +++ b/.generator/conftest.py @@ -183,7 +183,6 @@ def unique(request): }, } - def relative_time(imports, calls, freezed_time, iso): time_re = re.compile(r"now( *([+-]) *(\d+)([smhdMy]))?") @@ -229,7 +228,6 @@ def store_calls(arg): return store_calls - @pytest.fixture def context(request, unique, freezed_time): """ @@ -266,6 +264,7 @@ def is_used(self, key): "unique_hash": unique_hash, "timestamp": relative_time(imports, replace_values, freezed_time, False), "timeISO": relative_time(imports, replace_values, freezed_time, True), + "uuid": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "_replace_values": replace_values, "_imports": imports, "_given": given, diff --git a/examples/v1/azure-integration/CreateAzureIntegration.py b/examples/v1/azure-integration/CreateAzureIntegration.py index 818ebe51e7..c13d360697 100644 --- a/examples/v1/azure-integration/CreateAzureIntegration.py +++ b/examples/v1/azure-integration/CreateAzureIntegration.py @@ -9,7 +9,7 @@ body = AzureAccount( app_service_plan_filters="key:value,filter:example", automute=True, - client_id="testc7f6-1234-5678-9101-3fcbf464test", + client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", client_secret="testingx./Sw*g/Y33t..R1cH+hScMDt", container_app_filters="key:value,filter:example", cspm_enabled=True, @@ -18,10 +18,10 @@ "*", ], host_filters="key:value,filter:example", - new_client_id="new1c7f6-1234-5678-9101-3fcbf464test", - new_tenant_name="new1c44-1234-5678-9101-cc00736ftest", + new_client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", + new_tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", resource_collection_enabled=True, - tenant_name="testc44-1234-5678-9101-cc00736ftest", + tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", ) configuration = Configuration() diff --git a/examples/v1/azure-integration/DeleteAzureIntegration.py b/examples/v1/azure-integration/DeleteAzureIntegration.py index 2388bef812..b6ecb7dae3 100644 --- a/examples/v1/azure-integration/DeleteAzureIntegration.py +++ b/examples/v1/azure-integration/DeleteAzureIntegration.py @@ -9,7 +9,7 @@ body = AzureAccount( app_service_plan_filters="key:value,filter:example", automute=True, - client_id="testc7f6-1234-5678-9101-3fcbf464test", + client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", client_secret="testingx./Sw*g/Y33t..R1cH+hScMDt", container_app_filters="key:value,filter:example", cspm_enabled=True, @@ -18,10 +18,10 @@ "*", ], host_filters="key:value,filter:example", - new_client_id="new1c7f6-1234-5678-9101-3fcbf464test", - new_tenant_name="new1c44-1234-5678-9101-cc00736ftest", + new_client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", + new_tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", resource_collection_enabled=True, - tenant_name="testc44-1234-5678-9101-cc00736ftest", + tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", ) configuration = Configuration() diff --git a/examples/v1/azure-integration/UpdateAzureIntegration.py b/examples/v1/azure-integration/UpdateAzureIntegration.py index 095e4a84f3..7c4eeb6c54 100644 --- a/examples/v1/azure-integration/UpdateAzureIntegration.py +++ b/examples/v1/azure-integration/UpdateAzureIntegration.py @@ -9,7 +9,7 @@ body = AzureAccount( app_service_plan_filters="key:value,filter:example", automute=True, - client_id="testc7f6-1234-5678-9101-3fcbf464test", + client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", client_secret="testingx./Sw*g/Y33t..R1cH+hScMDt", container_app_filters="key:value,filter:example", cspm_enabled=True, @@ -18,10 +18,10 @@ "*", ], host_filters="key:value,filter:example", - new_client_id="new1c7f6-1234-5678-9101-3fcbf464test", - new_tenant_name="new1c44-1234-5678-9101-cc00736ftest", + new_client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", + new_tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", resource_collection_enabled=True, - tenant_name="testc44-1234-5678-9101-cc00736ftest", + tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", ) configuration = Configuration() diff --git a/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.py b/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.py index 8c5e3c1938..579ff666cd 100644 --- a/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.py +++ b/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.py @@ -13,6 +13,7 @@ data=GCPSTSServiceAccountData( attributes=GCPSTSServiceAccountAttributes( is_cspm_enabled=True, + resource_collection_enabled=True, client_email="252bf553ef04b351@test-project.iam.gserviceaccount.com", host_filters=[], ), diff --git a/tests/conftest.py b/tests/conftest.py index fea83e5d61..56538f330b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -191,6 +191,11 @@ def func(arg): return func +def generate_uuid(freezed_time): + freezed_time_string = str(freezed_time.timestamp()) + return freezed_time_string[:8] + "-0000-0000-0000-" + freezed_time_string[:10] + "00" + + @pytest.fixture def context(vcr, unique, freezed_time): """ @@ -209,6 +214,7 @@ def context(vcr, unique, freezed_time): "unique_hash": unique_hash, "timestamp": relative_time(freezed_time, False), "timeISO": relative_time(freezed_time, True), + "uuid": generate_uuid(freezed_time), } yield ctx diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_azure_integration_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_create_an_azure_integration_returns_ok_response.frozen new file mode 100644 index 0000000000..53e28018d7 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_an_azure_integration_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-08T15:34:43.210Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_azure_integration_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_create_an_azure_integration_returns_ok_response.yaml new file mode 100644 index 0000000000..123a9d28b3 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_an_azure_integration_returns_ok_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17020496-0000-0000-0000-170204968300","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17020496-0000-0000-0000-170204968300","new_tenant_name":"17020496-0000-0000-0000-170204968300","resource_collection_enabled":true,"tenant_name":"17020496-0000-0000-0000-170204968300"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17020496-0000-0000-0000-170204968300","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17020496-0000-0000-0000-170204968300","new_tenant_name":"17020496-0000-0000-0000-170204968300","resource_collection_enabled":true,"tenant_name":"17020496-0000-0000-0000-170204968300"}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen new file mode 100644 index 0000000000..23156fb06d --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-15T17:19:40.609Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml new file mode 100644 index 0000000000..d2af91c870 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17026607-0000-0000-0000-170266078000","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17026607-0000-0000-0000-170266078000","new_tenant_name":"17026607-0000-0000-0000-170266078000","resource_collection_enabled":true,"tenant_name":"17026607-0000-0000-0000-170266078000"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17026607-0000-0000-0000-170266078000","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17026607-0000-0000-0000-170266078000","new_tenant_name":"17026607-0000-0000-0000-170266078000","resource_collection_enabled":true,"tenant_name":"17026607-0000-0000-0000-170266078000"}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17026607-0000-0000-0000-170266078000","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17026607-0000-0000-0000-170266078000","new_tenant_name":"17026607-0000-0000-0000-170266078000","resource_collection_enabled":true,"tenant_name":"17026607-0000-0000-0000-170266078000"}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen new file mode 100644 index 0000000000..0b2d8e850e --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen @@ -0,0 +1 @@ +2023-12-15T17:19:43.390Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml new file mode 100644 index 0000000000..25d70314df --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17026607-0000-0000-0000-170266078300","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17026607-0000-0000-0000-170266078300","new_tenant_name":"17026607-0000-0000-0000-170266078300","resource_collection_enabled":true,"tenant_name":"17026607-0000-0000-0000-170266078300"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17026607-0000-0000-0000-170266078300","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17026607-0000-0000-0000-170266078300","new_tenant_name":"17026607-0000-0000-0000-170266078300","resource_collection_enabled":true,"tenant_name":"17026607-0000-0000-0000-170266078300"}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17026607-0000-0000-0000-170266078300","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17026607-0000-0000-0000-170266078300","new_tenant_name":"17026607-0000-0000-0000-170266078300","resource_collection_enabled":true,"tenant_name":"17026607-0000-0000-0000-170266078300"}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/integration/azure + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/features/azure_integration.feature b/tests/v1/features/azure_integration.feature index de79d3fb3f..d312058e95 100644 --- a/tests/v1/features/azure_integration.feature +++ b/tests/v1/features/azure_integration.feature @@ -16,10 +16,10 @@ Feature: Azure Integration When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/azure-integrations + @team:DataDog/azure-integrations Scenario: Create an Azure integration returns "OK" response Given new "CreateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "tenant_name": "{{ uuid }}"} When the request is sent Then the response status is 200 OK @@ -30,10 +30,11 @@ Feature: Azure Integration When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/azure-integrations + @team:DataDog/azure-integrations Scenario: Delete an Azure integration returns "OK" response - Given new "DeleteAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + Given there is a valid "azure_account" in the system + And new "DeleteAzureIntegration" request + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "tenant_name": "{{ uuid }}"} When the request is sent Then the response status is 200 OK @@ -70,9 +71,10 @@ Feature: Azure Integration When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/azure-integrations + @team:DataDog/azure-integrations Scenario: Update an Azure integration returns "OK" response - Given new "UpdateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + Given there is a valid "azure_account" in the system + And new "UpdateAzureIntegration" request + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "tenant_name": "{{ uuid }}"} When the request is sent Then the response status is 200 OK diff --git a/tests/v1/features/given.json b/tests/v1/features/given.json index 02854bcd67..ec3069d70c 100644 --- a/tests/v1/features/given.json +++ b/tests/v1/features/given.json @@ -112,6 +112,19 @@ "tag": "AWS Integration", "operationId": "CreateAWSAccount" }, + { + "parameters": [ + { + "name": "body", + "origin": "request", + "value": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{ uuid }}\",\n \"client_secret\": \"testingx./Sw*g/Y33t..R1cH+hScMDt\",\n \"container_app_filters\": \"key:value,filter:example\",\n \"cspm_enabled\": true,\n \"custom_metrics_enabled\": true,\n \"errors\": [\"*\"],\n \"host_filters\": \"key:value,filter:example\",\n \"new_client_id\": \"{{ uuid }}\",\n \"new_tenant_name\": \"{{ uuid }}\",\n \"resource_collection_enabled\": true,\n \"tenant_name\": \"{{ uuid }}\"\n}" + } + ], + "step": "there is a valid \"azure_account\" in the system", + "key": "aws_account", + "tag": "Azure Integration", + "operationId": "CreateAzureIntegration" + }, { "parameters": [ { diff --git a/tests/v1/features/undo.json b/tests/v1/features/undo.json index 4858b63e3c..35f8b8ae40 100644 --- a/tests/v1/features/undo.json +++ b/tests/v1/features/undo.json @@ -485,7 +485,13 @@ "tag": "Azure Integration", "undo": { "operationId": "DeleteAzureIntegration", - "parameters": [], + "parameters": [ + { + "name": "body", + "origin": "request", + "template": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{client_id}}\",\n \"client_secret\": \"testingx./Sw*g/Y33t..R1cH+hScMDt\",\n \"container_app_filters\": \"key:value,filter:example\",\n \"cspm_enabled\": true,\n \"custom_metrics_enabled\": true,\n \"errors\": [\"*\"],\n \"host_filters\": \"key:value,filter:example\",\n \"new_client_id\": \"{{new_client_id}}\",\n \"new_tenant_name\": \"{{new_tenant_name}}\",\n \"resource_collection_enabled\": true,\n \"tenant_name\": \"{{tenant_name}}\"\n}" + } + ], "type": "unsafe" } }, diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.frozen index 4c8e03a1d9..007c9de4a0 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.frozen @@ -1 +1 @@ -2023-12-13T21:29:09.202Z \ No newline at end of file +2023-12-15T08:45:38.020Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.yaml index 30319103a1..d323d1e3bd 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_with_cspm_enabled_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"client_email":"dfb9f119aee90526@test-project.iam.gserviceaccount.com","host_filters":[],"is_cspm_enabled":true},"type":"gcp_service_account"}}' + body: '{"data":{"attributes":{"client_email":"9f53cbf93a21704b@test-project.iam.gserviceaccount.com","host_filters":[],"is_cspm_enabled":true,"resource_collection_enabled":true},"type":"gcp_service_account"}}' headers: accept: - application/json @@ -10,7 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts response: body: - string: '{"data":{"type":"gcp_service_account","attributes":{"is_security_command_center_enabled":false,"resource_collection_enabled":true,"is_cspm_enabled":true,"client_email":"dfb9f119aee90526@test-project.iam.gserviceaccount.com","account_tags":[],"automute":false,"host_filters":[]},"id":"d2ef6458-62a4-4fbe-ad48-9429baa01867"}} + string: '{"data":{"type":"gcp_service_account","attributes":{"is_cspm_enabled":true,"account_tags":[],"host_filters":[],"resource_collection_enabled":true,"is_security_command_center_enabled":false,"client_email":"9f53cbf93a21704b@test-project.iam.gserviceaccount.com","automute":false},"id":"cf3c6e32-dad2-452e-8c09-f34c5f2211a1"}} ' headers: @@ -25,7 +25,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts/d2ef6458-62a4-4fbe-ad48-9429baa01867 + uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts/cf3c6e32-dad2-452e-8c09-f34c5f2211a1 response: body: string: '' diff --git a/tests/v2/features/gcp_integration.feature b/tests/v2/features/gcp_integration.feature index 5414ae350b..d4111a43e3 100644 --- a/tests/v2/features/gcp_integration.feature +++ b/tests/v2/features/gcp_integration.feature @@ -67,7 +67,7 @@ Feature: GCP Integration @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account with cspm enabled returns "OK" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"is_cspm_enabled": true, "client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"is_cspm_enabled": true, "resource_collection_enabled": true, "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"