Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
The abstract base class for handling authentication. Specific HTTP Authentication mechanisms are implemented by its subclasses, but applications never need to be aware of the specific subclasses being used.
- newtype Auth = Auth (ManagedPtr Auth)
- class GObject o => IsAuth o
- toAuth :: (MonadIO m, IsAuth o) => o -> m Auth
- noAuth :: Maybe Auth
- authAuthenticate :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m ()
- authCanAuthenticate :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Bool
- authGetAuthorization :: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) => a -> b -> m Text
- authGetHost :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- authGetInfo :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- authGetProtectionSpace :: (HasCallStack, MonadIO m, IsAuth a) => a -> URI -> m [Text]
- authGetRealm :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- authGetSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> m Text
- authGetSavedUsers :: (HasCallStack, MonadIO m, IsAuth a) => a -> m [Text]
- authGetSchemeName :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- authHasSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m ()
- authIsAuthenticated :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Bool
- authIsForProxy :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Bool
- authIsReady :: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) => a -> b -> m Bool
- authNew :: (HasCallStack, MonadIO m, IsMessage a) => GType -> a -> Text -> m (Maybe Auth)
- authSavePassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m ()
- authUpdate :: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) => a -> b -> Text -> m Bool
- clearAuthHost :: (MonadIO m, IsAuth o) => o -> m ()
- constructAuthHost :: IsAuth o => Text -> IO (GValueConstruct o)
- getAuthHost :: (MonadIO m, IsAuth o) => o -> m Text
- setAuthHost :: (MonadIO m, IsAuth o) => o -> Text -> m ()
- getAuthIsAuthenticated :: (MonadIO m, IsAuth o) => o -> m Bool
- constructAuthIsForProxy :: IsAuth o => Bool -> IO (GValueConstruct o)
- getAuthIsForProxy :: (MonadIO m, IsAuth o) => o -> m Bool
- setAuthIsForProxy :: (MonadIO m, IsAuth o) => o -> Bool -> m ()
- clearAuthRealm :: (MonadIO m, IsAuth o) => o -> m ()
- constructAuthRealm :: IsAuth o => Text -> IO (GValueConstruct o)
- getAuthRealm :: (MonadIO m, IsAuth o) => o -> m Text
- setAuthRealm :: (MonadIO m, IsAuth o) => o -> Text -> m ()
- getAuthSchemeName :: (MonadIO m, IsAuth o) => o -> m Text
Exported types
Methods
authenticate
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
Call this on an auth to authenticate it; normally this will cause the auth's message to be requeued with the new authentication info.
canAuthenticate
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Bool | Returns: |
Tests if auth
is able to authenticate by providing credentials to the
authAuthenticate
.
Since: 2.54
getAuthorization
:: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) | |
=> a |
|
-> b |
|
-> m Text | Returns: the "Authorization" header, which must be freed. |
Generates an appropriate "Authorization" header for msg
. (The
session will only call this if authIsAuthenticated
returned True
.)
getHost
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Text | Returns: the hostname |
Returns the host that auth
is associated with.
getInfo
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Text | Returns: the identifier |
Gets an opaque identifier for auth
, for use as a hash key or the
like. Auth
objects from the same server with the same
identifier refer to the same authentication domain (eg, the URLs
associated with them take the same usernames and passwords).
getProtectionSpace
authGetProtectionSpace Source #
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> URI |
|
-> m [Text] | Returns: the list of
paths, which can be freed with |
Returns a list of paths on the server which auth
extends over.
(All subdirectories of these paths are also assumed to be part
of auth
's protection space, unless otherwise discovered not to
be.)
getRealm
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Text | Returns: the realm name |
Returns auth
's realm. This is an identifier that distinguishes
separate authentication spaces on a given server, and may be some
string that is meaningful to the user. (Although it is probably not
localized.)
getSavedPassword
authGetSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> m Text Source #
No description available in the introspection data.
getSavedUsers
authGetSavedUsers :: (HasCallStack, MonadIO m, IsAuth a) => a -> m [Text] Source #
No description available in the introspection data.
getSchemeName
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Text | Returns: the scheme name |
Returns auth
's scheme name. (Eg, "Basic", "Digest", or "NTLM")
hasSavedPassword
authHasSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m () Source #
No description available in the introspection data.
isAuthenticated
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Bool | Returns: |
Tests if auth
has been given a username and password
isForProxy
Tests whether or not auth
is associated with a proxy server rather
than an "origin" server.
isReady
:: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Tests if auth
is ready to make a request for msg
with. For most
auths, this is equivalent to authIsAuthenticated
, but for
some auth types (eg, NTLM), the auth may be sendable (eg, as an
authentication request) even before it is authenticated.
Since: 2.42
new
savePassword
authSavePassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m () Source #
No description available in the introspection data.
update
:: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) | |
=> a |
|
-> b |
|
-> Text |
|
-> m Bool | Returns: |
Properties
host
clearAuthHost :: (MonadIO m, IsAuth o) => o -> m () Source #
constructAuthHost :: IsAuth o => Text -> IO (GValueConstruct o) Source #
isAuthenticated
isForProxy
constructAuthIsForProxy :: IsAuth o => Bool -> IO (GValueConstruct o) Source #
realm
clearAuthRealm :: (MonadIO m, IsAuth o) => o -> m () Source #
constructAuthRealm :: IsAuth o => Text -> IO (GValueConstruct o) Source #