Copyright | (c) Lars Petersen 2016 |
---|---|
License | MIT |
Maintainer | info@lars-petersen.net |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Network.MQTT.Broker.Authentication
Description
- class Exception (AuthenticationException a) => Authenticator a where
- data AuthenticatorConfig a
- data AuthenticationException a
- type PrincipalIdentifier = UUID
- data Principal = Principal {}
- data Quota = Quota {}
- data ConnectionRequest = ConnectionRequest {}
Documentation
class Exception (AuthenticationException a) => Authenticator a where Source #
A peer identity optionally associated with connection/session specific information. newtype Principal = Principal T.Text deriving (Eq, Ord, Show)
An Authenticator
is able to determine a Principal
's identity from a
Request
.
Minimal complete definition
Associated Types
data AuthenticatorConfig a Source #
data AuthenticationException a Source #
This Exception
may be thrown by any operation within this class.
Operations must only throw this type of exception. Other exceptions
won't be catched and may kill the broker.
Methods
newAuthenticator :: AuthenticatorConfig a -> IO a Source #
Create a new authenticator instance from configuration.
authenticate :: a -> ConnectionRequest -> IO (Maybe PrincipalIdentifier) Source #
Try to determine a Principal
's identity from a connection Request
.
The operation shall return Nothing
in case the authentication
mechanism is working, but couldn't associate an identity. It shall
throw an AuthenticationException
in case of other problems.
getPrincipal :: a -> PrincipalIdentifier -> IO (Maybe Principal) Source #
Gets a principal by principal primary key (UUID).
The operation shall return Nothing
in case the principal is not / no
longer available. It shall throw an AuthenticationException
in case
of other problems.
type PrincipalIdentifier = UUID Source #
Constructors
Principal | |
Fields |
Constructors
Quota | |
data ConnectionRequest Source #
This class defines how the information gathered from a
connection request looks like. An Authenticator
may use
whatever information it finds suitable to authenticate the Principal
.
Constructors
ConnectionRequest | |
Fields
|
Instances