Immutable solution version
Debugging an unexpected Topaz policy decision with topaz authorizer eval and decisiontree
Complete solution
Debugging an unexpected Topaz policy decision with topaz authorizer eval and decisiontree: Per Topaz docs: reproduce the decision locally with authorizer eval, decisiontree, or query (use --template for the request shape) before editing the policy.
Per Topaz docs: reproduce the decision locally with authorizer eval, decisiontree, or query (use --template for the request shape) before editing the policy.
Context: Problem: Your Topaz authorizer returns an unexpected allow or deny and you need to see why. Debug it locally with the authorizer commands instead of guessing at the policy. topaz authorizer list-policies shows which policy modules are loaded. topaz authorizer get-policy with a field mask of id,raw prints the raw Rego for one module. topaz authorizer eval evaluates a single decision: pass an identitycontext (type plus identity) and a policycontext (the decisions array and the module path); run topaz authorizer eval --template first to print the JSON template. topaz authorizer decisiontree evaluates every module under a path root in one call, handy when one request fans out across several policies. topaz authorizer query issues a raw OPA query (for example x = input) and returns the variable bindings, so you can see exactly what the policy received. topaz authorizer test exec runs assertion files against the policy. Use the --insecure flag for local dev without TLS, and -N/--no-check to skip the local container status check.
Matched source
Source: Source: https://github.com/aserto-dev/topaz-website/blob/HEAD/docs/command-line-interface/topaz-cli/authorizer.mdx Original query: "Debugging an unexpected Topaz policy decision with topaz authorizer eval and decisiontree" Key terms: authorizer, debugging, decision, decisiontree, eval, policy, topaz, unexpected
Evidence
Source: Problem: Your Topaz authorizer returns an unexpected allow or deny and you need to see why. Debug it locally with the authorizer commands instead of guessing at the policy. topaz authorizer list-policies shows which policy modules are loaded. topaz authorizer get-policy with a field mask of id,raw prints the raw Rego for one module. topaz authorizer eval evaluates a single decision: pass an identitycontext (type plus identity) and a policycontext (the decisions array and the module path); run topaz authorizer eval --template first to print the JSON template. topaz authorizer decisiontree evaluates every module under a path root in one call, handy when one request fans out across several policies. topaz authorizer query issues a raw OPA query (for example x = input) and returns the variable bindings, so you can see exactly what the policy received. topaz authorizer test exec runs assertion files against the policy. Use the --insecure flag for local dev without TLS, and -N/--no-check to skip the local container status check.
Verified resolution: Per Topaz docs: reproduce the decision locally with authorizer eval, decisiontree, or query (use --template for the request shape) before editing the policy.
Source URL: https://github.com/aserto-dev/topaz-website/blob/HEAD/docs/command-line-interface/topaz-cli/authorizer.mdx
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_dwNAYhd2dqa8HNFqPPY7dw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Debugging an unexpected Topaz policy decision with topaz authorizer eval and decisiontree <span>— Vectle</span></a>