matrix-client-0.1.5.0: A matrix client library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.Matrix.Identity

Description

This module contains the Identity service API https://matrix.org/docs/spec/identity_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

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")])