soup.types
D types for soup3 library
Types 33
Callback used by #SoupAuthDomainBasic for authentication purposes.
The application should verify that username and password and valid and return true or false.
If you are maintaining your own password database (rather than using the password to authenticate against some other system like PAM or a remote server), you should make sure you know what you are doing. In particular, don't store cleartext passwords, or easily-computed hashes of cleartext passwords, even if you don't care that much about the security of your server, because users will frequently use the same password for multiple sites, and so compromising any site with a cleartext (or easily-cracked) password database may give attackers access to other more-interesting sites as well.
Parameters
domain | the domain |
msg | the message being authenticated |
username | the username provided by the client |
password | the password provided by the client |
Returns
Callback used by #SoupAuthDomainDigest for authentication purposes.
The application should look up username in its password database, and return the corresponding encoded password (see [soup.auth_domain_digest.AuthDomainDigest.encodePassword].
Parameters
domain | the domain |
msg | the message being authenticated |
username | the username provided by the client |
Returns
username is not a valid user. domain will free the password when it is done with it.
The prototype for a #SoupAuthDomain filter.
See [soup.auth_domain.AuthDomain.setFilter] for details.
Parameters
domain | a #SoupAuthDomain |
msg | a #SoupServerMessage |
Returns
The prototype for a #SoupAuthDomain generic authentication callback.
The callback should look up the user's password, call [soup.auth_domain.AuthDomain.checkPassword], and use the return value from that method as its own return value.
In general, for security reasons, it is preferable to use the auth-domain-specific auth callbacks (eg, callbackAuthDomainBasicAuthCallback and callbackAuthDomainDigestAuthCallback), because they don't require keeping a cleartext password database. Most users will use the same password for many different sites, meaning if any site with a cleartext password database is compromised, accounts on other servers might be compromised as well. For many of the cases where classServer is used, this is not really relevant, but it may still be worth considering.
Parameters
domain | a #SoupAuthDomain |
msg | the #SoupServerMessage being authenticated |
username | the username from msg |
Returns
The prototype for a logging filter.
The filter callback will be invoked for each request or response, and should analyze it and return a enumLoggerLogLevel value indicating how much of the message to log.
Parameters
logger | the #SoupLogger |
msg | the message being logged |
Returns
enumLoggerLogLevel value indicating how much of the message to
log
The prototype for a custom printing callback.
level indicates what kind of information is being printed. Eg, it will be [soup.types.LoggerLogLevel.Headers] if data is header data.
direction is either '<', '>', or ' ', and data is the single line to print; the printer is expected to add a terminating newline.
To get the effect of the default printer, you would do:
printf ("%c %s\n", direction, data);Parameters
logger | the #SoupLogger |
level | the level of the information being printed. |
direction | a single-character prefix to data |
data | data to print |
The callback passed to [soup.message_headers.MessageHeaders.foreach_].
Parameters
name | the header name |
value | the header value |
A callback used to handle requests to a classServer.
path and query contain the likewise-named components of the Request-URI, subject to certain assumptions. By default, classServer decodes all percent-encoding in the URI path, such that "/foo2Fbar`"` is treated the same as "/foo/bar". If your server is serving resources in some non-POSIX-filesystem namespace, you may want to distinguish those as two distinct paths. In that case, you can set the propertyServer:raw-paths property when creating the classServer, and it will leave those characters undecoded.
query contains the query component of the Request-URI parsed according to the rules for HTML form handling. Although this is the only commonly-used query string format in HTTP, there is nothing that actually requires that HTTP URIs use that format; if your server needs to use some other format, you can just ignore query, and call [soup.message.Message.getUri] and parse the URI's query field yourself.
See [soup.server.Server.addHandler] and [soup.server.Server.addEarlyHandler] for details of what handlers can/should do.
Parameters
server | the #SoupServer |
msg | the message being processed |
path | the path component of msg's Request-URI |
query | the parsed query component of msg's Request-URI |
A callback used to handle WebSocket requests to a #SoupServer.
The callback will be invoked after sending the handshake response back to the client (and is only invoked if the handshake was successful).
path contains the path of the Request-URI, subject to the same rules as callbackServerCallback (qv).
Parameters
server | the #SoupServer |
msg | the #SoupServerMessage |
path | the path component of msg's Request-URI |
connection | the newly created WebSocket connection |
Variables 12
COOKIE_MAX_AGE_ONE_DAY = 0A constant corresponding to 1 day.
For use with [soup.cookie.Cookie.new_] and [soup.cookie.Cookie.setMaxAge].
COOKIE_MAX_AGE_ONE_HOUR = 3600A constant corresponding to 1 hour.
For use with [soup.cookie.Cookie.new_] and [soup.cookie.Cookie.setMaxAge].
COOKIE_MAX_AGE_ONE_WEEK = 0A constant corresponding to 1 week.
For use with [soup.cookie.Cookie.new_] and [soup.cookie.Cookie.setMaxAge].
COOKIE_MAX_AGE_ONE_YEAR = 0A constant corresponding to 1 year.
For use with [soup.cookie.Cookie.new_] and [soup.cookie.Cookie.setMaxAge].
FORM_MIME_TYPE_MULTIPART = "multipart/form-data"A macro containing the value multipart/form-data; the MIME type used for posting form data that contains files to be uploaded.
FORM_MIME_TYPE_URLENCODED = "application/x-www-form-urlencoded"A macro containing the value application/x-www-form-urlencoded; the default MIME type for POSTing HTML form data.
HSTS_POLICY_MAX_AGE_PAST = 0An expiration date that is always in the past.
HTTP_URI_FLAGS = 482The set of #GUriFlags libsoup expects all #GUri to use.
MAJOR_VERSION = 3Like func@get_major_version, but from the headers used at application compile time, rather than from the library linked against at application run time.
MICRO_VERSION = 5Like func@get_micro_version, but from the headers used at application compile time, rather than from the library linked against at application run time.
MINOR_VERSION = 4Like func@get_minor_version, but from the headers used at application compile time, rather than from the library linked against at application run time.
VERSION_MIN_REQUIRED = 2A macro that should be defined by the user prior to including libsoup.h.
The definition should be one of the predefined libsoup version macros: SOUP_VERSION_2_24, SOUP_VERSION_2_26, ...
This macro defines the earliest version of libsoup that the package is required to be able to compile against.
If the compiler is configured to warn about the use of deprecated functions, then using functions that were deprecated in version [soup.types.VERSION_MIN_REQUIRED] or earlier will cause warnings (but using functions deprecated in later releases will not).