soup.auth_domain

Module for [AuthDomain] class

Types 3

Server-side authentication.

A #SoupAuthDomain manages authentication for all or part of a soup.server.Server. To make a server require authentication, first create an appropriate subclass of #SoupAuthDomain, and then add it to the server with soup.server.Server.addAuthDomain.

In order for an auth domain to have any effect, you must add one or more paths to it (via soup.auth_domain.AuthDomain.addPath). To require authentication for all ordinary requests, add the path `"/"`. (Note that this does not include the special `""` URI (eg, "OPTIONS "), which must be added as a separate path if you want to cover it.)

If you need greater control over which requests should and shouldn't be authenticated, add paths covering everything you might want authenticated, and then use a filter (soup.auth_domain.AuthDomain.setFilter to bypass authentication for those requests that don't need it.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
AuthDomain self() nothrowReturns `this`, for use in `with` statements.
AuthDomainGidBuilder builder() static nothrowGet builder for [soup.auth_domain.AuthDomain] Returns: New builder object
soup.types.AuthDomainFilter filter() @property nothrowGet `filter` property. Returns: The [soup.types.AuthDomainFilter] for the domain.
void filter(soup.types.AuthDomainFilter propval) @property nothrowSet `filter` property. Params: propval = The [soup.types.AuthDomainFilter] for the domain.
void * filterData() @property nothrowGet `filterData` property. Returns: Data to pass to the [soup.types.AuthDomainFilter].
void filterData(void * propval) @property nothrowSet `filterData` property. Params: propval = Data to pass to the [soup.types.AuthDomainFilter].
soup.types.AuthDomainGenericAuthCallback genericAuthCallback() @property nothrowGet `genericAuthCallback` property. Returns: The [soup.types.AuthDomainGenericAuthCallback].
void genericAuthCallback(soup.types.AuthDomainGenericAuthCallback propval) @property nothrowSet `genericAuthCallback` property. Params: propval = The [soup.types.AuthDomainGenericAuthCallback].
void * genericAuthData() @property nothrowGet `genericAuthData` property. Returns: The data to pass to the [soup.types.AuthDomainGenericAuthCallback].
void genericAuthData(void * propval) @property nothrowSet `genericAuthData` property. Params: propval = The data to pass to the [soup.types.AuthDomainGenericAuthCallback].
bool proxy() @property nothrowGet `proxy` property. Returns: Whether or not this is a proxy auth domain.
string realm() @property nothrowGet `realm` property. Returns: The realm of this auth domain.
string accepts(soup.server_message.ServerMessage msg) nothrowChecks if msg contains appropriate authorization for domain to accept it.
void addPath(string path) nothrowAdds path to domain.
void challenge(soup.server_message.ServerMessage msg) nothrowAdds a "WWW-Authenticate" or "Proxy-Authenticate" header to msg.
bool checkPassword(soup.server_message.ServerMessage msg, string username, string password) nothrowChecks if msg authenticates to domain via username and password.
bool covers(soup.server_message.ServerMessage msg) nothrowChecks if domain requires msg to be authenticated (according to its paths and filter function).
string getRealm() nothrowGets the realm name associated with domain. Returns: domain's realm
void removePath(string path) nothrowRemoves path from domain.
void setFilter(soup.types.AuthDomainFilter filter) nothrowAdds filter as an authentication filter to domain.
void setGenericAuthCallback(soup.types.AuthDomainGenericAuthCallback authCallback) nothrowSets auth_callback as an authentication-handling callback for domain.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for soup.auth_domain.AuthDomain

Methods
T filter(soup.types.AuthDomainFilter propval) nothrowSet `filter` property. Params: propval = The [soup.types.AuthDomainFilter] for the domain. Returns: Builder instance for fluent chaining
T filterData(void * propval) nothrowSet `filterData` property. Params: propval = Data to pass to the [soup.types.AuthDomainFilter]. Returns: Builder instance for fluent chaining
T genericAuthCallback(soup.types.AuthDomainGenericAuthCallback propval) nothrowSet `genericAuthCallback` property. Params: propval = The [soup.types.AuthDomainGenericAuthCallback]. Returns: Builder instance for fluent chaining
T genericAuthData(void * propval) nothrowSet `genericAuthData` property. Params: propval = The data to pass to the [soup.types.AuthDomainGenericAuthCallback]. Returns: Builder instance for fluent chaining
T proxy(bool propval) nothrowSet `proxy` property. Params: propval = Whether or not this is a proxy auth domain. Returns: Builder instance for fluent chaining
T realm(string propval) nothrowSet `realm` property. Params: propval = The realm of this auth domain. Returns: Builder instance for fluent chaining

Fluent builder for soup.auth_domain.AuthDomain

Methods
AuthDomain build() nothrowCreate object from builder. Returns: New object