Skip to content

Commit e9aab86

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OAuth support for Synthetics tests (#923)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 7bb78d8 commit e9aab86

File tree

21 files changed

+467
-79
lines changed

21 files changed

+467
-79
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2022-11-22 09:27:51.040191",
8-
"spec_repo_commit": "b67ecba8"
7+
"regenerated": "2022-11-22 13:49:05.695818",
8+
"spec_repo_commit": "dad9f2c8"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-11-22 09:27:51.057725",
13-
"spec_repo_commit": "b67ecba8"
12+
"regenerated": "2022-11-22 13:49:05.708257",
13+
"spec_repo_commit": "dad9f2c8"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11523,6 +11523,8 @@ components:
1152311523
- $ref: '#/components/schemas/SyntheticsBasicAuthSigv4'
1152411524
- $ref: '#/components/schemas/SyntheticsBasicAuthNTLM'
1152511525
- $ref: '#/components/schemas/SyntheticsBasicAuthDigest'
11526+
- $ref: '#/components/schemas/SyntheticsBasicAuthOauthClient'
11527+
- $ref: '#/components/schemas/SyntheticsBasicAuthOauthROP'
1152611528
type: object
1152711529
SyntheticsBasicAuthDigest:
1152811530
description: Object to handle digest authentication when performing the test.
@@ -11586,6 +11588,115 @@ components:
1158611588
type: string
1158711589
x-enum-varnames:
1158811590
- NTLM
11591+
SyntheticsBasicAuthOauthClient:
11592+
description: Object to handle `oauth client` authentication when performing
11593+
the test.
11594+
properties:
11595+
accessTokenUrl:
11596+
description: Access token URL to use when performing the authentication.
11597+
example: https://example.com
11598+
type: string
11599+
audience:
11600+
description: Audience to use when performing the authentication.
11601+
example: audience
11602+
type: string
11603+
clientId:
11604+
description: Client ID to use when performing the authentication.
11605+
example: oauth-username
11606+
type: string
11607+
clientSecret:
11608+
description: Client secret to use when performing the authentication.
11609+
example: oauth-password
11610+
type: string
11611+
resource:
11612+
description: Resource to use when performing the authentication.
11613+
example: resource
11614+
type: string
11615+
scope:
11616+
description: Scope to use when performing the authentication.
11617+
example: scope
11618+
type: string
11619+
tokenApiAuthentication:
11620+
$ref: '#/components/schemas/SyntheticsBasicAuthOauthTokenApiAuthentication'
11621+
type:
11622+
$ref: '#/components/schemas/SyntheticsBasicAuthOauthClientType'
11623+
required:
11624+
- accessTokenUrl
11625+
- tokenApiAuthentication
11626+
- clientId
11627+
- clientSecret
11628+
type: object
11629+
SyntheticsBasicAuthOauthClientType:
11630+
default: oauth-client
11631+
description: The type of basic authentication to use when performing the test.
11632+
enum:
11633+
- oauth-client
11634+
example: oauth-client
11635+
type: string
11636+
x-enum-varnames:
11637+
- OAUTH_CLIENT
11638+
SyntheticsBasicAuthOauthROP:
11639+
description: Object to handle `oauth rop` authentication when performing the
11640+
test.
11641+
properties:
11642+
accessTokenUrl:
11643+
description: Access token URL to use when performing the authentication.
11644+
example: https://example.com
11645+
type: string
11646+
audience:
11647+
description: Audience to use when performing the authentication.
11648+
example: audience
11649+
type: string
11650+
clientId:
11651+
description: Client ID to use when performing the authentication.
11652+
example: client-id
11653+
type: string
11654+
clientSecret:
11655+
description: Client secret to use when performing the authentication.
11656+
example: client-secret
11657+
type: string
11658+
password:
11659+
description: Password to use when performing the authentication.
11660+
example: password
11661+
type: string
11662+
resource:
11663+
description: Resource to use when performing the authentication.
11664+
example: resource
11665+
type: string
11666+
scope:
11667+
description: Scope to use when performing the authentication.
11668+
example: scope
11669+
type: string
11670+
type:
11671+
$ref: '#/components/schemas/SyntheticsBasicAuthOauthROPType'
11672+
username:
11673+
description: Username to use when performing the authentication.
11674+
example: username
11675+
type: string
11676+
required:
11677+
- accessTokenUrl
11678+
- password
11679+
- username
11680+
type: object
11681+
SyntheticsBasicAuthOauthROPType:
11682+
default: oauth-rop
11683+
description: The type of basic authentication to use when performing the test.
11684+
enum:
11685+
- oauth-rop
11686+
example: oauth-rop
11687+
type: string
11688+
x-enum-varnames:
11689+
- OAUTH_ROP
11690+
SyntheticsBasicAuthOauthTokenApiAuthentication:
11691+
description: Type of token to use when performing the authentication.
11692+
enum:
11693+
- header
11694+
- body
11695+
example: header
11696+
type: string
11697+
x-enum-varnames:
11698+
- HEADER
11699+
- BODY
1158911700
SyntheticsBasicAuthSigv4:
1159011701
description: Object to handle `SIGV4` authentication when performing the test.
1159111702
properties:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-11-08T09:31:12.771Z"
1+
"2022-11-21T13:20:41.192Z"

cassettes/v1/Monitors_4022238206/Get-a-synthetics-monitor-s-details_2292154114/recording.har

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"entries": [
1010
{
11-
"_id": "2abd75f59b0d9f67de34929ac9a992b2",
11+
"_id": "3a11d1dbd49031df6f3bc5d71212d8cd",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
15-
"bodySize": 1395,
15+
"bodySize": 1623,
1616
"cookies": [],
1717
"headers": [
1818
{
@@ -32,17 +32,17 @@
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"config\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"certificate\":{\"cert\":{\"content\":\"cert-content\",\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"content\":\"key-content\",\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testgetasyntheticsmonitorsdetails1667899872\"},\"method\":\"GET\",\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"}},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"name\":\"Test-Get_a_synthetics_monitor_s_details-1667899872\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Get_a_synthetics_monitor_s_details-1667899872\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"subtype\":\"http\",\"tags\":[\"testing:api\"],\"type\":\"api\"}"
35+
"text": "{\"config\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"cert\":{\"content\":\"cert-content\",\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"content\":\"key-content\",\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testgetasyntheticsmonitorsdetails1669036841\"},\"method\":\"GET\",\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"}},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"name\":\"Test-Get_a_synthetics_monitor_s_details-1669036841\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Get_a_synthetics_monitor_s_details-1669036841\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"subtype\":\"http\",\"tags\":[\"testing:api\"],\"type\":\"api\"}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/api"
3939
},
4040
"response": {
41-
"bodySize": 1543,
41+
"bodySize": 1771,
4242
"content": {
4343
"mimeType": "application/json",
44-
"size": 1543,
45-
"text": "{\"status\":\"live\",\"public_id\":\"2ud-5q9-dwc\",\"tags\":[\"testing:api\"],\"org_id\":569509,\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"deleted_at\":null,\"name\":\"Test-Get_a_synthetics_monitor_s_details-1667899872\",\"monitor_id\":102332053,\"type\":\"api\",\"created_at\":\"2022-11-08T09:31:13.173822+00:00\",\"modified_at\":\"2022-11-08T09:31:13.173822+00:00\",\"subtype\":\"http\",\"config\":{\"request\":{\"certificate\":{\"cert\":{\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"url\":\"https://datadoghq.com\",\"headers\":{\"unique\":\"testgetasyntheticsmonitorsdetails1667899872\"},\"proxy\":{\"url\":\"https://datadoghq.com\",\"headers\":{}},\"timeout\":10,\"method\":\"GET\"},\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"type\":\"header\",\"target\":\"text/html\"},{\"operator\":\"lessThan\",\"type\":\"responseTime\",\"target\":2000},{\"operator\":\"validatesJSONPath\",\"type\":\"body\",\"target\":{\"operator\":\"isNot\",\"targetValue\":\"0\",\"jsonPath\":\"topKey\"}},{\"operator\":\"validatesXPath\",\"type\":\"body\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"}}],\"configVariables\":[{\"pattern\":\"content-type\",\"type\":\"text\",\"example\":\"content-type\",\"name\":\"PROPERTY\"}]},\"options\":{\"accept_self_signed\":false,\"retry\":{\"count\":3,\"interval\":10},\"min_location_failed\":1,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"monitor_priority\":5,\"monitor_name\":\"Test-Get_a_synthetics_monitor_s_details-1667899872\",\"tick_every\":60}}"
44+
"size": 1771,
45+
"text": "{\"status\":\"live\",\"public_id\":\"ahw-qah-d9b\",\"tags\":[\"testing:api\"],\"org_id\":569509,\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"deleted_at\":null,\"name\":\"Test-Get_a_synthetics_monitor_s_details-1669036841\",\"monitor_id\":103654710,\"type\":\"api\",\"created_at\":\"2022-11-21T13:20:41.629289+00:00\",\"modified_at\":\"2022-11-21T13:20:41.629289+00:00\",\"subtype\":\"http\",\"config\":{\"request\":{\"certificate\":{\"cert\":{\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"url\":\"https://datadoghq.com\",\"basicAuth\":{\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"scope\":\"yoyo\",\"type\":\"oauth-client\",\"tokenApiAuthentication\":\"header\"},\"headers\":{\"unique\":\"testgetasyntheticsmonitorsdetails1669036841\"},\"proxy\":{\"url\":\"https://datadoghq.com\",\"headers\":{}},\"timeout\":10,\"method\":\"GET\"},\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"type\":\"header\",\"target\":\"text/html\"},{\"operator\":\"lessThan\",\"type\":\"responseTime\",\"target\":2000},{\"operator\":\"validatesJSONPath\",\"type\":\"body\",\"target\":{\"operator\":\"isNot\",\"targetValue\":\"0\",\"jsonPath\":\"topKey\"}},{\"operator\":\"validatesXPath\",\"type\":\"body\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"}}],\"configVariables\":[{\"pattern\":\"content-type\",\"type\":\"text\",\"example\":\"content-type\",\"name\":\"PROPERTY\"}]},\"options\":{\"accept_self_signed\":false,\"retry\":{\"count\":3,\"interval\":10},\"min_location_failed\":1,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"monitor_priority\":5,\"monitor_name\":\"Test-Get_a_synthetics_monitor_s_details-1669036841\",\"tick_every\":60}}"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -57,11 +57,11 @@
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2022-11-08T09:31:12.775Z",
61-
"time": 459
60+
"startedDateTime": "2022-11-21T13:20:41.196Z",
61+
"time": 493
6262
},
6363
{
64-
"_id": "038f7b09fa1a745b5afbbb3784faebaf",
64+
"_id": "a578adb795248483ad9ef8f100c5c067",
6565
"_order": 0,
6666
"cache": {},
6767
"request": {
@@ -78,14 +78,14 @@
7878
"httpVersion": "HTTP/1.1",
7979
"method": "GET",
8080
"queryString": [],
81-
"url": "https://api.datadoghq.com/api/v1/monitor/102332053"
81+
"url": "https://api.datadoghq.com/api/v1/monitor/103654710"
8282
},
8383
"response": {
8484
"bodySize": 815,
8585
"content": {
8686
"mimeType": "application/json",
8787
"size": 815,
88-
"text": "{\"restricted_roles\":null,\"tags\":[\"testing:api\",\"probe_dc:aws:us-east-2\",\"check_type:api\",\"check_status:live\",\"ci_execution_rule:blocking\"],\"deleted\":null,\"query\":\"no_query\",\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"id\":102332053,\"multi\":false,\"name\":\"Test-Get_a_synthetics_monitor_s_details-1667899872\",\"created\":\"2022-11-08T09:31:13.159457+00:00\",\"created_at\":1667899873000,\"creator\":{\"id\":2781302,\"handle\":\"[email protected]\",\"name\":\"Frog\",\"email\":\"[email protected]\"},\"org_id\":569509,\"modified\":\"2022-11-08T09:31:13.159457+00:00\",\"priority\":5,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"synthetics alert\",\"options\":{\"notify_audit\":false,\"synthetics_check_id\":\"2ud-5q9-dwc\",\"silenced\":{},\"include_tags\":true,\"new_host_delay\":300,\"on_missing_data\":\"show_no_data\"}}\n"
88+
"text": "{\"id\":103654710,\"org_id\":569509,\"type\":\"synthetics alert\",\"name\":\"Test-Get_a_synthetics_monitor_s_details-1669036841\",\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"tags\":[\"testing:api\",\"probe_dc:aws:us-east-2\",\"check_type:api\",\"check_status:live\",\"ci_execution_rule:blocking\"],\"query\":\"no_query\",\"options\":{\"include_tags\":true,\"notify_audit\":false,\"new_host_delay\":300,\"on_missing_data\":\"show_no_data\",\"synthetics_check_id\":\"ahw-qah-d9b\",\"silenced\":{}},\"multi\":false,\"created_at\":1669036841000,\"created\":\"2022-11-21T13:20:41.610325+00:00\",\"modified\":\"2022-11-21T13:20:41.610325+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":5,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":\"Frog\",\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"id\":2781302}}\n"
8989
},
9090
"cookies": [],
9191
"headers": [
@@ -100,11 +100,11 @@
100100
"status": 200,
101101
"statusText": "OK"
102102
},
103-
"startedDateTime": "2022-11-08T09:31:13.241Z",
104-
"time": 361
103+
"startedDateTime": "2022-11-21T13:20:41.700Z",
104+
"time": 380
105105
},
106106
{
107-
"_id": "abc4c92ebb30d612408ca4e000cef756",
107+
"_id": "7a690f43b3f15a19388289e3e0281138",
108108
"_order": 0,
109109
"cache": {},
110110
"request": {
@@ -128,7 +128,7 @@
128128
"postData": {
129129
"mimeType": "application/json",
130130
"params": [],
131-
"text": "{\"public_ids\":[\"2ud-5q9-dwc\"]}"
131+
"text": "{\"public_ids\":[\"ahw-qah-d9b\"]}"
132132
},
133133
"queryString": [],
134134
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/delete"
@@ -138,7 +138,7 @@
138138
"content": {
139139
"mimeType": "application/json",
140140
"size": 96,
141-
"text": "{\"deleted_tests\":[{\"deleted_at\":\"2022-11-08T09:31:13.936142+00:00\",\"public_id\":\"2ud-5q9-dwc\"}]}\n"
141+
"text": "{\"deleted_tests\":[{\"deleted_at\":\"2022-11-21T13:20:42.443854+00:00\",\"public_id\":\"ahw-qah-d9b\"}]}\n"
142142
},
143143
"cookies": [],
144144
"headers": [
@@ -153,8 +153,8 @@
153153
"status": 200,
154154
"statusText": "OK"
155155
},
156-
"startedDateTime": "2022-11-08T09:31:13.610Z",
157-
"time": 419
156+
"startedDateTime": "2022-11-21T13:20:42.087Z",
157+
"time": 505
158158
}
159159
],
160160
"pages": [],
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-11-07T13:42:32.570Z"
1+
"2022-11-14T14:48:36.716Z"

0 commit comments

Comments
 (0)