gi-soup-2.4.11: Libsoup bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Objects.Auth

Contents

Description

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.

Synopsis

Exported types

newtype Auth Source #

Constructors

Auth (ManagedPtr Auth) 

Instances

GObject Auth Source # 

Methods

gobjectType :: Auth -> IO GType #

IsObject Auth Source # 
IsAuth Auth Source # 
((~) * info (ResolveAuthMethod t Auth), MethodInfo * info Auth p) => IsLabel t (Auth -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> Auth -> p #

((~) * info (ResolveAuthMethod t Auth), MethodInfo * info Auth p) => IsLabelProxy t (Auth -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> Auth -> p #

HasAttributeList * Auth Source # 
type AttributeList Auth Source # 
type SignalList Auth Source # 

toAuth :: IsAuth o => o -> IO Auth Source #

Methods

authenticate

data AuthAuthenticateMethodInfo Source #

Instances

((~) * signature (Text -> Text -> m ()), MonadIO m, IsAuth a) => MethodInfo * AuthAuthenticateMethodInfo a signature Source # 

authAuthenticate Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> Text

username: the username provided by the user or client

-> Text

password: the password provided by the user or client

-> 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

authCanAuthenticate Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> m Bool

Returns: True if auth is able to accept credentials.

Tests if auth is able to authenticate by providing credentials to the authAuthenticate.

Since: 2.54

getAuthorization

authGetAuthorization Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) 
=> a

auth: a Auth

-> b

msg: the Message to be authorized

-> 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 #

Instances

((~) * signature (m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetHostMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy AuthGetHostMethodInfo a -> signature -> s #

authGetHost Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> m Text

Returns: the hostname

Returns the host that auth is associated with.

getInfo

data AuthGetInfoMethodInfo Source #

Instances

((~) * signature (m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetInfoMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy AuthGetInfoMethodInfo a -> signature -> s #

authGetInfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> URI

sourceUri: the URI of the request that auth was generated in response to.

-> m [Text]

Returns: the list of paths, which can be freed with soup_auth_free_protection_space().

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 #

Instances

((~) * signature (m Text), MonadIO m, IsAuth a) => MethodInfo * AuthGetRealmMethodInfo a signature Source # 

authGetRealm Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> 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

data AuthGetSavedUsersMethodInfo Source #

Instances

((~) * 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

authGetSchemeName Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> m Text

Returns: the scheme name

Returns auth's scheme name. (Eg, "Basic", "Digest", or "NTLM")

hasSavedPassword

data AuthHasSavedPasswordMethodInfo Source #

Instances

((~) * 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

authIsAuthenticated Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> m Bool

Returns: True if auth has been given a username and password

Tests if auth has been given a username and password

isForProxy

data AuthIsForProxyMethodInfo Source #

Instances

((~) * signature (m Bool), MonadIO m, IsAuth a) => MethodInfo * AuthIsForProxyMethodInfo a signature Source # 

authIsForProxy Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a) 
=> a

auth: a Auth

-> m Bool

Returns: True or False

Tests whether or not auth is associated with a proxy server rather than an "origin" server.

isReady

data AuthIsReadyMethodInfo Source #

Instances

((~) * signature (b -> m Bool), MonadIO m, IsAuth a, IsMessage b) => MethodInfo * AuthIsReadyMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy AuthIsReadyMethodInfo a -> signature -> s #

authIsReady Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) 
=> a

auth: a Auth

-> b

msg: a Message

-> m Bool

Returns: True if auth is ready to make a request with.

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

authNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsMessage a) 
=> GType

type: the type of auth to create (a subtype of Auth)

-> a

msg: the Message the auth is being created for

-> Text

authHeader: the WWW-Authenticate/Proxy-Authenticate header

-> m (Maybe Auth)

Returns: the new Auth, or Nothing if it could not be created

Creates a new Auth of type type with the information from msg and authHeader.

This is called by Session; you will normally not create auths yourself.

savePassword

data AuthSavePasswordMethodInfo Source #

Instances

((~) * 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 #

Instances

((~) * signature (b -> Text -> m Bool), MonadIO m, IsAuth a, IsMessage b) => MethodInfo * AuthUpdateMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy AuthUpdateMethodInfo a -> signature -> s #

authUpdate Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuth a, IsMessage b) 
=> a

auth: a Auth

-> b

msg: the Message auth is being updated for

-> Text

authHeader: the WWW-Authenticate/Proxy-Authenticate header

-> m Bool

Returns: True if auth is still a valid (but potentially unauthenticated) Auth. False if something about authParams could not be parsed or incorporated into auth at all.

Updates auth with the information from msg and authHeader, possibly un-authenticating it. As with authNew, this is normally only used by Session.

Properties

host

data AuthHostPropertyInfo Source #

Instances

AttrInfo AuthHostPropertyInfo Source # 
type AttrOrigin AuthHostPropertyInfo Source # 
type AttrLabel AuthHostPropertyInfo Source # 
type AttrGetType AuthHostPropertyInfo Source # 
type AttrBaseTypeConstraint AuthHostPropertyInfo Source # 
type AttrSetTypeConstraint AuthHostPropertyInfo Source # 
type AttrAllowedOps AuthHostPropertyInfo Source # 

clearAuthHost :: (MonadIO m, IsAuth o) => o -> m () Source #

getAuthHost :: (MonadIO m, IsAuth o) => o -> m Text Source #

setAuthHost :: (MonadIO m, IsAuth o) => o -> Text -> m () Source #

isAuthenticated

data AuthIsAuthenticatedPropertyInfo Source #

Instances

AttrInfo AuthIsAuthenticatedPropertyInfo Source # 
type AttrOrigin AuthIsAuthenticatedPropertyInfo Source # 
type AttrLabel AuthIsAuthenticatedPropertyInfo Source # 
type AttrLabel AuthIsAuthenticatedPropertyInfo = "is-authenticated"
type AttrGetType AuthIsAuthenticatedPropertyInfo Source # 
type AttrBaseTypeConstraint AuthIsAuthenticatedPropertyInfo Source # 
type AttrSetTypeConstraint AuthIsAuthenticatedPropertyInfo Source # 
type AttrAllowedOps AuthIsAuthenticatedPropertyInfo Source # 

isForProxy

data AuthIsForProxyPropertyInfo Source #

Instances

AttrInfo AuthIsForProxyPropertyInfo Source # 
type AttrOrigin AuthIsForProxyPropertyInfo Source # 
type AttrLabel AuthIsForProxyPropertyInfo Source # 
type AttrGetType AuthIsForProxyPropertyInfo Source # 
type AttrBaseTypeConstraint AuthIsForProxyPropertyInfo Source # 
type AttrSetTypeConstraint AuthIsForProxyPropertyInfo Source # 
type AttrAllowedOps AuthIsForProxyPropertyInfo Source # 

setAuthIsForProxy :: (MonadIO m, IsAuth o) => o -> Bool -> m () Source #

realm

data AuthRealmPropertyInfo Source #

Instances

AttrInfo AuthRealmPropertyInfo Source # 
type AttrOrigin AuthRealmPropertyInfo Source # 
type AttrLabel AuthRealmPropertyInfo Source # 
type AttrGetType AuthRealmPropertyInfo Source # 
type AttrBaseTypeConstraint AuthRealmPropertyInfo Source # 
type AttrSetTypeConstraint AuthRealmPropertyInfo Source # 
type AttrAllowedOps AuthRealmPropertyInfo Source # 

clearAuthRealm :: (MonadIO m, IsAuth o) => o -> m () Source #

getAuthRealm :: (MonadIO m, IsAuth o) => o -> m Text Source #

setAuthRealm :: (MonadIO m, IsAuth o) => o -> Text -> m () Source #

schemeName

data AuthSchemeNamePropertyInfo Source #

Instances

AttrInfo AuthSchemeNamePropertyInfo Source # 
type AttrOrigin AuthSchemeNamePropertyInfo Source # 
type AttrLabel AuthSchemeNamePropertyInfo Source # 
type AttrGetType AuthSchemeNamePropertyInfo Source # 
type AttrBaseTypeConstraint AuthSchemeNamePropertyInfo Source # 
type AttrSetTypeConstraint AuthSchemeNamePropertyInfo Source # 
type AttrAllowedOps AuthSchemeNamePropertyInfo Source #