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 :: IsAuth o => o -> IO Auth
- noAuth :: Maybe Auth
- data AuthAuthenticateMethodInfo
- authAuthenticate :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m ()
- data AuthCanAuthenticateMethodInfo
- authCanAuthenticate :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Bool
- data AuthGetAuthorizationMethodInfo
- authGetAuthorization :: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) => a -> b -> m Text
- data AuthGetHostMethodInfo
- authGetHost :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- data AuthGetInfoMethodInfo
- authGetInfo :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- data AuthGetProtectionSpaceMethodInfo
- authGetProtectionSpace :: (HasCallStack, MonadIO m, IsAuth a) => a -> URI -> m [Text]
- data AuthGetRealmMethodInfo
- authGetRealm :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- data AuthGetSavedPasswordMethodInfo
- authGetSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> m Text
- data AuthGetSavedUsersMethodInfo
- authGetSavedUsers :: (HasCallStack, MonadIO m, IsAuth a) => a -> m [Text]
- data AuthGetSchemeNameMethodInfo
- authGetSchemeName :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Text
- data AuthHasSavedPasswordMethodInfo
- authHasSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m ()
- data AuthIsAuthenticatedMethodInfo
- authIsAuthenticated :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Bool
- data AuthIsForProxyMethodInfo
- authIsForProxy :: (HasCallStack, MonadIO m, IsAuth a) => a -> m Bool
- data AuthIsReadyMethodInfo
- authIsReady :: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) => a -> b -> m Bool
- authNew :: (HasCallStack, MonadIO m, IsMessage a) => GType -> a -> Text -> m (Maybe Auth)
- data AuthSavePasswordMethodInfo
- authSavePassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m ()
- data AuthUpdateMethodInfo
- authUpdate :: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) => a -> b -> Text -> m Bool
- data AuthHostPropertyInfo
- authHost :: AttrLabelProxy "host"
- 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 ()
- data AuthIsAuthenticatedPropertyInfo
- getAuthIsAuthenticated :: (MonadIO m, IsAuth o) => o -> m Bool
- data AuthIsForProxyPropertyInfo
- constructAuthIsForProxy :: IsAuth o => Bool -> IO (GValueConstruct o)
- getAuthIsForProxy :: (MonadIO m, IsAuth o) => o -> m Bool
- setAuthIsForProxy :: (MonadIO m, IsAuth o) => o -> Bool -> m ()
- data AuthRealmPropertyInfo
- authRealm :: AttrLabelProxy "realm"
- 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 ()
- data AuthSchemeNamePropertyInfo
- authSchemeName :: AttrLabelProxy "schemeName"
- getAuthSchemeName :: (MonadIO m, IsAuth o) => o -> m Text
Exported types
GObject Auth Source # | |
IsObject Auth Source # | |
IsAuth Auth Source # | |
((~) * info (ResolveAuthMethod t Auth), MethodInfo * info Auth p) => IsLabel t (Auth -> p) Source # | |
((~) * info (ResolveAuthMethod t Auth), MethodInfo * info Auth p) => IsLabelProxy t (Auth -> p) Source # | |
HasAttributeList * Auth Source # | |
type AttributeList Auth Source # | |
type SignalList Auth Source # | |
Methods
authenticate
data AuthAuthenticateMethodInfo Source #
((~) * signature (Text -> Text -> m ()), MonadIO m, IsAuth a) => MethodInfo * AuthAuthenticateMethodInfo a signature Source # | |
:: (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
data AuthCanAuthenticateMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsAuth a) => MethodInfo * AuthCanAuthenticateMethodInfo a signature Source # | |
:: (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
data AuthGetAuthorizationMethodInfo Source #
((~) * signature (b -> m Text), MonadIO m, IsAuth a, IsMessage b) => MethodInfo * AuthGetAuthorizationMethodInfo a signature Source # | |
:: (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
data AuthGetHostMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetHostMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Text | Returns: the hostname |
Returns the host that auth
is associated with.
getInfo
data AuthGetInfoMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetInfoMethodInfo a signature Source # | |
:: (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
data AuthGetProtectionSpaceMethodInfo Source #
((~) * signature (URI -> m [Text]), MonadIO m, IsAuth a) => MethodInfo * AuthGetProtectionSpaceMethodInfo a signature Source # | |
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
data AuthGetRealmMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetRealmMethodInfo a signature Source # | |
:: (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
data AuthGetSavedPasswordMethodInfo Source #
((~) * signature (Text -> m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetSavedPasswordMethodInfo a signature Source # | |
authGetSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> m Text Source #
No description available in the introspection data.
getSavedUsers
data AuthGetSavedUsersMethodInfo Source #
((~) * signature (m [Text]), MonadIO m, IsAuth a) => MethodInfo * AuthGetSavedUsersMethodInfo a signature Source # | |
authGetSavedUsers :: (HasCallStack, MonadIO m, IsAuth a) => a -> m [Text] Source #
No description available in the introspection data.
getSchemeName
data AuthGetSchemeNameMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetSchemeNameMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Text | Returns: the scheme name |
Returns auth
's scheme name. (Eg, "Basic", "Digest", or "NTLM")
hasSavedPassword
data AuthHasSavedPasswordMethodInfo Source #
((~) * signature (Text -> Text -> m ()), MonadIO m, IsAuth a) => MethodInfo * AuthHasSavedPasswordMethodInfo a signature Source # | |
authHasSavedPassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m () Source #
No description available in the introspection data.
isAuthenticated
data AuthIsAuthenticatedMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsAuth a) => MethodInfo * AuthIsAuthenticatedMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsAuth a) | |
=> a |
|
-> m Bool | Returns: |
Tests if auth
has been given a username and password
isForProxy
data AuthIsForProxyMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsAuth a) => MethodInfo * AuthIsForProxyMethodInfo a signature Source # | |
Tests whether or not auth
is associated with a proxy server rather
than an "origin" server.
isReady
data AuthIsReadyMethodInfo Source #
((~) * signature (b -> m Bool), MonadIO m, IsAuth a, IsMessage b) => MethodInfo * AuthIsReadyMethodInfo a signature Source # | |
:: (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
data AuthSavePasswordMethodInfo Source #
((~) * signature (Text -> Text -> m ()), MonadIO m, IsAuth a) => MethodInfo * AuthSavePasswordMethodInfo a signature Source # | |
authSavePassword :: (HasCallStack, MonadIO m, IsAuth a) => a -> Text -> Text -> m () Source #
No description available in the introspection data.
update
data AuthUpdateMethodInfo Source #
:: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) | |
=> a |
|
-> b |
|
-> Text |
|
-> m Bool | Returns: |
Properties
host
data AuthHostPropertyInfo Source #
authHost :: AttrLabelProxy "host" Source #
clearAuthHost :: (MonadIO m, IsAuth o) => o -> m () Source #
constructAuthHost :: IsAuth o => Text -> IO (GValueConstruct o) Source #
isAuthenticated
data AuthIsAuthenticatedPropertyInfo Source #
isForProxy
data AuthIsForProxyPropertyInfo Source #
constructAuthIsForProxy :: IsAuth o => Bool -> IO (GValueConstruct o) Source #
realm
data AuthRealmPropertyInfo Source #
authRealm :: AttrLabelProxy "realm" Source #
clearAuthRealm :: (MonadIO m, IsAuth o) => o -> m () Source #
constructAuthRealm :: IsAuth o => Text -> IO (GValueConstruct o) Source #
schemeName
data AuthSchemeNamePropertyInfo Source #
authSchemeName :: AttrLabelProxy "schemeName" Source #