From 81d88ff2cea93aeb70113b3651907c8544042f10 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 08:42:29 +0000 Subject: [PATCH] Cleanup service accounts tests (#2229) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .../CreateServiceAccountApplicationKey.go | 12 +-- ...ServiceAccountApplicationKey_1761876297.go | 40 -------- .../DeleteServiceAccountApplicationKey.go | 8 +- ...eServiceAccountApplicationKey_992091161.go | 31 ------- .../GetServiceAccountApplicationKey.go | 8 +- ...tServiceAccountApplicationKey_819075131.go | 35 ------- .../ListServiceAccountApplicationKeys.go | 5 +- ...erviceAccountApplicationKeys_1268914341.go | 32 ------- .../UpdateServiceAccountApplicationKey.go | 19 ++-- ...eServiceAccountApplicationKey_768415790.go | 44 --------- ...ce_account_returns_Created_response.freeze | 1 - ...vice_account_returns_Created_response.yaml | 69 -------------- ...ce_account_returns_Created_response.freeze | 1 + ...vice_account_returns_Created_response.yaml | 73 +++++++++++++++ ...account_returns_No_Content_response.freeze | 1 - ...e_account_returns_No_Content_response.yaml | 85 ----------------- ...account_returns_No_Content_response.freeze | 1 + ...e_account_returns_No_Content_response.yaml | 89 ++++++++++++++++++ ...service_account_returns_OK_response.freeze | 1 - ...s_service_account_returns_OK_response.yaml | 88 ------------------ ...service_account_returns_OK_response.freeze | 1 + ...s_service_account_returns_OK_response.yaml | 92 +++++++++++++++++++ ...service_account_returns_OK_response.freeze | 1 - ...service_account_returns_OK_response.freeze | 1 - ...s_service_account_returns_OK_response.yaml | 85 ----------------- ...service_account_returns_OK_response.freeze | 1 + ...s_service_account_returns_OK_response.yaml | 89 ++++++++++++++++++ ...service_account_returns_OK_response.freeze | 1 + ..._service_account_returns_OK_response.yaml} | 14 +-- .../features/v2/service_accounts.feature | 92 ++++++------------- 31 files changed, 419 insertions(+), 609 deletions(-) delete mode 100644 examples/v2/service-accounts/CreateServiceAccountApplicationKey_1761876297.go delete mode 100644 examples/v2/service-accounts/DeleteServiceAccountApplicationKey_992091161.go delete mode 100644 examples/v2/service-accounts/GetServiceAccountApplicationKey_819075131.go delete mode 100644 examples/v2/service-accounts/ListServiceAccountApplicationKeys_1268914341.go delete mode 100644 examples/v2/service-accounts/UpdateServiceAccountApplicationKey_768415790.go delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_application_keys_for_this_service_account_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/{Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.yaml => Scenario_List_application_keys_for_this_service_account_returns_OK_response.yaml} (53%) diff --git a/.apigentools-info b/.apigentools-info index 5e104116cc0..f72849f0c56 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-12 21:14:55.820882", - "spec_repo_commit": "d4c17bf0" + "regenerated": "2023-10-13 08:13:45.929351", + "spec_repo_commit": "30a99088" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-12 21:14:55.840828", - "spec_repo_commit": "d4c17bf0" + "regenerated": "2023-10-13 08:13:45.964694", + "spec_repo_commit": "30a99088" } } } \ No newline at end of file diff --git a/examples/v2/service-accounts/CreateServiceAccountApplicationKey.go b/examples/v2/service-accounts/CreateServiceAccountApplicationKey.go index 6ea0f0978d1..635f982be9c 100644 --- a/examples/v2/service-accounts/CreateServiceAccountApplicationKey.go +++ b/examples/v2/service-accounts/CreateServiceAccountApplicationKey.go @@ -13,15 +13,13 @@ import ( ) func main() { + // there is a valid "service_account_user" in the system + ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") + body := datadogV2.ApplicationKeyCreateRequest{ Data: datadogV2.ApplicationKeyCreateData{ Attributes: datadogV2.ApplicationKeyCreateAttributes{ - Name: "Application Key for managing dashboards", - Scopes: *datadog.NewNullableList(&[]string{ - "dashboards_read", - "dashboards_write", - "dashboards_public_share", - }), + Name: "Example-Service-Account", }, Type: datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS, }, @@ -30,7 +28,7 @@ func main() { configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.CreateServiceAccountApplicationKey(ctx, "00000000-0000-1234-0000-000000000000", body) + resp, r, err := api.CreateServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, body) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateServiceAccountApplicationKey`: %v\n", err) diff --git a/examples/v2/service-accounts/CreateServiceAccountApplicationKey_1761876297.go b/examples/v2/service-accounts/CreateServiceAccountApplicationKey_1761876297.go deleted file mode 100644 index 574ab935b7f..00000000000 --- a/examples/v2/service-accounts/CreateServiceAccountApplicationKey_1761876297.go +++ /dev/null @@ -1,40 +0,0 @@ -// Create an app key for this service account returns "Created" 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() { - // there is a valid "service_account_user" in the system - ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") - - body := datadogV2.ApplicationKeyCreateRequest{ - Data: datadogV2.ApplicationKeyCreateData{ - Attributes: datadogV2.ApplicationKeyCreateAttributes{ - Name: "Example-Service-Account", - }, - Type: datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS, - }, - } - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.CreateServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, body) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateServiceAccountApplicationKey`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.CreateServiceAccountApplicationKey`:\n%s\n", responseContent) -} diff --git a/examples/v2/service-accounts/DeleteServiceAccountApplicationKey.go b/examples/v2/service-accounts/DeleteServiceAccountApplicationKey.go index f815214a2ae..c36ad718dbb 100644 --- a/examples/v2/service-accounts/DeleteServiceAccountApplicationKey.go +++ b/examples/v2/service-accounts/DeleteServiceAccountApplicationKey.go @@ -12,11 +12,17 @@ import ( ) func main() { + // there is a valid "service_account_user" in the system + ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") + + // there is a valid "service_account_application_key" for "service_account_user" + ServiceAccountApplicationKeyDataID := os.Getenv("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID") + ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewServiceAccountsApi(apiClient) - r, err := api.DeleteServiceAccountApplicationKey(ctx, "00000000-0000-1234-0000-000000000000", "app_key_id") + r, err := api.DeleteServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, ServiceAccountApplicationKeyDataID) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteServiceAccountApplicationKey`: %v\n", err) diff --git a/examples/v2/service-accounts/DeleteServiceAccountApplicationKey_992091161.go b/examples/v2/service-accounts/DeleteServiceAccountApplicationKey_992091161.go deleted file mode 100644 index cc1ad7af823..00000000000 --- a/examples/v2/service-accounts/DeleteServiceAccountApplicationKey_992091161.go +++ /dev/null @@ -1,31 +0,0 @@ -// Delete an app key owned by this service account returns "No Content" response - -package main - -import ( - "context" - "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 "service_account_user" in the system - ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") - - // there is a valid "service_account_application_key" for "service_account_user" - ServiceAccountApplicationKeyDataID := os.Getenv("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID") - - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewServiceAccountsApi(apiClient) - r, err := api.DeleteServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, ServiceAccountApplicationKeyDataID) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteServiceAccountApplicationKey`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} diff --git a/examples/v2/service-accounts/GetServiceAccountApplicationKey.go b/examples/v2/service-accounts/GetServiceAccountApplicationKey.go index 955f412e6c1..3f3c05d0623 100644 --- a/examples/v2/service-accounts/GetServiceAccountApplicationKey.go +++ b/examples/v2/service-accounts/GetServiceAccountApplicationKey.go @@ -13,11 +13,17 @@ import ( ) func main() { + // there is a valid "service_account_user" in the system + ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") + + // there is a valid "service_account_application_key" for "service_account_user" + ServiceAccountApplicationKeyDataID := os.Getenv("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID") + ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.GetServiceAccountApplicationKey(ctx, "00000000-0000-1234-0000-000000000000", "app_key_id") + resp, r, err := api.GetServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, ServiceAccountApplicationKeyDataID) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.GetServiceAccountApplicationKey`: %v\n", err) diff --git a/examples/v2/service-accounts/GetServiceAccountApplicationKey_819075131.go b/examples/v2/service-accounts/GetServiceAccountApplicationKey_819075131.go deleted file mode 100644 index 318695ffb28..00000000000 --- a/examples/v2/service-accounts/GetServiceAccountApplicationKey_819075131.go +++ /dev/null @@ -1,35 +0,0 @@ -// Get one app key owned by this service account 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() { - // there is a valid "service_account_user" in the system - ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") - - // there is a valid "service_account_application_key" for "service_account_user" - ServiceAccountApplicationKeyDataID := os.Getenv("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID") - - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.GetServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, ServiceAccountApplicationKeyDataID) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.GetServiceAccountApplicationKey`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.GetServiceAccountApplicationKey`:\n%s\n", responseContent) -} diff --git a/examples/v2/service-accounts/ListServiceAccountApplicationKeys.go b/examples/v2/service-accounts/ListServiceAccountApplicationKeys.go index 8d2d8538b87..e961df79030 100644 --- a/examples/v2/service-accounts/ListServiceAccountApplicationKeys.go +++ b/examples/v2/service-accounts/ListServiceAccountApplicationKeys.go @@ -13,11 +13,14 @@ import ( ) func main() { + // there is a valid "service_account_user" in the system + ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") + ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.ListServiceAccountApplicationKeys(ctx, "00000000-0000-1234-0000-000000000000", *datadogV2.NewListServiceAccountApplicationKeysOptionalParameters()) + resp, r, err := api.ListServiceAccountApplicationKeys(ctx, ServiceAccountUserDataID, *datadogV2.NewListServiceAccountApplicationKeysOptionalParameters()) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.ListServiceAccountApplicationKeys`: %v\n", err) diff --git a/examples/v2/service-accounts/ListServiceAccountApplicationKeys_1268914341.go b/examples/v2/service-accounts/ListServiceAccountApplicationKeys_1268914341.go deleted file mode 100644 index ba67f7a6162..00000000000 --- a/examples/v2/service-accounts/ListServiceAccountApplicationKeys_1268914341.go +++ /dev/null @@ -1,32 +0,0 @@ -// Get all app keys owned by this service account 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() { - // there is a valid "service_account_user" in the system - ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") - - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.ListServiceAccountApplicationKeys(ctx, ServiceAccountUserDataID, *datadogV2.NewListServiceAccountApplicationKeysOptionalParameters()) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.ListServiceAccountApplicationKeys`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.ListServiceAccountApplicationKeys`:\n%s\n", responseContent) -} diff --git a/examples/v2/service-accounts/UpdateServiceAccountApplicationKey.go b/examples/v2/service-accounts/UpdateServiceAccountApplicationKey.go index a57959a1527..0c99ed735ff 100644 --- a/examples/v2/service-accounts/UpdateServiceAccountApplicationKey.go +++ b/examples/v2/service-accounts/UpdateServiceAccountApplicationKey.go @@ -13,25 +13,26 @@ import ( ) func main() { + // there is a valid "service_account_user" in the system + ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") + + // there is a valid "service_account_application_key" for "service_account_user" + ServiceAccountApplicationKeyDataID := os.Getenv("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID") + body := datadogV2.ApplicationKeyUpdateRequest{ Data: datadogV2.ApplicationKeyUpdateData{ + Id: ServiceAccountApplicationKeyDataID, + Type: datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS, Attributes: datadogV2.ApplicationKeyUpdateAttributes{ - Name: datadog.PtrString("Application Key for managing dashboards"), - Scopes: *datadog.NewNullableList(&[]string{ - "dashboards_read", - "dashboards_write", - "dashboards_public_share", - }), + Name: datadog.PtrString("Application Key for managing dashboards-updated"), }, - Id: "00112233-4455-6677-8899-aabbccddeeff", - Type: datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.UpdateServiceAccountApplicationKey(ctx, "00000000-0000-1234-0000-000000000000", "app_key_id", body) + resp, r, err := api.UpdateServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, ServiceAccountApplicationKeyDataID, body) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.UpdateServiceAccountApplicationKey`: %v\n", err) diff --git a/examples/v2/service-accounts/UpdateServiceAccountApplicationKey_768415790.go b/examples/v2/service-accounts/UpdateServiceAccountApplicationKey_768415790.go deleted file mode 100644 index 142c79ad38f..00000000000 --- a/examples/v2/service-accounts/UpdateServiceAccountApplicationKey_768415790.go +++ /dev/null @@ -1,44 +0,0 @@ -// Edit an app key owned by this service account 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() { - // there is a valid "service_account_user" in the system - ServiceAccountUserDataID := os.Getenv("SERVICE_ACCOUNT_USER_DATA_ID") - - // there is a valid "service_account_application_key" for "service_account_user" - ServiceAccountApplicationKeyDataID := os.Getenv("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID") - - body := datadogV2.ApplicationKeyUpdateRequest{ - Data: datadogV2.ApplicationKeyUpdateData{ - Id: ServiceAccountApplicationKeyDataID, - Type: datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS, - Attributes: datadogV2.ApplicationKeyUpdateAttributes{ - Name: datadog.PtrString("Application Key for managing dashboards-updated"), - }, - }, - } - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewServiceAccountsApi(apiClient) - resp, r, err := api.UpdateServiceAccountApplicationKey(ctx, ServiceAccountUserDataID, ServiceAccountApplicationKeyDataID, body) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.UpdateServiceAccountApplicationKey`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.UpdateServiceAccountApplicationKey`:\n%s\n", responseContent) -} diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.freeze deleted file mode 100644 index c1624deab3c..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:53:18.580Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.yaml deleted file mode 100644 index 365e451bbc7..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_app_key_for_this_service_account_returns_Created_response.yaml +++ /dev/null @@ -1,69 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"email":"Test-Create_an_app_key_for_this_service_account_returns_Created_response-1652349198@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts - response: - body: '{"data":{"type":"users","id":"07af9197-7ca2-4330-8ee5-fe49e050d294","attributes":{"name":null,"handle":"07af9197-7ca2-4330-8ee5-fe49e050d294","created_at":"2022-05-12T09:53:19.026982+00:00","modified_at":"2022-05-12T09:53:19.070723+00:00","email":"test-create_an_app_key_for_this_service_account_returns_created_response-1652349198@datadoghq.com","icon":"https://secure.gravatar.com/avatar/63af80332690093fe6a0e4dd06372659?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: | - {"data":{"attributes":{"name":"Test-Create_an_app_key_for_this_service_account_returns_Created_response-1652349198"},"type":"application_keys"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/07af9197-7ca2-4330-8ee5-fe49e050d294/application_keys - response: - body: '{"data":{"type":"application_keys","id":"b1d42837-70dd-4ac2-9a6b-f222e68a21ec","attributes":{"name":"Test-Create_an_app_key_for_this_service_account_returns_Created_response-1652349198","created_at":"2022-05-12T09:53:19.628339+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"07af9197-7ca2-4330-8ee5-fe49e050d294"}},"leak_information":{"data":null}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/07af9197-7ca2-4330-8ee5-fe49e050d294/application_keys/b1d42837-70dd-4ac2-9a6b-f222e68a21ec - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/users/07af9197-7ca2-4330-8ee5-fe49e050d294 - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.freeze new file mode 100644 index 00000000000..ea2a5c5179d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.freeze @@ -0,0 +1 @@ +2023-10-12T10:11:47.418Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.yaml new file mode 100644 index 00000000000..fa53f90458f --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_application_key_for_this_service_account_returns_Created_response.yaml @@ -0,0 +1,73 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"email":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1697105507@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts + response: + body: '{"data":{"type":"users","id":"c0ea5a28-68e7-11ee-af78-7221d1e45f66","attributes":{"name":null,"handle":"c0ea5a28-68e7-11ee-af78-7221d1e45f66","created_at":"2023-10-12T10:11:47.838233+00:00","modified_at":"2023-10-12T10:11:47.838233+00:00","email":"test-create_an_application_key_for_this_service_account_returns_created_response-1697105507@datadoghq.com","icon":"https://secure.gravatar.com/avatar/45057f7ed4c5662bd175fd2657bf58f2?s=48&d=retro","title":"user + title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"name":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1697105507"},"type":"application_keys"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts/c0ea5a28-68e7-11ee-af78-7221d1e45f66/application_keys + response: + body: '{"data":{"type":"application_keys","id":"6315ab43-ce92-4130-b6d2-94ceb5f7142a","attributes":{"name":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1697105507","created_at":"2023-10-12T10:11:48.340554+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"c0ea5a28-68e7-11ee-af78-7221d1e45f66"}},"leak_information":{"data":null}}}}' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/service_accounts/c0ea5a28-68e7-11ee-af78-7221d1e45f66/application_keys/6315ab43-ce92-4130-b6d2-94ceb5f7142a + response: + body: '' + code: 204 + duration: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/users/c0ea5a28-68e7-11ee-af78-7221d1e45f66 + response: + body: '' + code: 204 + duration: '' + headers: {} + status: 204 No Content +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.freeze deleted file mode 100644 index 0f250869e2b..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:53:23.284Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.yaml deleted file mode 100644 index 36c0f22930d..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response.yaml +++ /dev/null @@ -1,85 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"email":"Test-Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response-1652349203@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts - response: - body: '{"data":{"type":"users","id":"b28852dc-c10b-47dc-ad93-dac3e345edf7","attributes":{"name":null,"handle":"b28852dc-c10b-47dc-ad93-dac3e345edf7","created_at":"2022-05-12T09:53:23.784584+00:00","modified_at":"2022-05-12T09:53:23.820961+00:00","email":"test-delete_an_app_key_owned_by_this_service_account_returns_no_content_response-1652349203@datadoghq.com","icon":"https://secure.gravatar.com/avatar/e9f758d44a304e5bf063d2bb60176186?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: | - {"data":{"attributes":{"name":"Test-Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response-1652349203"},"type":"application_keys"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/b28852dc-c10b-47dc-ad93-dac3e345edf7/application_keys - response: - body: '{"data":{"type":"application_keys","id":"bfedc1ba-6cba-4019-a685-252d07da0bf1","attributes":{"name":"Test-Delete_an_app_key_owned_by_this_service_account_returns_No_Content_response-1652349203","created_at":"2022-05-12T09:53:24.343109+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"b28852dc-c10b-47dc-ad93-dac3e345edf7"}},"leak_information":{"data":null}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/b28852dc-c10b-47dc-ad93-dac3e345edf7/application_keys/bfedc1ba-6cba-4019-a685-252d07da0bf1 - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/b28852dc-c10b-47dc-ad93-dac3e345edf7/application_keys/bfedc1ba-6cba-4019-a685-252d07da0bf1 - response: - body: '{"errors": ["Application key not found"]}' - code: 404 - duration: '' - headers: - Content-Type: - - application/json - status: 404 Not Found -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/users/b28852dc-c10b-47dc-ad93-dac3e345edf7 - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.freeze new file mode 100644 index 00000000000..96b3901455c --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2023-10-12T07:12:21.913Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.yaml new file mode 100644 index 00000000000..9b27deb51af --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Delete_an_application_key_for_this_service_account_returns_No_Content_response.yaml @@ -0,0 +1,89 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"email":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1697094741@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts + response: + body: '{"data":{"type":"users","id":"b0338c3c-68ce-11ee-9dc7-02a9eb8880d8","attributes":{"name":null,"handle":"b0338c3c-68ce-11ee-9dc7-02a9eb8880d8","created_at":"2023-10-12T07:12:22.378427+00:00","modified_at":"2023-10-12T07:12:22.378427+00:00","email":"test-delete_an_application_key_for_this_service_account_returns_no_content_response-1697094741@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ed84f324d81c653aae4b87a2eb517a97?s=48&d=retro","title":"user + title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"name":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1697094741"},"type":"application_keys"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8/application_keys + response: + body: '{"data":{"type":"application_keys","id":"6a147414-e85c-4b92-829b-fff59f8bd8e0","attributes":{"name":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1697094741","created_at":"2023-10-12T07:12:22.935154+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"b0338c3c-68ce-11ee-9dc7-02a9eb8880d8"}},"leak_information":{"data":null}}}}' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/service_accounts/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8/application_keys/6a147414-e85c-4b92-829b-fff59f8bd8e0 + response: + body: '' + code: 204 + duration: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/service_accounts/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8/application_keys/6a147414-e85c-4b92-829b-fff59f8bd8e0 + response: + body: '{"errors":["Application key not found"]}' + code: 404 + duration: '' + headers: + Content-Type: + - application/json + status: 404 Not Found +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/users/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8 + response: + body: '' + code: 204 + duration: '' + headers: {} + status: 204 No Content +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.freeze deleted file mode 100644 index c8e210cfd53..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:53:26.174Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.yaml deleted file mode 100644 index ea6ffd8af58..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_app_key_owned_by_this_service_account_returns_OK_response.yaml +++ /dev/null @@ -1,88 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"email":"Test-Edit_an_app_key_owned_by_this_service_account_returns_OK_response-1652349206@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts - response: - body: '{"data":{"type":"users","id":"2bac29f5-17f8-44ce-8b2b-bdd3feb60ace","attributes":{"name":null,"handle":"2bac29f5-17f8-44ce-8b2b-bdd3feb60ace","created_at":"2022-05-12T09:53:26.587713+00:00","modified_at":"2022-05-12T09:53:26.619983+00:00","email":"test-edit_an_app_key_owned_by_this_service_account_returns_ok_response-1652349206@datadoghq.com","icon":"https://secure.gravatar.com/avatar/24962bf4a23b952abdc2ecc056acc27b?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: | - {"data":{"attributes":{"name":"Test-Edit_an_app_key_owned_by_this_service_account_returns_OK_response-1652349206"},"type":"application_keys"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/2bac29f5-17f8-44ce-8b2b-bdd3feb60ace/application_keys - response: - body: '{"data":{"type":"application_keys","id":"c2d9978a-2dcb-4a46-b412-e1b6142b1508","attributes":{"name":"Test-Edit_an_app_key_owned_by_this_service_account_returns_OK_response-1652349206","created_at":"2022-05-12T09:53:27.176448+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"2bac29f5-17f8-44ce-8b2b-bdd3feb60ace"}},"leak_information":{"data":null}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: | - {"data":{"attributes":{"name":"Test-Edit_an_app_key_owned_by_this_service_account_returns_OK_response-1652349206-updated"},"id":"c2d9978a-2dcb-4a46-b412-e1b6142b1508","type":"application_keys"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: PATCH - url: https://api.datadoghq.com/api/v2/service_accounts/2bac29f5-17f8-44ce-8b2b-bdd3feb60ace/application_keys/c2d9978a-2dcb-4a46-b412-e1b6142b1508 - response: - body: '{"data":{"type":"application_keys","id":"c2d9978a-2dcb-4a46-b412-e1b6142b1508","attributes":{"name":"Test-Edit_an_app_key_owned_by_this_service_account_returns_OK_response-1652349206-updated","created_at":"2022-05-12T09:53:27.176448+00:00","last4":"xxxx","scopes":null},"relationships":{"leak_information":{"data":null}}}}' - code: 200 - duration: '' - headers: - Content-Type: - - application/json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/2bac29f5-17f8-44ce-8b2b-bdd3feb60ace/application_keys/c2d9978a-2dcb-4a46-b412-e1b6142b1508 - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/users/2bac29f5-17f8-44ce-8b2b-bdd3feb60ace - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.freeze new file mode 100644 index 00000000000..ba160164f03 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-10-12T10:10:58.448Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.yaml new file mode 100644 index 00000000000..75765686574 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Edit_an_application_key_for_this_service_account_returns_OK_response.yaml @@ -0,0 +1,92 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"email":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts + response: + body: '{"data":{"type":"users","id":"a3b86b00-68e7-11ee-b081-e2f0333fd1ce","attributes":{"name":null,"handle":"a3b86b00-68e7-11ee-b081-e2f0333fd1ce","created_at":"2023-10-12T10:10:58.857066+00:00","modified_at":"2023-10-12T10:10:58.857066+00:00","email":"test-edit_an_application_key_for_this_service_account_returns_ok_response-1697105458@datadoghq.com","icon":"https://secure.gravatar.com/avatar/00878614ca2acb0d68087ee17a33e3f4?s=48&d=retro","title":"user + title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458"},"type":"application_keys"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts/a3b86b00-68e7-11ee-b081-e2f0333fd1ce/application_keys + response: + body: '{"data":{"type":"application_keys","id":"8dca4456-bd90-4cb4-a182-5868501d8a9b","attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458","created_at":"2023-10-12T10:10:59.392476+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"a3b86b00-68e7-11ee-b081-e2f0333fd1ce"}},"leak_information":{"data":null}}}}' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458-updated"},"id":"8dca4456-bd90-4cb4-a182-5868501d8a9b","type":"application_keys"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + url: https://api.datadoghq.com/api/v2/service_accounts/a3b86b00-68e7-11ee-b081-e2f0333fd1ce/application_keys/8dca4456-bd90-4cb4-a182-5868501d8a9b + response: + body: '{"data":{"type":"application_keys","id":"8dca4456-bd90-4cb4-a182-5868501d8a9b","attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458-updated","created_at":"2023-10-12T10:10:59.392477+00:00","last4":"xxxx","scopes":null},"relationships":{"leak_information":{"data":null}}}}' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/service_accounts/a3b86b00-68e7-11ee-b081-e2f0333fd1ce/application_keys/8dca4456-bd90-4cb4-a182-5868501d8a9b + response: + body: '' + code: 204 + duration: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/users/a3b86b00-68e7-11ee-b081-e2f0333fd1ce + response: + body: '' + code: 204 + duration: '' + headers: {} + status: 204 No Content +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.freeze deleted file mode 100644 index d5c1eadcbeb..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:53:28.964Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.freeze deleted file mode 100644 index 1d3c351372d..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:53:30.573Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.yaml deleted file mode 100644 index 2b68e9a9474..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_app_key_owned_by_this_service_account_returns_OK_response.yaml +++ /dev/null @@ -1,85 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"email":"Test-Get_one_app_key_owned_by_this_service_account_returns_OK_response-1652349210@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts - response: - body: '{"data":{"type":"users","id":"c0ff63f1-330a-4180-b1f8-4c0051e50fee","attributes":{"name":null,"handle":"c0ff63f1-330a-4180-b1f8-4c0051e50fee","created_at":"2022-05-12T09:53:31.028388+00:00","modified_at":"2022-05-12T09:53:31.061501+00:00","email":"test-get_one_app_key_owned_by_this_service_account_returns_ok_response-1652349210@datadoghq.com","icon":"https://secure.gravatar.com/avatar/70d7e034954677ac6722e68e81e848f0?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: | - {"data":{"attributes":{"name":"Test-Get_one_app_key_owned_by_this_service_account_returns_OK_response-1652349210"},"type":"application_keys"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/c0ff63f1-330a-4180-b1f8-4c0051e50fee/application_keys - response: - body: '{"data":{"type":"application_keys","id":"4d8e6445-5088-450f-8bc5-5f56ffa0579c","attributes":{"name":"Test-Get_one_app_key_owned_by_this_service_account_returns_OK_response-1652349210","created_at":"2022-05-12T09:53:31.579790+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"c0ff63f1-330a-4180-b1f8-4c0051e50fee"}},"leak_information":{"data":null}}}}' - code: 201 - duration: '' - headers: - Content-Type: - - application/json - status: 201 Created -- request: - body: '' - form: {} - headers: - Accept: - - application/json - method: GET - url: https://api.datadoghq.com/api/v2/service_accounts/c0ff63f1-330a-4180-b1f8-4c0051e50fee/application_keys/4d8e6445-5088-450f-8bc5-5f56ffa0579c - response: - body: '{"data":{"type":"application_keys","id":"4d8e6445-5088-450f-8bc5-5f56ffa0579c","attributes":{"name":"Test-Get_one_app_key_owned_by_this_service_account_returns_OK_response-1652349210","created_at":"2022-05-12T09:53:31.579790+00:00","last4":"xxxx","scopes":null},"relationships":{"leak_information":{"data":null}}}}' - code: 200 - duration: '' - headers: - Content-Type: - - application/json - status: 200 OK -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/c0ff63f1-330a-4180-b1f8-4c0051e50fee/application_keys/4d8e6445-5088-450f-8bc5-5f56ffa0579c - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - method: DELETE - url: https://api.datadoghq.com/api/v2/users/c0ff63f1-330a-4180-b1f8-4c0051e50fee - response: - body: '' - code: 204 - duration: '' - headers: {} - status: 204 No Content -version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.freeze new file mode 100644 index 00000000000..8b52406f374 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-10-12T07:18:33.140Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.yaml new file mode 100644 index 00000000000..82575eb2182 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_one_application_key_for_this_service_account_returns_OK_response.yaml @@ -0,0 +1,89 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"email":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts + response: + body: '{"data":{"type":"users","id":"8d6f1427-68cf-11ee-b38b-b697d9f51e5c","attributes":{"name":null,"handle":"8d6f1427-68cf-11ee-b38b-b697d9f51e5c","created_at":"2023-10-12T07:18:33.545035+00:00","modified_at":"2023-10-12T07:18:33.545035+00:00","email":"test-get_one_application_key_for_this_service_account_returns_ok_response-1697095113@datadoghq.com","icon":"https://secure.gravatar.com/avatar/675597cb6c88dc2642385e567f57b727?s=48&d=retro","title":"user + title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113"},"type":"application_keys"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/service_accounts/8d6f1427-68cf-11ee-b38b-b697d9f51e5c/application_keys + response: + body: '{"data":{"type":"application_keys","id":"490b7601-a457-449c-8d8c-72c848e669d5","attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113","created_at":"2023-10-12T07:18:34.052468+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"8d6f1427-68cf-11ee-b38b-b697d9f51e5c"}},"leak_information":{"data":null}}}}' + code: 201 + duration: '' + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + method: GET + url: https://api.datadoghq.com/api/v2/service_accounts/8d6f1427-68cf-11ee-b38b-b697d9f51e5c/application_keys/490b7601-a457-449c-8d8c-72c848e669d5 + response: + body: '{"data":{"type":"application_keys","id":"490b7601-a457-449c-8d8c-72c848e669d5","attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113","created_at":"2023-10-12T07:18:34.052468+00:00","last4":"xxxx","scopes":null},"relationships":{"leak_information":{"data":null}}}}' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/service_accounts/8d6f1427-68cf-11ee-b38b-b697d9f51e5c/application_keys/490b7601-a457-449c-8d8c-72c848e669d5 + response: + body: '' + code: 204 + duration: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + method: DELETE + url: https://api.datadoghq.com/api/v2/users/8d6f1427-68cf-11ee-b38b-b697d9f51e5c + response: + body: '' + code: 204 + duration: '' + headers: {} + status: 204 No Content +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_application_keys_for_this_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_application_keys_for_this_service_account_returns_OK_response.freeze new file mode 100644 index 00000000000..7fa2e779bc0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_application_keys_for_this_service_account_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-10-12T10:12:18.993Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_application_keys_for_this_service_account_returns_OK_response.yaml similarity index 53% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_application_keys_for_this_service_account_returns_OK_response.yaml index e5574202ae1..a5c447f9705 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_all_app_keys_owned_by_this_service_account_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_application_keys_for_this_service_account_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Get_all_app_keys_owned_by_this_service_account_returns_OK_response-1652349208@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-List_application_keys_for_this_service_account_returns_OK_response-1697105538@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -11,8 +11,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/service_accounts response: - body: '{"data":{"type":"users","id":"926e55a1-cfc6-4d4f-9d5c-543b8327ba78","attributes":{"name":null,"handle":"926e55a1-cfc6-4d4f-9d5c-543b8327ba78","created_at":"2022-05-12T09:53:29.427553+00:00","modified_at":"2022-05-12T09:53:29.459704+00:00","email":"test-get_all_app_keys_owned_by_this_service_account_returns_ok_response-1652349208@datadoghq.com","icon":"https://secure.gravatar.com/avatar/520a9146f5c8d512b89e5fc4234eff5f?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' + body: '{"data":{"type":"users","id":"d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3","attributes":{"name":null,"handle":"d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3","created_at":"2023-10-12T10:12:19.421394+00:00","modified_at":"2023-10-12T10:12:19.421394+00:00","email":"test-list_application_keys_for_this_service_account_returns_ok_response-1697105538@datadoghq.com","icon":"https://secure.gravatar.com/avatar/79fd260ec49c01b5dde9172579034626?s=48&d=retro","title":"user + title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' code: 201 duration: '' headers: @@ -26,9 +28,9 @@ interactions: Accept: - application/json method: GET - url: https://api.datadoghq.com/api/v2/service_accounts/926e55a1-cfc6-4d4f-9d5c-543b8327ba78/application_keys + url: https://api.datadoghq.com/api/v2/service_accounts/d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3/application_keys response: - body: '{"meta":{"page":{"total_filtered_count":0},"max_allowed_per_user":1000},"data":[]}' + body: '{"data":[],"meta":{"page":{"total_filtered_count":0},"max_allowed_per_user":1000}}' code: 200 duration: '' headers: @@ -42,7 +44,7 @@ interactions: Accept: - '*/*' method: DELETE - url: https://api.datadoghq.com/api/v2/users/926e55a1-cfc6-4d4f-9d5c-543b8327ba78 + url: https://api.datadoghq.com/api/v2/users/d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3 response: body: '' code: 204 diff --git a/tests/scenarios/features/v2/service_accounts.feature b/tests/scenarios/features/v2/service_accounts.feature index d445ad6c132..c41493e186b 100644 --- a/tests/scenarios/features/v2/service_accounts.feature +++ b/tests/scenarios/features/v2/service_accounts.feature @@ -27,17 +27,6 @@ Feature: Service Accounts And the response "data.attributes.service_account" is equal to true And the response "data.relationships.roles.data[0].id" is equal to "{{ role.data.id }}" - @team:DataDog/credentials-management @team:DataDog/team-aaa-identity - Scenario: Create an app key for this service account returns "Created" response - Given there is a valid "service_account_user" in the system - And new "CreateServiceAccountApplicationKey" request - And request contains "service_account_id" parameter from "service_account_user.data.id" - And body with value {"data": {"attributes": {"name": "{{ unique }}"}, "type": "application_keys"}} - When the request is sent - Then the response status is 201 Created - And the response "data.attributes.name" is equal to "{{ unique }}" - And the response "data.relationships.owned_by.data.id" has the same value as "service_account_user.data.id" - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Create an application key for this service account returns "Bad Request" response Given new "CreateServiceAccountApplicationKey" request @@ -46,13 +35,16 @@ Feature: Service Accounts When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity + @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Create an application key for this service account returns "Created" response - Given new "CreateServiceAccountApplicationKey" request - And request contains "service_account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "type": "application_keys"}} + Given there is a valid "service_account_user" in the system + And new "CreateServiceAccountApplicationKey" request + And request contains "service_account_id" parameter from "service_account_user.data.id" + And body with value {"data": {"attributes": {"name": "{{ unique }}"}, "type": "application_keys"}} When the request is sent Then the response status is 201 Created + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.relationships.owned_by.data.id" has the same value as "service_account_user.data.id" @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Create an application key with scopes for this service account returns "Created" response @@ -67,7 +59,7 @@ Feature: Service Accounts And the response "data.relationships.owned_by.data.id" has the same value as "service_account_user.data.id" @team:DataDog/credentials-management @team:DataDog/team-aaa-identity - Scenario: Delete an app key owned by this service account returns "No Content" response + Scenario: Delete an application key for this service account returns "No Content" response Given there is a valid "service_account_user" in the system And there is a valid "service_account_application_key" for "service_account_user" And new "DeleteServiceAccountApplicationKey" request @@ -76,14 +68,6 @@ Feature: Service Accounts When the request is sent Then the response status is 204 No Content - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity - Scenario: Delete an application key for this service account returns "No Content" response - Given new "DeleteServiceAccountApplicationKey" request - And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "app_key_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 204 No Content - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Delete an application key for this service account returns "Not Found" response Given new "DeleteServiceAccountApplicationKey" request @@ -92,20 +76,6 @@ Feature: Service Accounts When the request is sent Then the response status is 404 Not Found - @team:DataDog/credentials-management @team:DataDog/team-aaa-identity - Scenario: Edit an app key owned by this service account returns "OK" response - Given there is a valid "service_account_user" in the system - And there is a valid "service_account_application_key" for "service_account_user" - And new "UpdateServiceAccountApplicationKey" request - And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "app_key_id" parameter from "service_account_application_key.data.id" - And body with value {"data": {"id": "{{ service_account_application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ service_account_application_key.data.attributes.name }}-updated"}}} - When the request is sent - Then the response status is 200 OK - And the response "data.attributes.name" is equal to "{{ service_account_application_key.data.attributes.name }}-updated" - And the response "data.type" is equal to "application_keys" - And the response "data.id" is equal to "{{ service_account_application_key.data.id }}" - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Edit an application key for this service account returns "Bad Request" response Given new "UpdateServiceAccountApplicationKey" request @@ -124,34 +94,17 @@ Feature: Service Accounts When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity - Scenario: Edit an application key for this service account returns "OK" response - Given new "UpdateServiceAccountApplicationKey" request - And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "app_key_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} - When the request is sent - Then the response status is 200 OK - - @team:DataDog/credentials-management @team:DataDog/team-aaa-identity - Scenario: Get all app keys owned by this service account returns "OK" response - Given there is a valid "service_account_user" in the system - And new "ListServiceAccountApplicationKeys" request - And request contains "service_account_id" parameter from "service_account_user.data.id" - When the request is sent - Then the response status is 200 OK - And the response "data" has length 0 - @team:DataDog/credentials-management @team:DataDog/team-aaa-identity - Scenario: Get one app key owned by this service account returns "OK" response + Scenario: Edit an application key for this service account returns "OK" response Given there is a valid "service_account_user" in the system And there is a valid "service_account_application_key" for "service_account_user" - And new "GetServiceAccountApplicationKey" request + And new "UpdateServiceAccountApplicationKey" request And request contains "service_account_id" parameter from "service_account_user.data.id" And request contains "app_key_id" parameter from "service_account_application_key.data.id" + And body with value {"data": {"id": "{{ service_account_application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ service_account_application_key.data.attributes.name }}-updated"}}} When the request is sent Then the response status is 200 OK - And the response "data.attributes.name" has the same value as "service_account_application_key.data.attributes.name" + And the response "data.attributes.name" is equal to "{{ service_account_application_key.data.attributes.name }}-updated" And the response "data.type" is equal to "application_keys" And the response "data.id" is equal to "{{ service_account_application_key.data.id }}" @@ -163,13 +116,18 @@ Feature: Service Accounts When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity + @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Get one application key for this service account returns "OK" response - Given new "GetServiceAccountApplicationKey" request - And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "app_key_id" parameter from "REPLACE.ME" + Given there is a valid "service_account_user" in the system + And there is a valid "service_account_application_key" for "service_account_user" + And new "GetServiceAccountApplicationKey" request + And request contains "service_account_id" parameter from "service_account_user.data.id" + And request contains "app_key_id" parameter from "service_account_application_key.data.id" When the request is sent Then the response status is 200 OK + And the response "data.attributes.name" has the same value as "service_account_application_key.data.attributes.name" + And the response "data.type" is equal to "application_keys" + And the response "data.id" is equal to "{{ service_account_application_key.data.id }}" @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: List application keys for this service account returns "Bad Request" response @@ -185,9 +143,11 @@ Feature: Service Accounts When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity + @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: List application keys for this service account returns "OK" response - Given new "ListServiceAccountApplicationKeys" request - And request contains "service_account_id" parameter from "REPLACE.ME" + Given there is a valid "service_account_user" in the system + And new "ListServiceAccountApplicationKeys" request + And request contains "service_account_id" parameter from "service_account_user.data.id" When the request is sent Then the response status is 200 OK + And the response "data" has length 0