ldap-client-0.2.0: Pure Haskell LDAP Client Library

Safe HaskellNone
LanguageHaskell2010

Ldap.Client.Internal

Contents

Synopsis

Documentation

data Host Source #

LDAP host.

Constructors

Plain String

Plain LDAP.

Tls String TLSSettings

LDAP over TLS.

Instances

data PortNumber :: * #

Use the Num instance (i.e. use a literal) to create a PortNumber value with the correct network-byte-ordering. You should not use the PortNum constructor. It will be removed in the next release.

>>> 1 :: PortNumber
1
>>> read "1" :: PortNumber
1

Instances

Enum PortNumber 
Eq PortNumber 
Integral PortNumber 
Num PortNumber 
Ord PortNumber 
Read PortNumber 
Real PortNumber 
Show PortNumber 
Storable PortNumber 

newtype Ldap Source #

A token. All functions that interact with the Directory require one.

Constructors

Ldap 

Instances

Eq Ldap Source # 

Methods

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

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

data Async a Source #

Asynchronous LDAP operation. Use wait or waitSTM to wait for its completion.

Instances

Functor Async Source # 

Methods

fmap :: (a -> b) -> Async a -> Async b #

(<$) :: a -> Async b -> Async a #

type AttrList f = [(Attr, f AttrValue)] Source #

List of attributes and their values. f is the structure these values are in, e.g. NonEmpty.

Waiting for Request Completion

wait :: Async a -> IO (Either ResponseError a) Source #

Wait for operation completion.

waitSTM :: Async a -> STM (Either ResponseError a) Source #

Wait for operation completion inside STM.

Do not use this inside the same STM transaction the operation was requested in! To give LDAP the chance to respond to it that transaction should commit. After that, applying waitSTM to the corresponding Async starts to make sense.

Misc

type Response = NonEmpty InMessage Source #

data ResponseError Source #

Response indicates a failed operation.

Constructors

ResponseInvalid !Request !Response

LDAP server did not follow the protocol, so ldap-client couldn't make sense of the response.

ResponseErrorCode !Request !ResultCode !Dn !Text

The response contains a result code indicating failure and an error message.

raise :: Exception e => Either e a -> IO a Source #

newtype Dn Source #

Unique identifier of an LDAP entry.

Constructors

Dn Text 

Instances

Eq Dn Source # 

Methods

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

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

Show Dn Source # 

Methods

showsPrec :: Int -> Dn -> ShowS #

show :: Dn -> String #

showList :: [Dn] -> ShowS #

newtype Attr Source #

Attribute name.

Constructors

Attr Text 

Instances

Eq Attr Source # 

Methods

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

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

Show Attr Source # 

Methods

showsPrec :: Int -> Attr -> ShowS #

show :: Attr -> String #

showList :: [Attr] -> ShowS #

type AttrValue = ByteString Source #

Attribute value.

Unbind operation

unbindAsync :: Ldap -> IO () Source #

Terminate the connection to the Directory.

Note that unbindAsync does not return an Async, because LDAP server never responds to UnbindRequests, hence a call to wait on a hypothetical Async would have resulted in an exception anyway.

unbindAsyncSTM :: Ldap -> STM () Source #

Terminate the connection to the Directory.

Note that unbindAsyncSTM does not return an Async, because LDAP server never responds to UnbindRequests, hence a call to wait on a hypothetical Async would have resulted in an exception anyway.