Soup.HSTSEnforcer¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when hsts_enforcer changes. |
|
Emitted when hsts_enforcer has upgraded the protocol for message to HTTPS as a result of matching its domain with a HSTS policy. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Soup.HSTSEnforcer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Soup.HSTSEnforcer
- Return type:
Creates a new
Soup.HSTSEnforcer
. The baseSoup.HSTSEnforcer
class does not support persistent storage of HSTS policies, seeSoup.HSTSEnforcerDB
for that.New in version 2.68.
- get_domains(session_policies)¶
- Parameters:
session_policies (
bool
) – whether to include session policies- Returns:
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 policies- Returns:
a newly allocated list of policies. Use g_list_free_full() and
Soup.HSTSPolicy.free
() to free the list.- Return type:
Gets a list with the policies in enforcer.
New in version 2.68.
- has_valid_policy(domain)¶
- Parameters:
domain (
str
) – a domain.- Returns:
True
if access to domain should happen over HTTPS, false otherwise.- Return type:
Gets whether self has a currently valid policy for domain.
New in version 2.68.
- is_persistent()¶
-
Gets whether self stores policies persistenly.
New in version 2.68.
- set_policy(policy)¶
- Parameters:
policy (
Soup.HSTSPolicy
) – the policy of the HSTS host
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
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.Session
and doesn’t expire.New in version 2.68.
- do_changed(old_policy, new_policy) virtual¶
- Parameters:
old_policy (
Soup.HSTSPolicy
) –new_policy (
Soup.HSTSPolicy
) –
- do_has_valid_policy(domain) virtual¶
- Parameters:
domain (
str
) – a domain.- Returns:
True
if access to domain should happen over HTTPS, false otherwise.- Return type:
Gets whether hsts_enforcer has a currently valid policy for domain.
New in version 2.68.
- do_hsts_enforced(message) virtual¶
- Parameters:
message (
Soup.Message
) –
Signal Details¶
- Soup.HSTSEnforcer.signals.changed(h_s_t_s_enforcer, old_policy, new_policy)¶
- Signal Name:
changed
- Flags:
- Parameters:
h_s_t_s_enforcer (
Soup.HSTSEnforcer
) – The object which received the signalold_policy (
Soup.HSTSPolicy
) – the oldSoup.HSTSPolicy
valuenew_policy (
Soup.HSTSPolicy
) – the newSoup.HSTSPolicy
value
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.
- Soup.HSTSEnforcer.signals.hsts_enforced(h_s_t_s_enforcer, message)¶
- Signal Name:
hsts-enforced
- Flags:
- Parameters:
h_s_t_s_enforcer (
Soup.HSTSEnforcer
) – The object which received the signalmessage (
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.