Skip to content

Commit 94b7a7a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3237a81 of spec repo
1 parent 73b019c commit 94b7a7a

27 files changed

+2519
-79
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 418 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Create a WAF Policy returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.ApplicationSecurityApi(configuration);
9+
10+
const params: v2.ApplicationSecurityApiCreateApplicationSecurityWafPolicyRequest =
11+
{
12+
body: {
13+
data: {
14+
attributes: {
15+
basedOn: "recommended",
16+
description: "Policy applied to internal web applications.",
17+
isDefault: false,
18+
name: "Internal Network Policy",
19+
protectionPresets: ["attack-tools"],
20+
rules: [
21+
{
22+
blocking: false,
23+
enabled: true,
24+
id: "rasp-001-002",
25+
},
26+
],
27+
scope: [
28+
{
29+
env: "prod",
30+
service: "billing-service",
31+
},
32+
],
33+
version: 0,
34+
},
35+
type: "policy",
36+
},
37+
},
38+
};
39+
40+
apiInstance
41+
.createApplicationSecurityWafPolicy(params)
42+
.then((data: v2.ApplicationSecurityPolicyResponse) => {
43+
console.log(
44+
"API called successfully. Returned data: " + JSON.stringify(data)
45+
);
46+
})
47+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete a WAF Policy returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.ApplicationSecurityApi(configuration);
9+
10+
const params: v2.ApplicationSecurityApiDeleteApplicationSecurityWafPolicyRequest =
11+
{
12+
policyId: "policy_id",
13+
};
14+
15+
apiInstance
16+
.deleteApplicationSecurityWafPolicy(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get a WAF Policy returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.ApplicationSecurityApi(configuration);
9+
10+
const params: v2.ApplicationSecurityApiGetApplicationSecurityWafPolicyRequest =
11+
{
12+
policyId: "policy_id",
13+
};
14+
15+
apiInstance
16+
.getApplicationSecurityWafPolicy(params)
17+
.then((data: v2.ApplicationSecurityPolicyResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* List all WAF policies returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.ApplicationSecurityApi(configuration);
9+
10+
apiInstance
11+
.listApplicationSecurityWAFPolicies()
12+
.then((data: v2.ApplicationSecurityPolicyListResponse) => {
13+
console.log(
14+
"API called successfully. Returned data: " + JSON.stringify(data)
15+
);
16+
})
17+
.catch((error: any) => console.error(error));
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Update a WAF Policy returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.ApplicationSecurityApi(configuration);
9+
10+
const params: v2.ApplicationSecurityApiUpdateApplicationSecurityWafPolicyRequest =
11+
{
12+
body: {
13+
data: {
14+
attributes: {
15+
description: "Policy applied to internal web applications.",
16+
isDefault: false,
17+
name: "Internal Network Policy",
18+
protectionPresets: ["attack-tools"],
19+
rules: [
20+
{
21+
blocking: false,
22+
enabled: true,
23+
id: "rasp-001-002",
24+
},
25+
],
26+
scope: [
27+
{
28+
env: "prod",
29+
service: "billing-service",
30+
},
31+
],
32+
version: 0,
33+
},
34+
type: "policy",
35+
},
36+
},
37+
policyId: "policy_id",
38+
};
39+
40+
apiInstance
41+
.updateApplicationSecurityWafPolicy(params)
42+
.then((data: v2.ApplicationSecurityPolicyResponse) => {
43+
console.log(
44+
"API called successfully. Returned data: " + JSON.stringify(data)
45+
);
46+
})
47+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7308,6 +7308,41 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
73087308
},
73097309
"operationResponseType": "{}",
73107310
},
7311+
"v2.ListApplicationSecurityWAFPolicies": {
7312+
"operationResponseType": "ApplicationSecurityPolicyListResponse",
7313+
},
7314+
"v2.CreateApplicationSecurityWafPolicy": {
7315+
"body": {
7316+
"type": "ApplicationSecurityPolicyCreateRequest",
7317+
"format": "",
7318+
},
7319+
"operationResponseType": "ApplicationSecurityPolicyResponse",
7320+
},
7321+
"v2.GetApplicationSecurityWafPolicy": {
7322+
"policyId": {
7323+
"type": "string",
7324+
"format": "",
7325+
},
7326+
"operationResponseType": "ApplicationSecurityPolicyResponse",
7327+
},
7328+
"v2.UpdateApplicationSecurityWafPolicy": {
7329+
"policyId": {
7330+
"type": "string",
7331+
"format": "",
7332+
},
7333+
"body": {
7334+
"type": "ApplicationSecurityPolicyUpdateRequest",
7335+
"format": "",
7336+
},
7337+
"operationResponseType": "ApplicationSecurityPolicyResponse",
7338+
},
7339+
"v2.DeleteApplicationSecurityWafPolicy": {
7340+
"policyId": {
7341+
"type": "string",
7342+
"format": "",
7343+
},
7344+
"operationResponseType": "{}",
7345+
},
73117346
"v2.ListCSMThreatsAgentRules": {
73127347
"policyId": {
73137348
"type": "string",

features/v2/application_security.feature

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ Feature: Application Security
1313
And a valid "appKeyAuth" key in the system
1414
And an instance of "ApplicationSecurity" API
1515

16+
@generated @skip @team:DataDog/asm-backend
17+
Scenario: Create a WAF Policy returns "Bad Request" response
18+
Given new "CreateApplicationSecurityWafPolicy" request
19+
And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}}
20+
When the request is sent
21+
Then the response status is 400 Bad Request
22+
23+
@generated @skip @team:DataDog/asm-backend
24+
Scenario: Create a WAF Policy returns "Concurrent Modification" response
25+
Given new "CreateApplicationSecurityWafPolicy" request
26+
And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}}
27+
When the request is sent
28+
Then the response status is 409 Concurrent Modification
29+
30+
@generated @skip @team:DataDog/asm-backend
31+
Scenario: Create a WAF Policy returns "Created" response
32+
Given new "CreateApplicationSecurityWafPolicy" request
33+
And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}}
34+
When the request is sent
35+
Then the response status is 201 Created
36+
1637
@generated @skip @team:DataDog/asm-backend
1738
Scenario: Create a WAF custom rule returns "Bad Request" response
1839
Given new "CreateApplicationSecurityWafCustomRule" request
@@ -84,6 +105,27 @@ Feature: Application Security
84105
When the request is sent
85106
Then the response status is 404 Not Found
86107

