27 lines
607 B
Haskell
Raw Normal View History

module Main where
import MiniAccessPolicy.Policy
( accessMatrix
, buildApprovalReport
, ownershipIndex
, parseRequest
, renderReport
)
import System.Environment (getArgs)
import System.Exit (die)
main :: IO ()
main = do
args <- getArgs
let inputArg =
case args of
[] -> "api:production:platform,security"
firstArg : _ -> firstArg
case parseRequest inputArg of
Left err -> die err
Right request ->
case buildApprovalReport ownershipIndex accessMatrix request of
Left err -> die err
Right report -> putStrLn (renderReport report)