Copyright | © Clément Delafargue 2021 |
---|---|
License | MIT |
Maintainer | clement@delafargue.name |
Safe Haskell | None |
Language | Haskell2010 |
Conversion functions between biscuit components and protobuf-encoded components
Synopsis
- data Symbols
- buildSymbolTable :: Symbols -> Block -> BlockSymbols
- extractSymbols :: [Block] -> Symbols
- pbToBlock :: Symbols -> Block -> Either String Block
- blockToPb :: Symbols -> Block -> (BlockSymbols, Block)
- pbToSignedBlock :: SignedBlock -> Either String SignedBlock
- signedBlockToPb :: SignedBlock -> SignedBlock
- pbToProof :: Proof -> Either String (Either Signature SecretKey)
Documentation
buildSymbolTable :: Symbols -> Block -> BlockSymbols Source #
Given existing symbols and a biscuit block, compute the symbol table for the given block. Already existing symbols won't be included
extractSymbols :: [Block] -> Symbols Source #
Given existing symbols and a series of protobuf blocks, compute the complete symbol mapping
pbToBlock :: Symbols -> Block -> Either String Block Source #
Parse a protobuf block into a proper biscuit block
blockToPb :: Symbols -> Block -> (BlockSymbols, Block) Source #
Turn a biscuit block into a protobuf block, for serialization, along with the newly defined symbols
pbToSignedBlock :: SignedBlock -> Either String SignedBlock Source #
Parse a protobuf signed block into a signed biscuit block