108+
@generated @skip @team:DataDog/asm-backend
109+
Scenario: Delete a WAF Policy returns "Concurrent Modification" response
110+
Given new "DeleteApplicationSecurityWafPolicy" request
111+
And request contains "policy_id" parameter from "REPLACE.ME"
112+
When the request is sent
113+
Then the response status is 409 Concurrent Modification
114+
115+
@generated @skip @team:DataDog/asm-backend
116+
Scenario: Delete a WAF Policy returns "No Content" response
117+
Given new "DeleteApplicationSecurityWafPolicy" request
118+
And request contains "policy_id" parameter from "REPLACE.ME"
119+
When the request is sent
120+
Then the response status is 204 No Content
121+
122+
@generated @skip @team:DataDog/asm-backend
123+
Scenario: Delete a WAF Policy returns "Not Found" response
124+
Given new "DeleteApplicationSecurityWafPolicy" request
125+
And request contains "policy_id" parameter from "REPLACE.ME"
126+
When the request is sent
127+
Then the response status is 404 Not Found
128+
87129
@generated @skip @team:DataDog/asm-backend
88130
Scenario: Delete a WAF exclusion filter returns "Concurrent Modification" response
89131
Given new "DeleteApplicationSecurityWafExclusionFilter" request
@@ -106,6 +148,13 @@ Feature: Application Security
106148
When the request is sent
107149
Then the response status is 204 OK
108150

151+
@generated @skip @team:DataDog/asm-backend
152+
Scenario: Get a WAF Policy returns "OK" response
153+
Given new "GetApplicationSecurityWafPolicy" request
154+
And request contains "policy_id" parameter from "REPLACE.ME"
155+
When the request is sent
156+
Then the response status is 200 OK
157+
109158
@generated @skip @team:DataDog/asm-backend
110159
Scenario: Get a WAF custom rule returns "OK" response
111160
Given new "GetApplicationSecurityWafCustomRule" request
@@ -140,6 +189,12 @@ Feature: Application Security
140189
When the request is sent
141190
Then the response status is 200 OK
142191

