|
| 1 | +@endpoint(key-management) |
| 2 | +Feature: Key Management |
| 3 | + Manage your Datadog API and application keys. You need an API and |
| 4 | + applications key with Admin rights to interact with this endpoint. The |
| 5 | + full list of keys can be seen on your [Datadog API |
| 6 | + page](https://app.datadoghq.com/account/settings#api). |
| 7 | + |
| 8 | + Background: |
| 9 | + Given a valid "apiKeyAuth" key in the system |
| 10 | + And a valid "appKeyAuth" key in the system |
| 11 | + And an instance of "KeyManagement" API |
| 12 | + |
| 13 | + @skip |
| 14 | + Scenario: Get all Application keys returns "OK" response |
| 15 | + Given new "ListApplicationKeys" request |
| 16 | + When the request is sent |
| 17 | + Then the response status is 200 OK |
| 18 | + |
| 19 | + @skip |
| 20 | + Scenario: Delete an Application key returns "No Content" response |
| 21 | + Given there is a valid "application_key" in the system |
| 22 | + And new "DeleteApplicationKey" request |
| 23 | + And request contains "app_key_id" parameter from "application_key.data.id" |
| 24 | + When the request is sent |
| 25 | + Then the response status is 204 No Content |
| 26 | + |
| 27 | + @skip |
| 28 | + Scenario: Get all Application keys owned by current user returns "OK" response |
| 29 | + Given new "ListCurrentUserApplicationKeys" request |
| 30 | + When the request is sent |
| 31 | + Then the response status is 200 OK |
| 32 | + |
| 33 | + @skip |
| 34 | + Scenario: Create an Application key for current user returns "Created" response |
| 35 | + Given new "CreateCurrentUserApplicationKey" request |
| 36 | + And body {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}"}}} |
| 37 | + When the request is sent |
| 38 | + Then the response status is 201 Created |
| 39 | + And the response "data.attributes.name" is equal to "{{ unique }}" |
| 40 | + |
| 41 | + @skip |
| 42 | + Scenario: Delete an Application key owned by current user returns "No Content" response |
| 43 | + Given there is a valid "application_key" in the system |
| 44 | + And new "DeleteCurrentUserApplicationKey" request |
| 45 | + And request contains "app_key_id" parameter from "application_key.data.id" |
| 46 | + When the request is sent |
| 47 | + Then the response status is 204 No Content |
| 48 | + |
| 49 | + @skip |
| 50 | + Scenario: Get one Application key owned by current user returns "OK" response |
| 51 | + Given there is a valid "application_key" in the system |
| 52 | + And new "GetCurrentUserApplicationKey" request |
| 53 | + And request contains "app_key_id" parameter from "application_key.data.id" |
| 54 | + When the request is sent |
| 55 | + Then the response status is 200 OK |
| 56 | + And the response "data.attributes.name" has the same value as "application_key.data.attributes.name" |
| 57 | + |
| 58 | + @skip |
| 59 | + Scenario: Edit an application key owned by current user returns "OK" response |
| 60 | + Given there is a valid "application_key" in the system |
| 61 | + And new "UpdateCurrentUserApplicationKey" request |
| 62 | + And request contains "app_key_id" parameter from "application_key.data.id" |
| 63 | + And body {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} |
| 64 | + When the request is sent |
| 65 | + Then the response status is 200 OK |
| 66 | + And the response "data.attributes.name" is equal to "{{ application_key.data.attributes.name }}-updated" |
| 67 | + |
| 68 | + @skip |
| 69 | + Scenario: Edit an application key returns "OK" response |
| 70 | + Given there is a valid "application_key" in the system |
| 71 | + And new "UpdateApplicationKey" request |
| 72 | + And request contains "app_key_id" parameter from "application_key.data.id" |
| 73 | + And body {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} |
| 74 | + When the request is sent |
| 75 | + Then the response status is 200 OK |
| 76 | + And the response "data.attributes.name" is equal to "{{ application_key.data.attributes.name }}-updated" |
| 77 | + |
| 78 | + @generated @skip |
| 79 | + Scenario: Get all application keys returns "OK" response |
| 80 | + Given new "ListApplicationKeys" request |
| 81 | + When the request is sent |
| 82 | + Then the response status is 200 OK |
| 83 | + |
| 84 | + @generated @skip |
| 85 | + Scenario: Delete an application key returns "No Content" response |
| 86 | + Given new "DeleteApplicationKey" request |
| 87 | + And request contains "app_key_id" parameter from "<PATH>" |
| 88 | + When the request is sent |
| 89 | + Then the response status is 204 No Content |
0 commit comments