-- 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.1 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 -> m (Either ConnError Response) -- | 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 instance Show Error instance Eq Identifier instance Show Identifier instance Read Identifier instance Eq Provider instance Show Provider instance Show Association instance Read SessionType instance Show SessionType instance Read AssocType instance Show AssocType 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 -> (Response -> m a) -> m a 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.Discovery -- | Attempt to resolve an OpenID endpoint, and user identifier. discover :: (Monad m) => Resolver m -> Identifier -> m (Either Error (Provider, Identifier)) 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 data AssociationMap -- | An empty association map. emptyAssociationMap :: AssociationMap instance Show AssociationMap instance AssociationManager AssociationMap module Network.SSL data SSLHandle -- | Initialize OpenSSL sslInit :: IO () -- | Seed the PRNG. On systems that don't provide devurandom, use -- this to seed the PRNG. randSeed :: [Word8] -> IO () -- | Initiate an ssl connection. XXX: needs some error handling. sslConnect :: Socket -> IO (Maybe SSLHandle) -- | Read n bytes from an SSLHandle sslRead :: SSLHandle -> Int -> IO [Word8] sslReadWhile :: (Word8 -> Bool) -> SSLHandle -> IO [Word8] -- | Write a block of bytes to an SSLHandle sslWrite :: SSLHandle -> [Word8] -> IO () instance Stream SSLHandle 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 postRequest :: URI -> String -> Request -- | 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 Data.Digest.OpenSSL.SHA sha1 :: [Word8] -> [Word8] sha256 :: [Word8] -> [Word8] 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 DHParamError instance Show DHParams -- | 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 authenticationURI :: (AssociationManager am) => am -> CheckIdMode -> Provider -> Identifier -> ReturnTo -> 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