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

Contents

Description

 

Synopsis

Exported types

Methods

accepts

authDomainAccepts Source #

Arguments

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

domain: a AuthDomain

-> b

msg: a Message

-> m (Maybe Text)

Returns: the username that msg has authenticated as, if in fact it has authenticated. Nothing otherwise.

Checks if msg contains appropriate authorization for domain to accept it. Mirroring authDomainCovers, this does not check whether or not domain <emphasis>cares</emphasis> if msg is authorized.

This is used by Server internally and is probably of no use to anyone else.

addPath

data AuthDomainAddPathMethodInfo Source #

Instances

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

authDomainAddPath Source #

Arguments

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

domain: a AuthDomain

-> Text

path: the path to add to domain

-> m () 

Adds path to domain, such that requests under path on domain's server will require authentication (unless overridden by authDomainRemovePath or authDomainSetFilter).

You can also add paths by setting the AUTH_DOMAIN_ADD_PATH property, which can also be used to add one or more paths at construct time.

basicSetAuthCallback

authDomainBasicSetAuthCallback Source #

Arguments

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

domain: the domain

-> AuthDomainBasicAuthCallback

callback: the callback

-> m () 

Sets the callback that domain will use to authenticate incoming requests. For each request containing authorization, domain will invoke the callback, and then either accept or reject the request based on callback's return value.

You can also set the auth callback by setting the AUTH_DOMAIN_BASIC_AUTH_CALLBACK and AUTH_DOMAIN_BASIC_AUTH_DATA properties, which can also be used to set the callback at construct time.

challenge

authDomainChallenge Source #

Arguments

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

domain: a AuthDomain

-> b

msg: a Message

-> m () 

Adds a "WWW-Authenticate" or "Proxy-Authenticate" header to msg, requesting that the client authenticate, and sets msg's status accordingly.

This is used by Server internally and is probably of no use to anyone else.

checkPassword

authDomainCheckPassword Source #

Arguments

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

domain: a AuthDomain

-> b

msg: a Message

-> Text

username: a username

-> Text

password: a password

-> m Bool

Returns: whether or not the message is authenticated

Checks if msg authenticates to domain via username and password. This would normally be called from a AuthDomainGenericAuthCallback.

covers

data AuthDomainCoversMethodInfo Source #

Instances

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

authDomainCovers Source #

Arguments

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

domain: a AuthDomain

-> b

msg: a Message

-> m Bool

Returns: True if domain requires msg to be authenticated

Checks if domain requires msg to be authenticated (according to its paths and filter function). This does not actually look at whether msg <emphasis>is</emphasis> authenticated, merely whether or not it needs to be.

This is used by Server internally and is probably of no use to anyone else.

digestSetAuthCallback

authDomainDigestSetAuthCallback Source #

Arguments

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

domain: the domain

-> AuthDomainDigestAuthCallback

callback: the callback

-> m () 

Sets the callback that domain will use to authenticate incoming requests. For each request containing authorization, domain will invoke the callback, and then either accept or reject the request based on callback's return value.

You can also set the auth callback by setting the AUTH_DOMAIN_DIGEST_AUTH_CALLBACK and AUTH_DOMAIN_DIGEST_AUTH_DATA properties, which can also be used to set the callback at construct time.

getRealm

authDomainGetRealm Source #

Arguments

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

domain: a AuthDomain

-> m Text

Returns: domain's realm

Gets the realm name associated with domain

removePath

authDomainRemovePath Source #

Arguments

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

domain: a AuthDomain

-> Text

path: the path to remove from domain

-> m () 

Removes path from domain, such that requests under path on domain's server will NOT require authentication.

This is not simply an undo-er for authDomainAddPath; it can be used to "carve out" a subtree that does not require authentication inside a hierarchy that does. Note also that unlike with authDomainAddPath, this cannot be overridden by adding a filter, as filters can only bypass authentication that would otherwise be required, not require it where it would otherwise be unnecessary.

You can also remove paths by setting the AUTH_DOMAIN_REMOVE_PATH property, which can also be used to remove one or more paths at construct time.

setFilter

authDomainSetFilter Source #

Arguments

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

domain: a AuthDomain

-> AuthDomainFilter

filter: the auth filter for domain

-> m () 

Adds filter as an authentication filter to domain. The filter gets a chance to bypass authentication for certain requests that would otherwise require it. Eg, it might check the message's path in some way that is too complicated to do via the other methods, or it might check the message's method, and allow GETs but not PUTs.

The filter function returns True if the request should still require authentication, or False if authentication is unnecessary for this request.

To help prevent security holes, your filter should return True by default, and only return False under specifically-tested circumstances, rather than the other way around. Eg, in the example above, where you want to authenticate PUTs but not GETs, you should check if the method is GET and return False in that case, and then return True for all other methods (rather than returning True for PUT and False for all other methods). This way if it turned out (now or later) that some paths supported additional methods besides GET and PUT, those methods would default to being NOT allowed for unauthenticated users.

You can also set the filter by setting the AUTH_DOMAIN_FILTER and AUTH_DOMAIN_FILTER_DATA properties, which can also be used to set the filter at construct time.

setGenericAuthCallback

authDomainSetGenericAuthCallback Source #

Arguments

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

domain: a AuthDomain

-> AuthDomainGenericAuthCallback

authCallback: the auth callback

-> m () 

Sets authCallback as an authentication-handling callback for domain. Whenever a request comes in to domain which cannot be authenticated via a domain-specific auth callback (eg, AuthDomainDigestAuthCallback), the generic auth callback will be invoked. See AuthDomainGenericAuthCallback for information on what the callback should do.

tryGenericAuthCallback

authDomainTryGenericAuthCallback :: (HasCallStack, MonadIO m, IsAuthDomain a, IsMessage b) => a -> b -> Text -> m Bool Source #

No description available in the introspection data.

Properties

addPath

data AuthDomainAddPathPropertyInfo Source #

Instances

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

filter

data AuthDomainFilterPropertyInfo Source #

Instances

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

setAuthDomainFilter :: (MonadIO m, IsAuthDomain o) => o -> Ptr () -> m () Source #

filterData

data AuthDomainFilterDataPropertyInfo Source #

Instances

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

genericAuthCallback

data AuthDomainGenericAuthCallbackPropertyInfo Source #

Instances

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

genericAuthData

data AuthDomainGenericAuthDataPropertyInfo Source #

Instances

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

proxy

data AuthDomainProxyPropertyInfo Source #

Instances

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

realm

data AuthDomainRealmPropertyInfo Source #

Instances

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

removePath

data AuthDomainRemovePathPropertyInfo Source #

Instances

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