Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type BlockWithRevocationId = (Block, ByteString)
- runAuthorizer :: BlockWithRevocationId -> [BlockWithRevocationId] -> Authorizer -> IO (Either ExecutionError AuthorizationSuccess)
- runAuthorizerWithLimits :: Limits -> BlockWithRevocationId -> [BlockWithRevocationId] -> Authorizer -> IO (Either ExecutionError AuthorizationSuccess)
- runAuthorizerNoTimeout :: Limits -> BlockWithRevocationId -> [BlockWithRevocationId] -> Authorizer -> Either ExecutionError AuthorizationSuccess
- data World = World {}
- computeAllFacts :: World -> StateT ComputeState (Either PureExecError) ()
- runFactGeneration :: Limits -> World -> Either PureExecError (Set Fact)
- data PureExecError
- = Facts
- | Iterations
- data AuthorizationSuccess = AuthorizationSuccess {}
- getBindings :: AuthorizationSuccess -> Set Bindings
- queryAuthorizerFacts :: AuthorizationSuccess -> Query -> Set Bindings
- getVariableValues :: (Ord t, FromValue t) => Set Bindings -> Text -> Set t
- getSingleVariableValue :: (Ord t, FromValue t) => Set Bindings -> Text -> Maybe t
Documentation
type BlockWithRevocationId = (Block, ByteString) Source #
:: BlockWithRevocationId | The authority block |
-> [BlockWithRevocationId] | The extra blocks |
-> Authorizer | A authorizer |
-> IO (Either ExecutionError AuthorizationSuccess) |
Given a series of blocks and an authorizer, ensure that all the checks and policies match
runAuthorizerWithLimits Source #
:: Limits | custom limits |
-> BlockWithRevocationId | The authority block |
-> [BlockWithRevocationId] | The extra blocks |
-> Authorizer | A authorizer |
-> IO (Either ExecutionError AuthorizationSuccess) |
Given a series of blocks and an authorizer, ensure that all the checks and policies match, with provided execution constraints
runAuthorizerNoTimeout :: Limits -> BlockWithRevocationId -> [BlockWithRevocationId] -> Authorizer -> Either ExecutionError AuthorizationSuccess Source #
computeAllFacts :: World -> StateT ComputeState (Either PureExecError) () Source #
runFactGeneration :: Limits -> World -> Either PureExecError (Set Fact) Source #
data PureExecError Source #
A subset of ExecutionError
that can only happen during fact generation
Instances
Eq PureExecError Source # | |
Defined in Auth.Biscuit.Datalog.ScopedExecutor (==) :: PureExecError -> PureExecError -> Bool # (/=) :: PureExecError -> PureExecError -> Bool # | |
Show PureExecError Source # | |
Defined in Auth.Biscuit.Datalog.ScopedExecutor showsPrec :: Int -> PureExecError -> ShowS # show :: PureExecError -> String # showList :: [PureExecError] -> ShowS # |
data AuthorizationSuccess Source #
Proof that a biscuit was authorized successfully. In addition to the matched
allow query
, the generated facts are kept around for further querying.
Since only authority facts can be trusted, they are kept separate.
AuthorizationSuccess | |
|
Instances
Eq AuthorizationSuccess Source # | |
Defined in Auth.Biscuit.Datalog.ScopedExecutor (==) :: AuthorizationSuccess -> AuthorizationSuccess -> Bool # (/=) :: AuthorizationSuccess -> AuthorizationSuccess -> Bool # | |
Show AuthorizationSuccess Source # | |
Defined in Auth.Biscuit.Datalog.ScopedExecutor showsPrec :: Int -> AuthorizationSuccess -> ShowS # show :: AuthorizationSuccess -> String # showList :: [AuthorizationSuccess] -> ShowS # |
getBindings :: AuthorizationSuccess -> Set Bindings Source #
Get the matched variables from the allow
query used to authorize the biscuit.
This can be used in conjuction with getVariableValues
or getSingleVariableValue
to extract the actual values
queryAuthorizerFacts :: AuthorizationSuccess -> Query -> Set Bindings Source #
Query the facts generated by the authority and authorizer blocks
during authorization. This can be used in conjuction with getVariableValues
and getSingleVariableValue
to retrieve actual values.
⚠ Only the facts generated by the authority and authorizer blocks are queried. Block facts are not queried (since they can't be trusted).
💁 If the facts you want to query are part of an allow query in the authorizer,
you can directly get values from AuthorizationSuccess
.