hails-0.1.1: IFC enforcing web platform framework

Safe HaskellUnsafe

Hails.Database.MongoDB.TCB.Access

Contents

Synopsis

Policy application

applyRawPolicyP :: LabelState l p s => p -> CollectionPolicy l -> Document l -> LIO l p s (LabeledDocument l)Source

Apply a raw field/column policy to all the fields of type PolicyLabeled, and then apply the raw document/row policy. It must be that every labeled value in the document (including the document itself) have a label that is below the clearance of the collection. However, this is not checked by applyRawPolicyP. Instead insert (and similar operators) performs this check.

applyRawPolicyTCB :: LabelState l p s => CollectionPolicy l -> Document l -> LIO l p s (LabeledDocument l)Source

Same as applyRawPolicy, but ignores the current label and clearance when applying policies.

Running actions against DB

accessTCB :: LabelState l p s => Pipe -> AccessMode -> Database l -> Action l p s a -> LIO l p s (Either Failure a)Source

Run action against database on server at other end of pipe. Use access mode for any reads and writes. Return Left on connection failure or read/write failure. The current label is raised to the the join of the database label and current label.