27 lines
607 B
Haskell
27 lines
607 B
Haskell
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)
|