Skip to content

Commit

Permalink
MINOR: add new comparison operators (>=, <=) (#199)
Browse files Browse the repository at this point in the history
This commit adds the new comparison operators greaterEqual and
lesserEqual to the documentation. It  also expands the rule validation
to support the new value type (valueInt).
  • Loading branch information
daniel-corbett authored Sep 27, 2023
1 parent e4f57be commit d01f1f7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions docs/resources/corp_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ Optional:

- `conditions` (Block Set, Max: 10) Conditions (see [below for nested schema](#nestedblock--conditions--conditions))
- `field` (String) types:
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueIp, signalType, value)
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueInt, valueIp, signalType, value)
- multival - (signal, requestHeader, queryParameter, postParameter, requestCookie, responseHeader)
- `group_operator` (String) type: group, multival - Conditions that must be matched when evaluating the request (all, any)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, inList, notInList)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, inList, notInList)
- `value` (String) type: single - See request fields (https://docs.signalsciences.net/using-signal-sciences/features/rules/#request-fields)

<a id="nestedblock--conditions--conditions"></a>
Expand All @@ -106,10 +106,10 @@ Optional:

- `conditions` (Block Set, Max: 10) Conditions (see [below for nested schema](#nestedblock--conditions--conditions--conditions))
- `field` (String) types:
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueIp, signalType, value)
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueInt, valueIp, signalType, value)
- multival - (signal, requestHeader, queryParameter, postParameter, requestCookie, responseHeader)
- `group_operator` (String) type: group, multival - Conditions that must be matched when evaluating the request (all, any)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, inList, notInList)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, inList, notInList)
- `value` (String) type: single - See request fields (https://docs.fastly.com/signalsciences/using-signal-sciences/rules/defining-rule-conditions/#fields)

<a id="nestedblock--conditions--conditions--conditions"></a>
Expand All @@ -122,10 +122,10 @@ Required:
Optional:

- `field` (String) types:
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueIp, signalType, value)
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueInt, valueIp, signalType, value)
- multival - (signal, requestHeader, queryParameter, postParameter, requestCookie, responseHeader)
- `group_operator` (String) type: group, multival - Conditions that must be matched when evaluating the request (all, any)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, inList, notInList)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, inList, notInList)
- `value` (String) type: single - See request fields (https://docs.fastly.com/signalsciences/using-signal-sciences/rules/defining-rule-conditions/#fields)

## Import
Expand Down
12 changes: 6 additions & 6 deletions docs/resources/site_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ Optional:

- `conditions` (Block Set, Max: 10) Conditions (see [below for nested schema](#nestedblock--conditions--conditions))
- `field` (String) types:
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueIp, signalType, value)
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueInt, valueIp, signalType, value)
- multival - (signal, requestHeader, queryParameter, postParameter, requestCookie, responseHeader)
- `group_operator` (String) type: group, multival - Conditions that must be matched when evaluating the request (all, any)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)
- `value` (String) type: single - See request fields (https://docs.fastly.com/signalsciences/using-signal-sciences/rules/defining-rule-conditions/#fields)

<a id="nestedblock--conditions--conditions"></a>
Expand All @@ -215,10 +215,10 @@ Optional:

- `conditions` (Block Set, Max: 10) Conditions (see [below for nested schema](#nestedblock--conditions--conditions--conditions))
- `field` (String) types:
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueIp, signalType, value)
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueInt, valueIp, signalType, value)
- multival - (signal, requestHeader, queryParameter, postParameter, requestCookie, responseHeader)
- `group_operator` (String) type: group, multival - Conditions that must be matched when evaluating the request (all, any)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)
- `value` (String) type: single - See request fields (https://docs.fastly.com/signalsciences/using-signal-sciences/rules/defining-rule-conditions/#fields)

<a id="nestedblock--conditions--conditions--conditions"></a>
Expand All @@ -231,10 +231,10 @@ Required:
Optional:

- `field` (String) types:
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueIp, signalType, value)
- single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueInt, valueIp, signalType, value)
- multival - (signal, requestHeader, queryParameter, postParameter, requestCookie, responseHeader)
- `group_operator` (String) type: group, multival - Conditions that must be matched when evaluating the request (all, any)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)
- `operator` (String) type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)
- `value` (String) type: single - See request fields (https://docs.fastly.com/signalsciences/using-signal-sciences/rules/defining-rule-conditions/#fields)


Expand Down
2 changes: 1 addition & 1 deletion provider/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ var siteImporter = schema.ResourceImporter{

var KnownSingleConditionFields = []string{
"scheme", "method", "path", "useragent", "domain", "ip", "responseCode", "agentname",
"paramname", "paramvalue", "country", "name", "valueString", "valueIp", "signalType",
"paramname", "paramvalue", "country", "name", "valueString", "valueInt", "valueIp", "signalType",
"value",
}

Expand Down
6 changes: 3 additions & 3 deletions provider/resource_corp_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func resourceCorpRule() *schema.Resource {
},
"operator": {
Type: schema.TypeString,
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, inList, notInList)",
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, inList, notInList)",
Optional: true,
},
"group_operator": {
Expand Down Expand Up @@ -124,7 +124,7 @@ func resourceCorpRule() *schema.Resource {
},
"operator": {
Type: schema.TypeString,
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, inList, notInList)",
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, inList, notInList)",
Optional: true,
},
"group_operator": {
Expand Down Expand Up @@ -157,7 +157,7 @@ func resourceCorpRule() *schema.Resource {
},
"operator": {
Type: schema.TypeString,
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, inList, notInList)",
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, inList, notInList)",
Optional: true,
},
"group_operator": {
Expand Down
6 changes: 3 additions & 3 deletions provider/resource_site_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func resourceSiteRule() *schema.Resource {
},
"operator": {
Type: schema.TypeString,
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)",
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)",
Optional: true,
},
"group_operator": {
Expand Down Expand Up @@ -139,7 +139,7 @@ func resourceSiteRule() *schema.Resource {
},
"operator": {
Type: schema.TypeString,
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)",
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)",
Optional: true,
},
"group_operator": {
Expand Down Expand Up @@ -172,7 +172,7 @@ func resourceSiteRule() *schema.Resource {
},
"operator": {
Type: schema.TypeString,
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)",
Description: "type: single - (equals, doesNotEqual, contains, doesNotContain, greaterEqual, lesserEqual, like, notLike, exists, doesNotExist, matches, doesNotMatch, inList, notInList)",
Optional: true,
},
"group_operator": {
Expand Down

0 comments on commit d01f1f7

Please sign in to comment.