packages feed

persona 0.1.0.0 → 0.2.0.0

raw patch · 2 files changed

+13/−13 lines, 2 filesdep ~jose

Dependency ranges changed: jose

Files

persona.cabal view
@@ -1,5 +1,5 @@ name:                persona-version:             0.1.0.0+version:             0.2.0.0 synopsis:            Persona (BrowserID) library description:         Persona (BrowesrID) library homepage:            https://github.com/frasertweedale/hs-persona@@ -10,7 +10,7 @@   README.md author:              Fraser Tweedale maintainer:          frase@frase.id.au-copyright:           Copyright (C) 2013, 2014  Fraser Tweedale+copyright:           Copyright (C) 2013, 2014, 2015  Fraser Tweedale category:            Web build-type:          Simple cabal-version:       >=1.10@@ -34,7 +34,7 @@     , text >= 0.11     , time >= 1.4     , unordered-containers >= 0.2-    , jose >= 0.3.38.0+    , jose >= 0.4    exposed-modules:     Crypto.Persona
src/Crypto/Persona.hs view
@@ -1,5 +1,5 @@ -- This file is part of persona - Persona (BrowserID) library--- Copyright (C) 2013, 2014  Fraser Tweedale+-- Copyright (C) 2013, 2014, 2015, 2016  Fraser Tweedale -- -- persona is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by@@ -48,7 +48,7 @@  import Control.Applicative -import Control.Lens hiding ((.=))+import Control.Lens hiding (iat, (.=)) import Data.Aeson import Data.Default.Class (def) import qualified Data.Text as T@@ -83,7 +83,7 @@  -- | Basic /support document/. ----- See https://developer.mozilla.org/en-US/Persona/.well-known-browserid.+-- See <https://developer.mozilla.org/en-US/Persona/.well-known-browserid>. -- data SupportDocument = SupportDocument     { _publicKey       :: JWK'@@ -113,7 +113,8 @@ -- a move to the JSON Web Key (JWK) format. -- supportDocument :: JWK' -> RelativeURI -> RelativeURI -> Maybe SupportDocument-supportDocument k a p = publicKey public $ SupportDocument k a p+supportDocument k a p =+  SupportDocument k a p & publicKey (preview asPublicKey)   -- | /Delegated support document/@@ -150,9 +151,8 @@ -- | Create an identity assertion. -- certify-  :: CPRG g-  => g-  -> JWK'         -- ^ Signing key+  :: MonadRandom m+  => JWK'         -- ^ Signing key   -> StringOrURI  -- ^ Issuer   -> UTCTime   -- ^ Current time.  Will be used for the "iat" claim and in the@@ -162,9 +162,9 @@   -- "exp" claim.   -> Value        -- ^ User public key object   -> Principal    -- ^ Principal-  -> (Either Error JWT, g)-certify g k iss t dur pk principal =-  createJWSJWT g (toJWK k) header claims+  -> m (Either Error JWT)+certify k iss t dur pk principal =+  createJWSJWT (toJWK k) header claims   where   claims = emptyClaimsSet     & claimIss .~ Just iss