soup.hstsenforcer
Module for HSTSEnforcer class
Types 3
Automatic HTTP Strict Transport Security enforcing for soup.session.Session.
A #SoupHSTSEnforcer stores HSTS policies and enforces them when required. #SoupHSTSEnforcer implements soup.session_feature.SessionFeature, so you can add an HSTS enforcer to a session with soup.session.Session.addFeature or soup.session.Session.addFeatureByType.
#SoupHSTSEnforcer keeps track of all the HTTPS destinations that, when connected to, return the Strict-Transport-Security header with valid values. #SoupHSTSEnforcer will forget those destinations upon expiry or when the server requests it.
When the soup.session.Session the #SoupHSTSEnforcer is attached to queues or restarts a message, the #SoupHSTSEnforcer will rewrite the URI to HTTPS if the destination is a known HSTS host and is contacted over an insecure transport protocol (HTTP). Users of #SoupHSTSEnforcer are advised to listen to changes in the soup.message.Message.uri property in order to be aware of changes in the message URI.
Note that #SoupHSTSEnforcer does not support any form of long-term HSTS policy persistence. See soup.hstsenforcer_db.HSTSEnforcerDB for a persistent enforcer.
HSTSEnforcer self()Returns `this`, for use in `with` statements.HSTSEnforcerGidBuilder builder()Get builder for [soup.hstsenforcer.HSTSEnforcer] Returns: New builder objectstring[] getDomains(bool sessionPolicies)Gets a list of domains for which there are policies in enforcer.soup.hstspolicy.HSTSPolicy[] getPolicies(bool sessionPolicies)Gets a list with the policies in enforcer.bool hasValidPolicy(string domain)Gets whether hsts_enforcer has a currently valid policy for domain.bool isPersistent()Gets whether hsts_enforcer stores policies persistenly. Returns: true if hsts_enforcer storage is persistent or false otherwise.void setPolicy(soup.hstspolicy.HSTSPolicy policy)Sets policy to hsts_enforcer.void setSessionPolicy(string domain, bool includeSubdomains)Sets a session policy for domain.gulong connectChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == soup.hstspolicy.HSTSPolicy)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == soup.hstspolicy.HSTSPolicy)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : soup.hstsenforcer.HSTSEnforcer)))
&& Parameters!T.length < 4)Connect to `Changed` signal.Fluent builder implementation template for soup.hstsenforcer.HSTSEnforcer
Fluent builder for soup.hstsenforcer.HSTSEnforcer
HSTSEnforcer build()Create object from builder. Returns: New object