How myers404/authz-analyzer works
authz-analyzer is a Boolean authorization-policy analyzer exposed through a CLI and Python API. The principal workflow accepts JSON policy documents or expression strings, parses/decodes them into a typed IR, and answers verify, diff, explain, or batch-report queries using exact BDDs; results include counterexamples, explanations, and diagnostics. The graph preserves the documented query modes and result/metadata path. Edges reflect excerpts, SOURCE INDEX references, or README statements; unsampled details are not inferred.
Main entry points: queries.py Query orchestration · cli.py CLI commands · json_codec.py JSON codec · expressions.py Expression model
Components 13
Interfaces
- CLI commands
src/authz_analyzer/cli.py - Python API
src/authz_analyzer/__init__.py
Policy Inputs
- Expression lexer
src/authz_analyzer/lexer.py - Expression parser
src/authz_analyzer/parser.py - JSON codec
src/authz_analyzer/json_codec.py - Policy IR
src/authz_analyzer/ir.py - Expression model
src/authz_analyzer/expressions.py
Analysis
- Query orchestration
src/authz_analyzer/queries.py - BDD compiler
src/authz_analyzer/compile.py - BDD engine
src/authz_analyzer/bdd.py - Minimal explanations
src/authz_analyzer/explain.py
Results
- Results and encoding
src/authz_analyzer/results.py
Other components
- Caller
Connections 20
- Caller → CLI commands: runs commands
README.md - Caller → Python API: calls API
README.md - CLI commands → JSON codec: loads documents
src/authz_analyzer/cli.py - CLI commands → Expression parser: parses expressions
src/authz_analyzer/cli.py - CLI commands → Query orchestration: dispatches queries
src/authz_analyzer/cli.py - CLI commands → Results and encoding: formats output
src/authz_analyzer/cli.py - Python API → Query orchestration: exposes queries
src/authz_analyzer/__init__.py - JSON codec → Policy IR: builds document
src/authz_analyzer/json_codec.py - JSON codec → Expression model: builds expressions
src/authz_analyzer/json_codec.py - Expression parser → Expression lexer: tokenizes input
src/authz_analyzer/parser.py - Expression parser → Expression model: builds AST
src/authz_analyzer/parser.py - Policy IR → Expression model: stores expressions
src/authz_analyzer/ir.py - Query orchestration → BDD compiler: compiles formulas
src/authz_analyzer/queries.py - BDD compiler → BDD engine: builds diagrams
src/authz_analyzer/compile.py - BDD compiler → Expression model: traverses AST
src/authz_analyzer/compile.py - Query orchestration → Minimal explanations: requests explanations
src/authz_analyzer/queries.py - Minimal explanations → BDD engine: analyzes BDDs
src/authz_analyzer/explain.py - Query orchestration → Results and encoding: returns outcomes
src/authz_analyzer/queries.py - Query orchestration → JSON codec: loads documents
src/authz_analyzer/queries.py - Results and encoding → BDD engine: reports diagnostics