-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Evaluation is responsible to enforce casing (#550)
* utils for case insentivity, modified test data and first passing test * renamed util for case insensitive find, more tests passing * added missing bracket * fixed rebasing issue * added entity querying package * removed unused code, added comments * added lowercase where needed * fixed import path for resources in e2e tests * access to entity only go through to query lib * remove entityInput file, corrected comments over get.account query
- Loading branch information
Showing
38 changed files
with
807 additions
and
289 deletions.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
apps/policy-engine/src/resource/open-policy-agent/rego/__test__/criteria/approval_test.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
...licy-engine/src/resource/open-policy-agent/rego/__test__/criteria/intent/source_test.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
apps/policy-engine/src/resource/open-policy-agent/rego/__test__/criteria/principal_test.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 13 additions & 14 deletions
27
apps/policy-engine/src/resource/open-policy-agent/rego/__test__/criteria/resource_test.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
package main | ||
|
||
import data.armory.entities.get | ||
|
||
test_resource { | ||
account = resource with input as requestWithEip1559Transaction with data.entities as entities | ||
account == { | ||
"id": "eip155:eoa:0xddcf208f219a6e6af072f2cfdc615b2c1805f98e", | ||
"address": "0xddcf208f219a6e6af072f2cfdc615b2c1805f98e", | ||
account = get.account(input.resource.uid) with input as requestWithEip1559Transaction with data.entities as entities | ||
|
||
expected := { | ||
"id": "eip155:eoa:0xDDcf208f219a6e6af072f2cfdc615b2c1805f98e", | ||
"address": "0xddcf208F219a6e6af072f2cfdc615b2c1805f98e", | ||
"accountType": "eoa", | ||
"assignees": ["test-bob-uid", "test-alice-uid", "test-foo-uid", "test-bar-uid"], | ||
"assignees": ["test-bOb-uid", "test-alicE-uid", "test-foo-uid", "test-bar-uid"], | ||
"groups": {"test-account-group-ONE-uid"}, | ||
} | ||
account == expected | ||
|
||
groups = accountGroups with input as requestWithEip1559Transaction with data.entities as entities | ||
groups == {"test-account-group-one-uid"} | ||
|
||
accountGroupsById = getAccountGroups("eip155:eoa:0xddcf208f219a6e6af072f2cfdc615b2c1805f98e") with input as requestWithEip1559Transaction with data.entities as entities | ||
accountGroupsById == {"test-account-group-one-uid"} | ||
|
||
checkAccountId({"eip155:eoa:0xddcf208f219a6e6af072f2cfdc615b2c1805f98e"}) with input as requestWithEip1559Transaction with data.entities as entities | ||
checkAccountAddress({"0xddcf208f219a6e6af072f2cfdc615b2c1805f98e"}) with input as requestWithEip1559Transaction with data.entities as entities | ||
checkAccountId({"eip155:eoa:0xdDcF208f219a6e6af072f2cfdc615b2c1805F98E"}) with input as requestWithEip1559Transaction with data.entities as entities | ||
checkAccountAddress({"0xdDCf208f219a6e6af072f2cfdc615b2c1805f98e"}) with input as requestWithEip1559Transaction with data.entities as entities | ||
checkAccountType({"eoa"}) with input as requestWithEip1559Transaction with data.entities as entities | ||
checkAccountGroup({"test-account-group-one-uid"}) with input as requestWithEip1559Transaction with data.entities as entities | ||
checkAccountGroup({"teST-account-groUp-one-uid"}) with input as requestWithEip1559Transaction with data.entities as entities | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 9 additions & 6 deletions
15
apps/policy-engine/src/resource/open-policy-agent/rego/__test__/utils_test.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.