Skip to content

[Application Keys] Application keys v2 API #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.3.0",
"regenerated": "2020-12-02 08:54:23.344270",
"spec_repo_commit": "cdc8c0b"
"regenerated": "2020-12-07 17:47:05.841868",
"spec_repo_commit": "ea548b1"
},
"v2": {
"apigentools_version": "1.3.0",
"regenerated": "2020-12-02 08:54:33.564570",
"spec_repo_commit": "cdc8c0b"
"regenerated": "2020-12-07 17:47:15.963438",
"spec_repo_commit": "ea548b1"
}
}
}
89 changes: 89 additions & 0 deletions tests/v2/features/key_management.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
@endpoint(key-management)
Feature: Key Management
Manage your Datadog API and application keys. You need an API and
applications key with Admin rights to interact with this endpoint. The
full list of keys can be seen on your [Datadog API
page](https://app.datadoghq.com/account/settings#api).

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "KeyManagement" API

@skip
Scenario: Get all Application keys returns "OK" response
Given new "ListApplicationKeys" request
When the request is sent
Then the response status is 200 OK

@skip
Scenario: Delete an Application key returns "No Content" response
Given there is a valid "application_key" in the system
And new "DeleteApplicationKey" request
And request contains "app_key_id" parameter from "application_key.data.id"
When the request is sent
Then the response status is 204 No Content

@skip
Scenario: Get all Application keys owned by current user returns "OK" response
Given new "ListCurrentUserApplicationKeys" request
When the request is sent
Then the response status is 200 OK

@skip
Scenario: Create an Application key for current user returns "Created" response
Given new "CreateCurrentUserApplicationKey" request
And body {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}"}}}
When the request is sent
Then the response status is 201 Created
And the response "data.attributes.name" is equal to "{{ unique }}"

@skip
Scenario: Delete an Application key owned by current user returns "No Content" response
Given there is a valid "application_key" in the system
And new "DeleteCurrentUserApplicationKey" request
And request contains "app_key_id" parameter from "application_key.data.id"
When the request is sent
Then the response status is 204 No Content

@skip
Scenario: Get one Application key owned by current user returns "OK" response
Given there is a valid "application_key" in the system
And new "GetCurrentUserApplicationKey" request
And request contains "app_key_id" parameter from "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 "application_key.data.attributes.name"

@skip
Scenario: Edit an application key owned by current user returns "OK" response
Given there is a valid "application_key" in the system
And new "UpdateCurrentUserApplicationKey" request
And request contains "app_key_id" parameter from "application_key.data.id"
And body {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ 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 "{{ application_key.data.attributes.name }}-updated"

@skip
Scenario: Edit an application key returns "OK" response
Given there is a valid "application_key" in the system
And new "UpdateApplicationKey" request
And request contains "app_key_id" parameter from "application_key.data.id"
And body {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ 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 "{{ application_key.data.attributes.name }}-updated"

@generated @skip
Scenario: Get all application keys returns "OK" response
Given new "ListApplicationKeys" request
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Delete an application key returns "No Content" response
Given new "DeleteApplicationKey" request
And request contains "app_key_id" parameter from "<PATH>"
When the request is sent
Then the response status is 204 No Content
80 changes: 68 additions & 12 deletions tests/v2/features/undo.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,59 @@
{
"ListApplicationKeys": {
"tag": "Key Management",
"undo": {
"type": "safe"
}
},
"DeleteApplicationKey": {
"tag": "Key Management",
"undo": {
"type": "idempotent"
}
},
"UpdateApplicationKey": {
"tag": "Key Management",
"undo": {
"type": "idempotent"
}
},
"ListCurrentUserApplicationKeys": {
"tag": "Key Management",
"undo": {
"type": "safe"
}
},
"CreateCurrentUserApplicationKey": {
"tag": "Key Management",
"undo": {
"operationId": "DeleteCurrentUserApplicationKey",
"parameters": [
{
"name": "app_key_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteCurrentUserApplicationKey": {
"tag": "Key Management",
"undo": {
"type": "idempotent"
}
},
"GetCurrentUserApplicationKey": {
"tag": "Key Management",
"undo": {
"type": "safe"
}
},
"UpdateCurrentUserApplicationKey": {
"tag": "Key Management",
"undo": {
"type": "idempotent"
}
},
"DeleteDashboardListItems": {
"tag": "Dashboard Lists",
"undo": {
Expand All @@ -14,19 +69,14 @@
"CreateDashboardListItems": {
"tag": "Dashboard Lists",
"undo": {
"operationId": "DeleteDashboardListItems",
"parameters": [
{
"name": "dashboard_list_id",
"source": "<RESPONSE_PATH>"
}
],
"type": "unsafe"
"type": "safe"
}
},
"UpdateDashboardListItems": {
"tag": "Dashboard Lists",
"undo": null
"undo": {
"type": "safe"
}
},
"ListIncidents": {
"tag": "Incidents",
Expand Down Expand Up @@ -79,7 +129,9 @@
},
"UpdateLogsArchiveOrder": {
"tag": "Logs Archives",
"undo": null
"undo": {
"type": "safe"
}
},
"ListLogsArchives": {
"tag": "Logs Archives",
Expand Down Expand Up @@ -114,7 +166,9 @@
},
"UpdateLogsArchive": {
"tag": "Logs Archives",
"undo": null
"undo": {
"type": "safe"
}
},
"RemoveRoleFromArchive": {
"tag": "Logs Archives",
Expand All @@ -130,7 +184,9 @@
},
"AddReadRoleToArchive": {
"tag": "Logs Archives",
"undo": null
"undo": {
"type": "unsafe"
}
},
"ListLogsGet": {
"tag": "Logs",
Expand Down