Gjsify LogoGjsify Logo

An HTTP Strict Transport Security policy.

domain represents the host that this policy applies to. The domain must be IDNA-canonicalized. soup_hsts_policy_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-%NULL if the policy has been set by the host and hence has an expiry time. If expires is %NULL, it indicates that the policy is a permanent session policy set by the user agent.

If include_subdomains is %TRUE, the Strict Transport Security policy must also be enforced on subdomains of domain.

record

Hierarchy

  • HSTSPolicy

Index

Constructors

  • new HSTSPolicy(domain: string, max_age: number, include_subdomains: boolean): Soup.HSTSPolicy
  • Creates a new #SoupHSTSPolicy 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 %TRUE, the strict transport security policy must also be enforced on all subdomains of domain.

    Parameters

    • domain: string

      policy domain or hostname

    • max_age: number

      max age of the policy

    • include_subdomains: boolean

      %TRUE if the policy applies on subdomains

    Returns Soup.HSTSPolicy

Properties

domain: string

The domain or hostname that the policy applies to

field
expires: Soup.Date

the policy expiration time, or %NULL for a permanent session policy

field
include_subdomains: boolean

%TRUE if the policy applies on subdomains

field
max_age: number

The maximum age, in seconds, that the policy is valid

field
name: string

Methods

  • free(): void
  • get_domain(): string
  • includes_subdomains(): boolean
  • is_expired(): boolean
  • is_session_policy(): boolean
  • Gets whether policy is a non-permanent, non-expirable session policy. see soup_hsts_policy_new_session_policy() for details.

    Returns boolean

  • new(domain: string, max_age: number, include_subdomains: boolean): Soup.HSTSPolicy
  • Creates a new #SoupHSTSPolicy 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 %TRUE, the strict transport security policy must also be enforced on all subdomains of domain.

    Parameters

    • domain: string

      policy domain or hostname

    • max_age: number

      max age of the policy

    • include_subdomains: boolean

      %TRUE if the policy applies on subdomains

    Returns Soup.HSTSPolicy

  • Full version of #soup_hsts_policy_new(), to use with an existing expiration date. See #soup_hsts_policy_new() for details.

    Parameters

    • domain: string

      policy domain or hostname

    • max_age: number

      max age of the policy

    • expires: Soup.Date

      the date of expiration of the policy or %NULL for a permanent policy

    • include_subdomains: boolean

      %TRUE if the policy applies on subdomains

    Returns Soup.HSTSPolicy

  • new_session_policy(domain: string, include_subdomains: boolean): Soup.HSTSPolicy
  • Creates a new session #SoupHSTSPolicy with the given attributes. A session policy is a policy that is valid during the lifetime of the #SoupHSTSEnforcer 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 %TRUE, the strict transport security policy must also be enforced on all subdomains of domain.

    Parameters

    • domain: string

      policy domain or hostname

    • include_subdomains: boolean

      %TRUE if the policy applies on sub domains

    Returns Soup.HSTSPolicy

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method