matrix-client-0.1.1.0: A matrix client library
Safe HaskellNone
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 = IO (Either MatrixError a) Source #

MatrixIO is a convenient type alias for server response

User data

newtype UserID Source #

Constructors

UserID Text 

Instances

Instances details
Eq UserID Source # 
Instance details

Defined in Network.Matrix.Internal

Methods

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

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

Show UserID Source # 
Instance details

Defined in Network.Matrix.Internal

FromJSON UserID Source # 
Instance details

Defined in Network.Matrix.Internal

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
Eq Identity Source # 
Instance details

Defined in Network.Matrix.Identity

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