Soup.HSTSEnforcer¶
| Subclasses: | Soup.HSTSEnforcerDB |
|---|
Methods¶
| Inherited: | GObject.Object (37), Soup.SessionFeature (5) |
|---|---|
| Structs: | GObject.ObjectClass (5) |
| class | new () |
get_domains (session_policies) |
|
get_policies (session_policies) |
|
has_valid_policy (domain) |
|
is_persistent () |
|
set_policy (policy) |
|
set_session_policy (domain, include_subdomains) |
Virtual Methods¶
| Inherited: | GObject.Object (7), Soup.SessionFeature (8) |
|---|
do_changed (old_policy, new_policy) |
|
do_has_valid_policy (domain) |
|
do_hsts_enforced (message) |
|
do_is_persistent () |
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) |
|---|
| Name | Short Description |
|---|---|
changed |
Emitted when hsts_enforcer changes. |
hsts-enforced |
Emitted when hsts_enforcer has upgraded the protocol for message to HTTPS as a result of matching its domain with a HSTS policy. |
Class Details¶
-
class
Soup.HSTSEnforcer(**kwargs)¶ Bases: GObject.Object,Soup.SessionFeatureAbstract: No Structure: Soup.HSTSEnforcerClass-
classmethod
new()¶ Returns: a new Soup.HSTSEnforcerReturn type: Soup.HSTSEnforcerCreates a new
Soup.HSTSEnforcer. The baseSoup.HSTSEnforcerclass does not support persistent storage of HSTS policies, seeSoup.HSTSEnforcerDBfor that.New in version 2.68.
-
get_domains(session_policies)¶ Parameters: session_policies ( bool) – whether to include session policiesReturns: a newly allocated list of domains. Use g_list_free_full() and GLib.free() to free the list.Return type: [ str]Gets a list of domains for which there are policies in enforcer.
New in version 2.68.
-
get_policies(session_policies)¶ Parameters: session_policies ( bool) – whether to include session policiesReturns: a newly allocated list of policies. Use g_list_free_full() and Soup.HSTSPolicy.free() to free the list.Return type: [ Soup.HSTSPolicy]Gets a list with the policies in enforcer.
New in version 2.68.
-
has_valid_policy(domain)¶ Parameters: domain ( str) – a domain.Returns: Trueif access to domain should happen over HTTPS, false otherwise.Return type: boolGets whether self has a currently valid policy for domain.
New in version 2.68.
-
is_persistent()¶ Returns: Trueif self storage is persistent orFalseotherwise.Return type: boolGets whether self stores policies persistenly.
New in version 2.68.
-
set_policy(policy)¶ Parameters: policy ( Soup.HSTSPolicy) – the policy of the HSTS hostSets 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
Soup.HSTSPolicy.new_session_policy(), the policy will not expire and will be enforced during the lifetime of self’sSoup.Session.New in version 2.68.
-
set_session_policy(domain, include_subdomains)¶ Parameters: Sets a session policy for domain. A session policy is a policy that is permanent to the lifetime of self’s
Soup.Sessionand doesn’t expire.New in version 2.68.
-
do_changed(old_policy, new_policy) virtual¶ Parameters: - old_policy (
Soup.HSTSPolicy) – - new_policy (
Soup.HSTSPolicy) –
- old_policy (
-
do_has_valid_policy(domain) virtual¶ Parameters: domain ( str) – a domain.Returns: Trueif access to domain should happen over HTTPS, false otherwise.Return type: boolGets whether hsts_enforcer has a currently valid policy for domain.
New in version 2.68.
-
do_hsts_enforced(message) virtual¶ Parameters: message ( Soup.Message) –
-
classmethod
Signal Details¶
-
Soup.HSTSEnforcer.signals.changed(h_s_t_s_enforcer, old_policy, new_policy)¶ Signal Name: changedFlags: Parameters: - h_s_t_s_enforcer (
Soup.HSTSEnforcer) – The object which received the signal - old_policy (
Soup.HSTSPolicy) – the oldSoup.HSTSPolicyvalue - new_policy (
Soup.HSTSPolicy) – the newSoup.HSTSPolicyvalue
Emitted when hsts_enforcer changes. If a policy has been added, new_policy will contain the newly-added policy and old_policy will be
None. If a policy has been deleted, old_policy will contain the to-be-deleted policy and new_policy will beNone. 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.
- h_s_t_s_enforcer (
-
Soup.HSTSEnforcer.signals.hsts_enforced(h_s_t_s_enforcer, message)¶ Signal Name: hsts-enforcedFlags: Parameters: - h_s_t_s_enforcer (
Soup.HSTSEnforcer) – The object which received the signal - message (
Soup.Message) – the message for which HSTS is being enforced
Emitted when hsts_enforcer has upgraded the protocol for message to HTTPS as a result of matching its domain with a HSTS policy.
- h_s_t_s_enforcer (