Skip to content

Commit

Permalink
translate legacy requests wip
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Feb 26, 2024
1 parent f331b89 commit d92e47f
Show file tree
Hide file tree
Showing 10 changed files with 20,664 additions and 75 deletions.
4 changes: 4 additions & 0 deletions apps/policy-engine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ policy-engine/rego/translate:
ts-node -r tsconfig-paths/register \
--project ${POLICY_ENGINE_PROJECT_DIR}/tsconfig.app.json ${POLICY_ENGINE_PROJECT_DIR}/src/opa/script/translate-legacy-policy.script.ts

policy-engine/rego/evaluation:
npx dotenv -e ${POLICY_ENGINE_PROJECT_DIR}/.env -- \
ts-node -r tsconfig-paths/register \
--project ${POLICY_ENGINE_PROJECT_DIR}/tsconfig.app.json ${POLICY_ENGINE_PROJECT_DIR}/src/opa/script/evaluate-legacy-policy.script.ts

policy-engine/rego/test:
opa test \
Expand Down

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions apps/policy-engine/src/opa/rego/generated/missing-rules.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

permit[{"policyId": "call-contract-custom", "policyName": "call-contract-custom"}] = reason {
checkResourceIntegrity
checkAction({"signTransaction"})
checkIntentType({"callContract"})
checkPrincipalId({"auth0|62e1d7ca04533b042cb42419"})
checkIntentContract({"eip155:137:0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad"})
checkChainId({"137"})
reason = {"type": "permit", "policyId": "call-contract-custom", "policyName": "call-contract-custom", "approvalsSatisfied": [], "approvalsMissing": []}
}
Loading

0 comments on commit d92e47f

Please sign in to comment.