It derives from <GObject>.
Automatic HTTP Strict Transport Security enforcing for Session.
A HSTSEnforcer stores HSTS policies and enforces them when
required. HSTSEnforcer implements SessionFeature, so you
can add an HSTS enforcer to a session with Session.add_feature or
Session.add_feature_by_type.
HSTSEnforcer keeps track of all the HTTPS destinations that, when
connected to, return the Strict-Transport-Security header with valid
values. HSTSEnforcer will forget those destinations upon expiry
or when the server requests it.
When the Session the HSTSEnforcer is attached to queues or
restarts a message, the HSTSEnforcer 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 HSTSEnforcer are
advised to listen to changes in the Message:uri property in order
to be aware of changes in the message URI.
Note that HSTSEnforcer does not support any form of long-term
HSTS policy persistence. See HSTSEnforcerDB for a persistent
enforcer.
parent-instanceGets a list of domains for which there are policies in enforcer.
Passed: a <SoupHSTSEnforcer>.
Passed: a boolean.
whether to include session policies
Returned: a list, each a string.
a newly allocated list of domains. Use GLib.List.free_full and
byte-array:free to free the list.
Gets a list with the policies in enforcer.
Passed: a <SoupHSTSEnforcer>.
Passed: a boolean.
whether to include session policies
Returned: a list, each a <SoupHSTSPolicy>.
a newly allocated list of policies. Use GLib.List.free_full and
HSTSPolicy.free to free the list.
Gets whether self has a currently valid policy for domain.
Passed: a <SoupHSTSEnforcer>.
Passed: a string.
a domain.
Returned: a boolean.
#t if access to domain should happen over HTTPS, false
otherwise.
Gets whether self stores policies persistenly.
Passed: a <SoupHSTSEnforcer>.
Returned: a boolean.
#t if self storage is persistent or #f otherwise.
Creates a new HSTSEnforcer.
The base HSTSEnforcer class does not support persistent storage
of HSTS policies, see HSTSEnforcerDB for that.
Returned: a <SoupHSTSEnforcer>.
a new <SoupHSTSEnforcer>
Sets policy to self.
If policy is expired, any existing HSTS policy for its host will
be removed instead. If a policy existed for this host, it will be
replaced. Otherwise, the new policy will be inserted. If the policy is
a session policy, that is, one created with
HSTSPolicy.new_session_policy, the policy will not expire and
will be enforced during the lifetime of self’s Session.
Passed: a <SoupHSTSEnforcer>.
Passed: a <SoupHSTSPolicy>.
the policy of the HSTS host
Sets a session policy for domain.
A session policy is a policy that is permanent to the lifetime of
self’s Session and doesn’t expire.
Passed: a <SoupHSTSEnforcer>.
Passed: a string.
policy domain or hostname
Passed: a boolean.
#t if the policy applies on sub domains
Connect a handler with (connect object hstsenforcer:changed
handler). It is called as (handler self old-policy new-policy).
Emitted when hsts-enforcer changes.
If a policy has been added, new-policy will contain the
newly-added policy and old-policy will be #f. If a policy
has been deleted, old-policy will contain the to-be-deleted policy
and new-policy will be #f. If a policy has been changed,
old-policy will contain its old value, and new-policy its
new value.
Note that you shouldn’t modify the policies from a callback to this signal.
Passed: a <SoupHSTSEnforcer>.
Passed: a <SoupHSTSPolicy>.
the old <SoupHSTSPolicy> value
Passed: a <SoupHSTSPolicy>.
the new <SoupHSTSPolicy> value
The class closure for the "changed" signal.
To override it in a new class, give register-type #:vfuncs
`((changed . ,procedure)). The procedure is called as
(procedure self old-policy new-policy).
Passed: the class whose implementation to call:
<SoupHSTSEnforcer>, or a class that derives
from it, or its GType number.
Passed: a <SoupHSTSEnforcer>.
Passed: a <SoupHSTSPolicy>.
Passed: a <SoupHSTSPolicy>.
Gets whether self has a currently valid policy for domain.
To override it in a new class, give register-type #:vfuncs
`((has-valid-policy . ,procedure)). The procedure is called as
(procedure self domain) ⇒ %return.
Passed: the class whose implementation to call:
<SoupHSTSEnforcer>, or a class that derives
from it, or its GType number.
Passed: a <SoupHSTSEnforcer>.
Passed: a string.
a domain.
Returned: a boolean.
#t if access to domain should happen over HTTPS, false
otherwise.
Gets whether self stores policies persistenly.
To override it in a new class, give register-type #:vfuncs
`((is-persistent . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<SoupHSTSEnforcer>, or a class that derives
from it, or its GType number.
Passed: a <SoupHSTSEnforcer>.
Returned: a boolean.
#t if self storage is persistent or #f otherwise.