Skip to content

Commit 68ed1e3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6d1d3de of spec repo
1 parent b35ba40 commit 68ed1e3

File tree

8 files changed

+85
-5
lines changed

8 files changed

+85
-5
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4345,6 +4345,10 @@ components:
43454345
- ip_match
43464346
- "!ip_match"
43474347
- capture_data
4348+
- exists
4349+
- "!exists"
4350+
- equals
4351+
- "!equals"
43484352
example: "match_regex"
43494353
type: string
43504354
x-enum-varnames:
@@ -4359,6 +4363,10 @@ components:
43594363
- IP_MATCH
43604364
- NOT_IP_MATCH
43614365
- CAPTURE_DATA
4366+
- EXISTS
4367+
- NOT_EXISTS
4368+
- EQUALS
4369+
- NOT_EQUALS
43624370
ApplicationSecurityWafCustomRuleConditionOptions:
43634371
description: Options for the operator of this condition.
43644372
properties:
@@ -4399,6 +4407,8 @@ components:
43994407
description: "Regex to use with the condition. Only used with match_regex and !match_regex operator."
44004408
example: "path.*"
44014409
type: string
4410+
type:
4411+
$ref: "#/components/schemas/ApplicationSecurityWafCustomRuleConditionParametersType"
44024412
value:
44034413
description: |-
44044414
Store the captured value in the specified tag name. Only used with the capture_data operator.
@@ -4407,6 +4417,22 @@ components:
44074417
required:
44084418
- inputs
44094419
type: object
4420+
ApplicationSecurityWafCustomRuleConditionParametersType:
4421+
description: The type of the value to compare against. Only used with the equals and !equals operator.
4422+
enum:
4423+
- boolean
4424+
- signed
4425+
- unsigned
4426+
- float
4427+
- string
4428+
example: "string"
4429+
type: string
4430+
x-enum-varnames:
4431+
- BOOLEAN
4432+
- SIGNED
4433+
- UNSIGNED
4434+
- FLOAT
4435+
- STRING
44104436
ApplicationSecurityWafCustomRuleCreateAttributes:
44114437
description: "Create a new WAF custom rule."
44124438
properties:

examples/v2/application-security/CreateApplicationSecurityWafCustomRule.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const params: v2.ApplicationSecurityApiCreateApplicationSecurityWafCustomRuleReq
3737
minLength: 0,
3838
},
3939
regex: "path.*",
40+
type: "string",
4041
value: "custom_tag",
4142
},
4243
},

features/v2/application_security.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ Feature: Application Security
1616
@generated @skip @team:DataDog/asm-backend
1717
Scenario: Create a WAF custom rule returns "Bad Request" response
1818
Given new "CreateApplicationSecurityWafCustomRule" request
19-
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
19+
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
2020
When the request is sent
2121
Then the response status is 400 Bad Request
2222

2323
@generated @skip @team:DataDog/asm-backend
2424
Scenario: Create a WAF custom rule returns "Concurrent Modification" response
2525
Given new "CreateApplicationSecurityWafCustomRule" request
26-
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
26+
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
2727
When the request is sent
2828
Then the response status is 409 Concurrent Modification
2929

3030
@generated @skip @team:DataDog/asm-backend
3131
Scenario: Create a WAF custom rule returns "Created" response
3232
Given new "CreateApplicationSecurityWafCustomRule" request
33-
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
33+
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
3434
When the request is sent
3535
Then the response status is 201 Created
3636

@@ -153,15 +153,15 @@ Feature: Application Security
153153
Scenario: Update a WAF Custom Rule returns "Concurrent Modification" response
154154
Given new "UpdateApplicationSecurityWafCustomRule" request
155155
And request contains "custom_rule_id" parameter from "REPLACE.ME"
156-
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
156+
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
157157
When the request is sent
158158
Then the response status is 409 Concurrent Modification
159159

160160
@generated @skip @team:DataDog/asm-backend
161161
Scenario: Update a WAF Custom Rule returns "Not Found" response
162162
Given new "UpdateApplicationSecurityWafCustomRule" request
163163
And request contains "custom_rule_id" parameter from "REPLACE.ME"
164-
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
164+
And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}}
165165
When the request is sent
166166
Then the response status is 404 Not Found
167167

