Copyright | (c) 2015 Julien Tanguy |
---|---|
License | BSD3 |
Maintainer | julien.tanguy@jhome.fr |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Pure haskell implementations of macaroons.
Warning: this implementation has not been audited by security experts. Do not use in production
References:
- Macaroons: Cookies with Contextual Caveats for Decentralized Authorization in the Cloud http://research.google.com/pubs/pub41892.html
- Time for better security in NoSQL http://hackingdistributed.com/2014/11/23/macaroons-in-hyperdex
- data Macaroon
- data Caveat
- type Secret = ByteString
- type Key = ByteString
- type Location = ByteString
- type Sig = ByteString
- location :: Macaroon -> Location
- identifier :: Macaroon -> Key
- caveats :: Macaroon -> [Caveat]
- signature :: Macaroon -> Sig
- cl :: Caveat -> Location
- cid :: Caveat -> Key
- vid :: Caveat -> Key
- create :: Secret -> Key -> Location -> Macaroon
- inspect :: Macaroon -> String
- addFirstPartyCaveat :: Key -> Macaroon -> Macaroon
- module Crypto.Macaroon.Serializer.Base64
- module Crypto.Macaroon.Verifier
Types
data Macaroon
Main structure of a macaroon
data Caveat
Caveat structure
type Secret = ByteString
Type alias for Macaroons secret keys
type Key = ByteString
Type alias for Macaroons and Caveat and identifiers
type Location = ByteString
Type alias for Macaroons and Caveat locations
type Sig = ByteString
Type alias for Macaroons signatures
Accessing functions
Macaroons
identifier :: Macaroon -> Key
Macaroon Identifier
Caveats
Create Macaroons
create :: Secret -> Key -> Location -> Macaroon
Create a Macaroon from its key, identifier and location
addFirstPartyCaveat :: Key -> Macaroon -> Macaroon
Add a first party Caveat to a Macaroon, with its identifier
Serialize
Verify
module Crypto.Macaroon.Verifier