192+
@generated @skip @team:DataDog/asm-backend
193+
Scenario: List all WAF policies returns "OK" response
194+
Given new "ListApplicationSecurityWAFPolicies" request
195+
When the request is sent
196+
Then the response status is 200 OK
197+
143198
@team:DataDog/asm-backend
144199
Scenario: Update a WAF Custom Rule returns "Bad Request" response
145200
Given there is a valid "custom_rule" in the system
@@ -174,6 +229,38 @@ Feature: Application Security
174229
When the request is sent
175230
Then the response status is 200 OK
176231

232+
@generated @skip @team:DataDog/asm-backend
233+
Scenario: Update a WAF Policy returns "Bad Request" response
234+
Given new "UpdateApplicationSecurityWafPolicy" request
235+
And request contains "policy_id" parameter from "REPLACE.ME"
236+
And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}}
237+
When the request is sent
238+
Then the response status is 400 Bad Request
239+
240+
@generated @skip @team:DataDog/asm-backend
241+
Scenario: Update a WAF Policy returns "Concurrent Modification" response
242+
Given new "UpdateApplicationSecurityWafPolicy" request
243+
And request contains "policy_id" parameter from "REPLACE.ME"
244+
And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}}
245+
When the request is sent
246+
Then the response status is 409 Concurrent Modification
247+
248+
@generated @skip @team:DataDog/asm-backend
249+
Scenario: Update a WAF Policy returns "Not Found" response
250+
Given new "UpdateApplicationSecurityWafPolicy" request
251+
And request contains "policy_id" parameter from "REPLACE.ME"
252+
And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}}
253+
When the request is sent
254+
Then the response status is 404 Not Found
255+
256+
@generated @skip @team:DataDog/asm-backend
257+
Scenario: Update a WAF Policy returns "OK" response
258+
Given new "UpdateApplicationSecurityWafPolicy" request
259+
And request contains "policy_id" parameter from "REPLACE.ME"
260+
And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}}
261+
When the request is sent
262+
Then the response status is 200 OK
263+
177264
@team:DataDog/asm-backend
178265
Scenario: Update a WAF exclusion filter returns "Bad Request" response
179266
Given there is a valid "custom_rule" in the system

features/v2/given.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,18 @@
693693
"tag": "Application Security",
694694
"operationId": "CreateApplicationSecurityWafExclusionFilter"
695695
},
696+
{
697+
"parameters": [
698+
{
699+
"name": "body",
700+
"value": "{\n \"data\": {\n \"type\": \"policy\",\n \"attributes\": {\n \"name\": \"Test policy\",\n \"description\": \"This is a test policy.\",\n \"basedOn\": \"recommended\"\n }\n }\n}"
701+
}
702+
],
703+
"step": "there is a valid \"policy\" in the system",
704+
"key": "policy",
705+
"tag": "Application Security",
706+
"operationId": "CreateApplicationSecurityWafPolicy"
707+
},
696708
{
697709
"parameters": [
698710
{

features/v2/undo.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,43 @@
27152715
"type": "idempotent"
27162716
}
27172717
},
2718+
"ListApplicationSecurityWAFPolicies": {
2719+
"tag": "Application Security",
2720+
"undo": {
2721+
"type": "safe"
2722+
}
2723+
},
2724+
"CreateApplicationSecurityWafPolicy": {
2725+
"tag": "Application Security",
2726+
"undo": {
2727+
"operationId": "DeleteApplicationSecurityWafPolicy",
2728+
"parameters": [
2729+
{
2730+
"name": "policy_id",
2731+
"source": "data.id"
2732+
}
2733+
],
2734+
"type": "unsafe"
2735+
}
2736+
},
2737+
"DeleteApplicationSecurityWafPolicy": {
2738+
"tag": "Application Security",
2739+
"undo": {
2740+
"type": "idempotent"
2741+
}
2742+
},
2743+
"GetApplicationSecurityWafPolicy": {
2744+
"tag": "Application Security",
2745+
"undo": {
2746+
"type": "safe"
2747+
}
2748+
},
2749+
"UpdateApplicationSecurityWafPolicy": {
2750+
"tag": "Application Security",
2751+
"undo": {
2752+
"type": "idempotent"
2753+
}
2754+
},
27182755
"ListCSMThreatsAgentRules": {
27192756
"tag": "CSM Threats",
27202757
"undo": {

0 commit comments

Comments
 (0)