soup.auth_domain

Module for [AuthDomain] class

Types 3

Server-side authentication.

A #SoupAuthDomain manages authentication for all or part of a class@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 _gType() @property
AuthDomain self()Returns `this`, for use in `with` statements.
AuthDomainGidBuilder builder()Get builder for [soup.auth_domain.AuthDomain] Returns: New builder object
soup.types.AuthDomainFilter filter() @propertyGet `filter` property. Returns: The `callback@AuthDomainFilter` for the domain.
void filter(soup.types.AuthDomainFilter propval) @propertySet `filter` property. Params: propval = The `callback@AuthDomainFilter` for the domain.
void * filterData() @propertyGet `filterData` property. Returns: Data to pass to the `callback@AuthDomainFilter`.
void filterData(void * propval) @propertySet `filterData` property. Params: propval = Data to pass to the `callback@AuthDomainFilter`.
soup.types.AuthDomainGenericAuthCallback genericAuthCallback() @propertyGet `genericAuthCallback` property. Returns: The `callback@AuthDomainGenericAuthCallback`.
void genericAuthCallback(soup.types.AuthDomainGenericAuthCallback propval) @propertySet `genericAuthCallback` property. Params: propval = The `callback@AuthDomainGenericAuthCallback`.
void * genericAuthData() @propertyGet `genericAuthData` property. Returns: The data to pass to the `callback@AuthDomainGenericAuthCallback`.
void genericAuthData(void * propval) @propertySet `genericAuthData` property. Params: propval = The data to pass to the `callback@AuthDomainGenericAuthCallback`.
bool proxy() @propertyGet `proxy` property. Returns: Whether or not this is a proxy auth domain.
string realm() @propertyGet `realm` property. Returns: The realm of this auth domain.
string accepts(soup.server_message.ServerMessage msg)Checks if msg contains appropriate authorization for domain to accept it.
void addPath(string path)Adds path to domain.
void challenge(soup.server_message.ServerMessage msg)Adds a "WWW-Authenticate" or "Proxy-Authenticate" header to msg.
bool checkPassword(soup.server_message.ServerMessage msg, string username, string password)Checks if msg authenticates to domain via username and password.
bool covers(soup.server_message.ServerMessage msg)Checks if domain requires msg to be authenticated (according to its paths and filter function).
string getRealm()Gets the realm name associated with domain. Returns: domain's realm
void removePath(string path)Removes path from domain.
void setFilter(soup.types.AuthDomainFilter filter)Adds filter as an authentication filter to domain.
void setGenericAuthCallback(soup.types.AuthDomainGenericAuthCallback authCallback)Sets auth_callback as an authentication-handling callback for domain.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
T filter(soup.types.AuthDomainFilter propval)Set `filter` property. Params: propval = The `callback@AuthDomainFilter` for the domain. Returns: Builder instance for fluent chaining
T filterData(void * propval)Set `filterData` property. Params: propval = Data to pass to the `callback@AuthDomainFilter`. Returns: Builder instance for fluent chaining
T genericAuthCallback(soup.types.AuthDomainGenericAuthCallback propval)Set `genericAuthCallback` property. Params: propval = The `callback@AuthDomainGenericAuthCallback`. Returns: Builder instance for fluent chaining
T genericAuthData(void * propval)Set `genericAuthData` property. Params: propval = The data to pass to the `callback@AuthDomainGenericAuthCallback`. Returns: Builder instance for fluent chaining
T proxy(bool propval)Set `proxy` property. Params: propval = Whether or not this is a proxy auth domain. Returns: Builder instance for fluent chaining
T realm(string propval)Set `realm` property. Params: propval = The realm of this auth domain. Returns: Builder instance for fluent chaining

Fluent builder for [soup.auth_domain.AuthDomain]

Methods