packages/datadog-api-client-v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,7 @@ export { ApplicationSecurityWafCustomRuleConditionInputAddress } from "./models/
13931393
export { ApplicationSecurityWafCustomRuleConditionOperator } from "./models/ApplicationSecurityWafCustomRuleConditionOperator";
13941394
export { ApplicationSecurityWafCustomRuleConditionOptions } from "./models/ApplicationSecurityWafCustomRuleConditionOptions";
13951395
export { ApplicationSecurityWafCustomRuleConditionParameters } from "./models/ApplicationSecurityWafCustomRuleConditionParameters";
1396+
export { ApplicationSecurityWafCustomRuleConditionParametersType } from "./models/ApplicationSecurityWafCustomRuleConditionParametersType";
13961397
export { ApplicationSecurityWafCustomRuleCreateAttributes } from "./models/ApplicationSecurityWafCustomRuleCreateAttributes";
13971398
export { ApplicationSecurityWafCustomRuleCreateData } from "./models/ApplicationSecurityWafCustomRuleCreateData";
13981399
export { ApplicationSecurityWafCustomRuleCreateRequest } from "./models/ApplicationSecurityWafCustomRuleCreateRequest";

packages/datadog-api-client-v2/models/ApplicationSecurityWafCustomRuleConditionOperator.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export type ApplicationSecurityWafCustomRuleConditionOperator =
2222
| typeof IP_MATCH
2323
| typeof NOT_IP_MATCH
2424
| typeof CAPTURE_DATA
25+
| typeof EXISTS
26+
| typeof NOT_EXISTS
27+
| typeof EQUALS
28+
| typeof NOT_EQUALS
2529
| UnparsedObject;
2630
export const MATCH_REGEX = "match_regex";
2731
export const NOT_MATCH_REGEX = "!match_regex";
@@ -34,3 +38,7 @@ export const NOT_EXACT_MATCH = "!exact_match";
3438
export const IP_MATCH = "ip_match";
3539
export const NOT_IP_MATCH = "!ip_match";
3640
export const CAPTURE_DATA = "capture_data";
41+
export const EXISTS = "exists";
42+
export const NOT_EXISTS = "!exists";
43+
export const EQUALS = "equals";
44+
export const NOT_EQUALS = "!equals";

packages/datadog-api-client-v2/models/ApplicationSecurityWafCustomRuleConditionParameters.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
import { ApplicationSecurityWafCustomRuleConditionInput } from "./ApplicationSecurityWafCustomRuleConditionInput";
77
import { ApplicationSecurityWafCustomRuleConditionOptions } from "./ApplicationSecurityWafCustomRuleConditionOptions";
8+
import { ApplicationSecurityWafCustomRuleConditionParametersType } from "./ApplicationSecurityWafCustomRuleConditionParametersType";
89

910
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1011

@@ -33,6 +34,10 @@ export class ApplicationSecurityWafCustomRuleConditionParameters {
3334
* Regex to use with the condition. Only used with match_regex and !match_regex operator.
3435
*/
3536
"regex"?: string;
37+
/**
38+
* The type of the value to compare against. Only used with the equals and !equals operator.
39+
*/
40+
"type"?: ApplicationSecurityWafCustomRuleConditionParametersType;
3641
/**
3742
* Store the captured value in the specified tag name. Only used with the capture_data operator.
3843
*/
@@ -75,6 +80,10 @@ export class ApplicationSecurityWafCustomRuleConditionParameters {
7580
baseName: "regex",
7681
type: "string",
7782
},
83+
type: {
84+
baseName: "type",
85+
type: "ApplicationSecurityWafCustomRuleConditionParametersType",
86+
},
7887
value: {
7988
baseName: "value",
8089
type: "string",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* The type of the value to compare against. Only used with the equals and !equals operator.
11+
*/
12+
13+
export type ApplicationSecurityWafCustomRuleConditionParametersType =
14+
| typeof BOOLEAN
15+
| typeof SIGNED
16+
| typeof UNSIGNED
17+
| typeof FLOAT
18+
| typeof STRING
19+
| UnparsedObject;
20+
export const BOOLEAN = "boolean";
21+
export const SIGNED = "signed";
22+
export const UNSIGNED = "unsigned";
23+
export const FLOAT = "float";
24+
export const STRING = "string";

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,6 +3807,17 @@ const enumsMap: { [key: string]: any[] } = {
38073807
"ip_match",
38083808
"!ip_match",
38093809
"capture_data",
3810+
"exists",
3811+
"!exists",
3812+
"equals",
3813+
"!equals",
3814+
],
3815+
ApplicationSecurityWafCustomRuleConditionParametersType: [
3816+
"boolean",
3817+
"signed",
3818+
"unsigned",
3819+
"float",
3820+
"string",
38103821
],
38113822
ApplicationSecurityWafCustomRuleTagsCategory: [
38123823
"attack_attempt",

0 commit comments

Comments
 (0)