Skip to content

Commit

Permalink
fix: remove use of rego keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
didroe committed Jul 30, 2024
1 parent ced5314 commit e163d89
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 @@ -97,7 +97,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 @@ -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
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 @@ -135,13 +135,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 e163d89

Please sign in to comment.