-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | An implementation of the OpenID-2.0 spec.
--
-- An implementation of the OpenID-2.0 spec.
@package openid
@version 0.2.0.2
module Network.OpenID.SSL
data SSLHandle
sslConnect :: Socket -> IO (Maybe SSLHandle)
instance Stream SSLHandle
module Text.XRDS
type XRDS = [XRD]
type XRD = [Service]
data Service
Service :: [String] -> [String] -> [String] -> [String] -> Maybe Int -> [Element] -> Service
serviceTypes :: Service -> [String]
serviceMediaTypes :: Service -> [String]
serviceURIs :: Service -> [String]
serviceLocalIDs :: Service -> [String]
servicePriority :: Service -> Maybe Int
serviceExtra :: Service -> [Element]
-- | Check to see if an XRDS service description is usable.
isUsable :: XRDS -> Bool
-- | Generate a predicate over Service Types.
hasType :: String -> Service -> Bool
parseXRDS :: String -> Maybe XRDS
instance Show Service
module Network.OpenID.Types
-- | Supported association types
data AssocType
HmacSha1 :: AssocType
HmacSha256 :: AssocType
-- | Session types for association establishment
data SessionType
NoEncryption :: SessionType
DhSha1 :: SessionType
DhSha256 :: SessionType
-- | An association with a provider.
data Association
Association :: Int -> String -> [Word8] -> AssocType -> Association
assocExpiresIn :: Association -> Int
assocHandle :: Association -> String
assocMacKey :: Association -> [Word8]
assocType :: Association -> AssocType
-- | Parameter lists for communication with the server
type Params = [(String, String)]
-- | A return to path
type ReturnTo = String
-- | A realm of uris for a provider to inform a user about
type Realm = String
-- | A way to resolve an HTTP request
type Resolver m = Request String -> m (Either ConnError (Response String))
-- | An OpenID provider.
data Provider
-- | Parse a provider
parseProvider :: String -> Maybe Provider
-- | Show a provider
showProvider :: Provider -> String
providerURI :: Provider -> URI
-- | Modify the URI in a provider
modifyProvider :: (URI -> URI) -> Provider -> Provider
-- | A valid OpenID identifier.
newtype Identifier
Identifier :: String -> Identifier
getIdentifier :: Identifier -> String
-- | Errors
newtype Error
Error :: String -> Error
assocString :: AssocType -> String
instance Read AssocType
instance Show AssocType
instance Show Association
instance Read Association
instance Eq Provider
instance Show Provider
instance Eq Identifier
instance Show Identifier
instance Read Identifier
instance Show Error
instance Read SessionType
instance Show SessionType
module Network.OpenID.Utils
-- | Read, maybe.
readMaybe :: Read a => String -> Maybe a
-- | Break up a string by a predicate.
breaks :: (a -> Bool) -> [a] -> [[a]]
-- | Spit a list into a pair, removing the element that caused the
-- predicate to succeed.
split :: (a -> Bool) -> [a] -> ([a], [a])
-- | Build an Integer out of a big-endian list of bytes.
roll :: [Word8] -> Integer
-- | Turn an Integer into a big-endian list of bytes
unroll :: Integer -> [Word8]
-- | Pad out a list of bytes to represent a positive, big-endian list of
-- bytes.
btwoc :: [Word8] -> [Word8]
-- | Default modulus for Diffie-Hellman key exchange.
defaultModulus :: Integer
-- | The OpenID-2.0 namespace.
openidNS :: String
-- | Read inside of an Exception monad
readM :: (ExceptionM m e, Read a) => e -> String -> m a
-- | Lookup parameters inside an exception handling monad
lookupParam :: ExceptionM m Error => String -> Params -> m String
-- | Read a field
readParam :: (Read a, ExceptionM m Error) => String -> Params -> m a
-- | Make an HTTP request, and run a function with a successful response
withResponse :: ExceptionM m Error => Either ConnError (Response String) -> (Response String -> m a) -> m a
module Network.OpenID.Association.Manager
-- | Manage pairs of Providers and Associations.
class AssociationManager am
findAssociation :: AssociationManager am => am -> Provider -> Maybe Association
addAssociation :: AssociationManager am => am -> UTCTime -> Provider -> Association -> am
expire :: AssociationManager am => am -> UTCTime -> am
exportAssociations :: AssociationManager am => am -> [(String, UTCTime, Association)]
module Network.OpenID.Association.Map
-- | A simple association manager based on Data.Map
newtype AssociationMap
AM :: (Map String (UTCTime, Association)) -> AssociationMap
-- | An empty association map.
emptyAssociationMap :: AssociationMap
instance Show AssociationMap
instance Read AssociationMap
instance AssociationManager AssociationMap
module Network.OpenID.Normalization
-- | Normalize an identifier, discarding XRIs.
normalizeIdentifier :: Identifier -> Maybe Identifier
-- | Normalize the user supplied identifier, using a supplied function to
-- normalize an XRI.
normalizeIdentifier' :: (String -> Maybe String) -> Identifier -> Maybe Identifier
module Network.OpenID.HTTP
-- | Perform an http request. If the Bool parameter is set to True,
-- redirects from the server will be followed.
makeRequest :: Bool -> Resolver IO
getRequest :: URI -> Request String
postRequest :: URI -> String -> Request String
-- | Turn a response body into a list of parameters.
parseDirectResponse :: String -> Params
-- | Format OpenID parameters as a query string
formatParams :: Params -> String
-- | Format OpenID parameters as a direct response
formatDirectParams :: Params -> String
-- | Escape for the query string of a URI
escapeParam :: String -> String
-- | Add Parameters to a URI
addParams :: Params -> URI -> URI
-- | Parse OpenID parameters out of a url string
parseParams :: String -> Params
module Network.OpenID.Discovery
-- | Attempt to resolve an OpenID endpoint, and user identifier.
discover :: Monad m => Resolver m -> Identifier -> m (Either Error (Provider, Identifier))
module Network.OpenID.AttributeExchange
-- | Some common, useful Attribute Exchange specs.
data AXFieldTy
AXBirthdate :: AXFieldTy
AXEmail :: AXFieldTy
AXFirstName :: AXFieldTy
AXFullName :: AXFieldTy
AXGender :: AXFieldTy
AXLanguage :: AXFieldTy
AXLastName :: AXFieldTy
AXNickname :: AXFieldTy
-- | Used to store responses.
type AXFieldVal = (AXFieldTy, String)
axName :: AXFieldTy -> String
axSpec :: AXFieldTy -> String
axTyFromName :: String -> Maybe AXFieldTy
-- | The simplest use case is to request the user's email. This would be
-- used to replace traditional verification emails.
axEmailRequired :: Params
-- | Use these functions to roll your own list of fields to request when
-- you send an auth request
axExtParams :: [AXFieldTy] -> Params
-- | specify the alias as well as the list of requested fields
axExtParams' :: String -> [AXFieldTy] -> Params
-- | Retrieve the requested fields from the HTTP request params. Keep | in
-- mind the spec does not require that the OpenID Provider return | any
-- of our requested fields, even on a successful verification.
getAxFields :: Params -> [AXFieldVal]
instance Eq AXFieldTy
instance Show AXFieldTy
instance Ord AXFieldTy
instance Read AXFieldTy
module Data.Digest.OpenSSL.SHA
-- | Sha1 hashing
sha1 :: [Word8] -> [Word8]
-- | Sha256 hashing
sha256 :: [Word8] -> [Word8]
module Data.Digest.OpenSSL.AlternativeHMAC
hmac :: CryptoHashFunction -> ByteString -> ByteString -> IO String
-- | Wrapper/rendering function for hmac
unsafeHMAC :: CryptoHashFunction -> ByteString -> ByteString -> String
-- | Get the hex-string representation of an HMAC
showHMAC :: ByteString -> String
data CryptoHashFunction
-- | Name of the SHA digest, used by getDigestByName
sha :: CryptoHashFunction
-- | Name of the SHA1 digest, used by getDigestByName
sha1 :: CryptoHashFunction
-- | Name of the SHA224 digest, used by getDigestByName
sha224 :: CryptoHashFunction
-- | Name of the SHA256 digest, used by getDigestByName
sha256 :: CryptoHashFunction
-- | Name of the SHA384 digest, used by getDigestByName
sha384 :: CryptoHashFunction
-- | Name of the SHA384 digest, used by getDigestByName
sha512 :: CryptoHashFunction
module Codec.Encryption.DH
data DHParams
DHParams :: [Word8] -> [Word8] -> Generator -> Modulus -> DHParams
dhPrivateKey :: DHParams -> [Word8]
dhPublicKey :: DHParams -> [Word8]
dhGenerator :: DHParams -> Generator
dhModulus :: DHParams -> Modulus
data DHParamError
PNotPrime :: DHParamError
PNotSafePrime :: DHParamError
UnableToCheckGenerator :: DHParamError
NotSuitableGenerator :: DHParamError
type Modulus = Integer
type Generator = Int
newDHParams :: Int -> Generator -> IO (Maybe DHParams)
checkDHParams :: DHParams -> IO [DHParamError]
generateKey :: Modulus -> Generator -> IO (Maybe DHParams)
computeKey :: [Word8] -> DHParams -> [Word8]
instance Show DHParams
instance Show DHParamError
-- | Base64 decoding and encoding routines.
--
-- Note: This module was taken from the mime package released by Galois,
-- Inc. The original author is unknown.
module Codec.Binary.Base64
encodeRaw :: Bool -> [Word8] -> String
encodeRawString :: Bool -> String -> String
encodeRawPrim :: Bool -> Char -> Char -> [Word8] -> String
-- | 'formatOutput n mbLT str' formats str, splitting it into
-- lines of length n. The optional value lets you control what
-- line terminator sequence to use; the default is CRLF (as per MIME.)
formatOutput :: Int -> Maybe String -> String -> String
decode :: String -> [Word8]
decodeToString :: String -> String
decodePrim :: Char -> Char -> String -> [Word8]
module Network.OpenID.Association
-- | Associate with a provider. By default, this tries to use DH-SHA256 and
-- HMAC-SHA256, and falls back to whatever the server recommends, if the
-- Bool parameter is True.
associate :: AssociationManager am => am -> Bool -> Resolver IO -> Provider -> IO (Either Error am)
-- | Associate with a provider, attempting to use the provided association
-- methods. The Bool specifies whether or not recovery should be
-- attempted upon a failed request.
associate' :: AssociationManager am => am -> Bool -> Resolver IO -> Provider -> AssocType -> SessionType -> IO (Either Error am)
-- | Association monad
data Assoc m a
-- | Running a computation in the association monad
runAssoc :: (Monad m, BaseM m m) => AssocEnv m -> Assoc m a -> m (Either Error a)
-- | Association environment
data AssocEnv m
AssocEnv :: m UTCTime -> (SessionType -> m (Maybe DHParams)) -> AssocEnv m
currentTime :: AssocEnv m -> m UTCTime
createParams :: AssocEnv m -> SessionType -> m (Maybe DHParams)
-- | A pure version of association. It will run in whatever base
-- monad is provided, layering exception handling over that.
associate_ :: (Monad m, AssociationManager am) => am -> Bool -> Resolver m -> Provider -> AssocType -> SessionType -> Assoc m am
instance Monad m => Functor (Assoc m)
instance Monad m => Monad (Assoc m)
instance Monad m => ReaderM (Assoc m) (AssocEnv m)
instance Monad m => ExceptionM (Assoc m) Error
instance MonadT Assoc
module Network.OpenID.Authentication
data CheckIdMode
Immediate :: CheckIdMode
Setup :: CheckIdMode
-- | Generate an authentication URL. The params field allows you to |
-- specify any extensions, for example, AttributeExchange.
authenticationURI :: AssociationManager am => am -> CheckIdMode -> Provider -> Identifier -> ReturnTo -> Maybe Params -> Maybe Realm -> URI
-- | Verify a signature on a set of params.
verifyAuthentication :: (Monad m, AssociationManager am) => am -> Params -> ReturnTo -> Resolver m -> m (Either Error ())
instance Read CheckIdMode
instance Show CheckIdMode
module Network.OpenID