Skip to content

Commit

Permalink
fix: remove use of rego keyword (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
didroe authored Jul 30, 2024
1 parent 6b61395 commit 5ed94a9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pkg/commands/process/settings/policies/privacy_report.rego
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import rego.v1

import data.bearer.common

contains(arr, elem) if {
array_contains(arr, elem) if {
arr[_] = elem
}

Expand Down Expand Up @@ -38,7 +38,7 @@ items contains item if {
some location in detector.locations

not location.subject_name
not contains(data_types_with_subject, data_type.name)
not array_contains(data_types_with_subject, data_type.name)

item := {
"name": data_type.name,
Expand Down
12 changes: 6 additions & 6 deletions pkg/commands/process/settings/policies/risk_policy.rego
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import rego.v1

import data.bearer.common

contains(arr, elem) if {
array_contains(arr, elem) if {
arr[_] = elem
}

Expand Down Expand Up @@ -108,7 +108,7 @@ policy_failure contains item if {
some detector in presence_failures
some data_type_location in detector.locations
some data_type in data_type_location.data_types
contains(input.rule.only_data_types, data_type.name)
array_contains(input.rule.only_data_types, data_type.name)

item := data.bearer.common.build_local_item(data_type_location, data_type)
}
Expand All @@ -119,7 +119,7 @@ policy_failure contains item if {
some detector in presence_failures
some data_type_location in detector.locations
some data_type in data_type_location.data_types
not contains(input.rule.skip_data_types, data_type.name)
not array_contains(input.rule.skip_data_types, data_type.name)

item := data.bearer.common.build_local_item(data_type_location, data_type)
}
Expand All @@ -146,13 +146,13 @@ policy_failure contains item if {
policy_failure contains item if {
input.rule.trigger.match_on == "stored_data_types"

contains(input.rule.languages, input.dataflow.data_types[_].detectors[_].name)
array_contains(input.rule.languages, input.dataflow.data_types[_].detectors[_].name)
data_type = input.dataflow.data_types[_]
not contains(input.rule.skip_data_types, data_type.name)
not array_contains(input.rule.skip_data_types, data_type.name)

some detector in data_type.detectors

contains(input.rule.detectors, detector.name)
array_contains(input.rule.detectors, detector.name)

location = detector.locations[_]
count(input.rule.auto_encrypt_prefix) != 0
Expand Down
10 changes: 5 additions & 5 deletions pkg/commands/process/settings/policies/verifier_policy.rego
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import rego.v1

import data.bearer.common

contains(arr, elem) if {
array_contains(arr, elem) if {
# arr # ensure array is defined
arr[_] = elem
}
Expand All @@ -13,11 +13,11 @@ policy_failure contains item if {
input.rule.trigger == "stored_data_types"

data_type = input.dataflow.data_types[_]
not contains(input.rule.skip_data_types, data_type.name)
not array_contains(input.rule.skip_data_types, data_type.name)

some detector in data_type.detectors

contains(input.rule.detectors, detector.name)
array_contains(input.rule.detectors, detector.name)

location = detector.locations[_]
count(input.rule.auto_encrypt_prefix) != 0
Expand Down Expand Up @@ -55,10 +55,10 @@ policy_failure contains item if {

data_type = input.dataflow.data_types[_]

not contains(input.rule.skip_data_types, data_type.name)
not array_contains(input.rule.skip_data_types, data_type.name)
some detector in data_type.detectors

contains(input.rule.detectors, detector.name)
array_contains(input.rule.detectors, detector.name)

location = detector.locations[_]

Expand Down

0 comments on commit 5ed94a9

Please sign in to comment.