Visitar URL original
Network.Matrix.Identity
matrix-client-0.1.9.0: A matrix client library
Safe HaskellNone
LanguageHaskell2010

Network.Matrix.Identity

Description

This module contains the Identity service API https:/matrix.orgdocsspecidentity_service/r0.3.0.html

Synopsis

Client

data IdentitySession Source #

The session record, use createSession to create it.

newtype MatrixToken Source #

Constructors

MatrixToken Text 

getTokenFromEnv Source #

Arguments

:: Text

The envirnoment variable name

-> IO MatrixToken 

createIdentitySession Source #

Arguments

:: Text

The matrix identity base url, e.g. "https://matrix.org"

-> MatrixToken

The user identity token

-> IO IdentitySession 

createSession creates the session record.

API

type MatrixIO a = MatrixM IO a Source #

MatrixIO is a convenient type alias for server response

data MatrixError Source #

Constructors

MatrixError 

Instances

Instances details
FromJSON MatrixError Source # 
Instance details

Defined in Network.Matrix.Internal

Generic MatrixError Source # 
Instance details

Defined in Network.Matrix.Internal

Associated Types

type Rep MatrixError 
Instance details

Defined in Network.Matrix.Internal

type Rep MatrixError = D1 ('MetaData "MatrixError" "Network.Matrix.Internal" "matrix-client-0.1.9.0-ITLhONOsc146bTdB6wSMw3" 'False) (C1 ('MetaCons "MatrixError" 'PrefixI 'True) (S1 ('MetaSel ('Just "meErrcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "meError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "meRetryAfterMS") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))))
Show MatrixError Source # 
Instance details

Defined in Network.Matrix.Internal

Eq MatrixError Source # 
Instance details

Defined in Network.Matrix.Internal

type Rep MatrixError Source # 
Instance details

Defined in Network.Matrix.Internal

type Rep MatrixError = D1 ('MetaData "MatrixError" "Network.Matrix.Internal" "matrix-client-0.1.9.0-ITLhONOsc146bTdB6wSMw3" 'False) (C1 ('MetaCons "MatrixError" 'PrefixI 'True) (S1 ('MetaSel ('Just "meErrcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "meError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "meRetryAfterMS") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))))

retry :: (MonadIO m, MonadMask m) => MatrixM m a -> MatrixM m a Source #

retryWithLog Source #

Arguments

:: (MonadMask m, MonadIO m) 
=> Int

Maximum number of retry

-> (Text -> m ())

A log function, can be used to measure errors

-> MatrixM m a

The action to retry

-> MatrixM m a 

Retry a network action

User data

newtype UserID Source #

Constructors

UserID Text 

Instances

Instances details
FromJSON UserID Source # 
Instance details

Defined in Network.Matrix.Internal

FromJSONKey UserID Source # 
Instance details

Defined in Network.Matrix.Internal

Show UserID Source # 
Instance details

Defined in Network.Matrix.Internal

Eq UserID Source # 
Instance details

Defined in Network.Matrix.Internal

Methods

(==) :: UserID -> UserID -> Bool #

(/=) :: UserID -> UserID -> Bool #

Ord UserID Source # 
Instance details

Defined in Network.Matrix.Internal

Hashable UserID Source # 
Instance details

Defined in Network.Matrix.Internal

Methods

hashWithSalt :: Int -> UserID -> Int #

hash :: UserID -> Int #

getIdentityTokenOwner :: IdentitySession -> MatrixIO UserID Source #

getIdentityTokenOwner gets information about the owner of a given access token.

Association lookup

data Identity Source #

Constructors

Email Text 
Msisdn Text 

Instances

Instances details
Show Identity Source # 
Instance details

Defined in Network.Matrix.Identity

Eq Identity Source # 
Instance details

Defined in Network.Matrix.Identity

identityLookup :: IdentitySession -> HashDetails -> Identity -> MatrixIO (Maybe UserID) Source #

Use identityLookup to lookup a single identity, otherwise uses the full identitiesLookup.

data IdentityLookupResponse Source #

A newtype wrapper to decoded nested list

>>> decode "{\"mappings\": {\"hash\": \"user\"}}" :: Maybe IdentityLookupResponse
Just (IdentityLookupResponse [(HashedAddress "hash",UserID "user")])