HSTSPolicy implements HTTP policies, as described by
RFC 6797.
domain represents the host that this policy applies to. The
domain must be IDNA-canonicalized. HSTSPolicy.new and related
methods will do this for you.
max-age contains the ’max-age’ value from the Strict Transport Security header and indicates the time to live of this policy, in seconds.
expires will be non-#f if the policy has been set by the
host and hence has an expiry time. If expires is #f, it
indicates that the policy is a permanent session policy set by the user
agent.
If include-subdomains is #t, the Strict Transport Security
policy must also be enforced on subdomains of domain.
Copies self.
Passed: a <SoupHSTSPolicy>.
Returned: a <SoupHSTSPolicy>.
a copy of self
Tests if self and policy2 are equal.
Passed: a <SoupHSTSPolicy>.
Passed: a <SoupHSTSPolicy>.
Returned: a boolean.
whether the policies are equal.
Frees self.
Passed: a <SoupHSTSPolicy>.
Gets self’s domain.
Passed: a <SoupHSTSPolicy>.
Returned: a string.
self’s domain.
Returns the expiration date for self.
Passed: a <SoupHSTSPolicy>.
Returned: a <GDateTime>.
A <GDateTime> or #f if unset
Returns the max age for self.
Passed: a <SoupHSTSPolicy>.
Returned: an unsigned 64-bit integer.
Max age in seconds
Gets whether self include its subdomains.
Passed: a <SoupHSTSPolicy>.
Returned: a boolean.
#t if self includes subdomains, #f otherwise.
Gets whether self is expired.
Permanent policies never expire.
Passed: a <SoupHSTSPolicy>.
Returned: a boolean.
#t if self is expired, #f otherwise.
Gets whether self is a non-permanent, non-expirable session policy.
See HSTSPolicy.new_session_policy for details.
Passed: a <SoupHSTSPolicy>.
Returned: a boolean.
#t if self is permanent, #f otherwise
Creates a new HSTSPolicy with the given attributes.
domain is a domain on which the strict transport security policy represented by this object must be enforced.
max-age is used to set the "expires" attribute on the policy; pass
SOUP_HSTS_POLICY_MAX_AGE_PAST for an already-expired policy, or a
lifetime in seconds.
If include-subdomains is #t, the strict transport security
policy must also be enforced on all subdomains of domain.
Passed: a string.
policy domain or hostname
Passed: an unsigned 64-bit integer.
max age of the policy
Passed: a boolean.
#t if the policy applies on subdomains
Returned: a <SoupHSTSPolicy>.
a new <SoupHSTSPolicy>.
Parses msg’s first "Strict-Transport-Security" response header and
returns a HSTSPolicy.
Passed: a <SoupMessage>.
Returned: a <SoupHSTSPolicy>, or #f.
a new <SoupHSTSPolicy>, or #f if no
valid "Strict-Transport-Security" response header was found.
Full version of HSTSPolicy.new, to use with an existing
expiration date.
See HSTSPolicy.new for details.
Passed: a string.
policy domain or hostname
Passed: an unsigned 64-bit integer.
max age of the policy
Passed: a <GDateTime>.
the date of expiration of the policy or #f for a permanent policy
Passed: a boolean.
#t if the policy applies on subdomains
Returned: a <SoupHSTSPolicy>.
a new <SoupHSTSPolicy>.
Creates a new session HSTSPolicy with the given attributes.
A session policy is a policy that is valid during the lifetime of the
HSTSEnforcer it is added to. Contrary to regular policies, it
has no expiration date and is not stored in persistent enforcers. These
policies are useful for user-agent to load their own or user-defined
rules.
domain is a domain on which the strict transport security policy represented by this object must be enforced.
If include-subdomains is #t, the strict transport security
policy must also be enforced on all subdomains of domain.
Passed: a string.
policy domain or hostname
Passed: a boolean.
#t if the policy applies on sub domains
Returned: a <SoupHSTSPolicy>.
a new <SoupHSTSPolicy>.