gi-soup-2.4.23: Libsoup bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Structs.HSTSPolicy

Description

An HTTP Strict Transport Security policy.

domain represents the host that this policy applies to. The domain must be IDNA-canonicalized. hSTSPolicyNew and related methods will do this for you.

maxAge 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-Nothing if the policy has been set by the host and hence has an expiry time. If expires is Nothing, it indicates that the policy is a permanent session policy set by the user agent.

If includeSubdomains is True, the Strict Transport Security policy must also be enforced on subdomains of domain.

Since: 2.68

Synopsis

Exported types

newtype HSTSPolicy Source #

Memory-managed wrapper type.

Constructors

HSTSPolicy (ManagedPtr HSTSPolicy) 

Instances

Instances details
Eq HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

Methods

(==) :: HSTSPolicy -> HSTSPolicy -> Bool

(/=) :: HSTSPolicy -> HSTSPolicy -> Bool

GBoxed HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

ManagedPtrNewtype HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

Methods

toManagedPtr :: HSTSPolicy -> ManagedPtr HSTSPolicy

TypedObject HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

Methods

glibType :: IO GType

IsGValue HSTSPolicy Source #

Convert HSTSPolicy to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Soup.Structs.HSTSPolicy

Methods

toGValue :: HSTSPolicy -> IO GValue

fromGValue :: GValue -> IO HSTSPolicy

HasParentTypes HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

tag ~ 'AttrSet => Constructible HSTSPolicy tag Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

Methods

new :: MonadIO m => (ManagedPtr HSTSPolicy -> HSTSPolicy) -> [AttrOp HSTSPolicy tag] -> m HSTSPolicy

type ParentTypes HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

type ParentTypes HSTSPolicy = '[] :: [Type]

newZeroHSTSPolicy :: MonadIO m => m HSTSPolicy Source #

Construct a HSTSPolicy struct initialized to zero.

Methods

Overloaded methods

copy

hSTSPolicyCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m HSTSPolicy

Returns: a copy of policy

Copies policy.

Since: 2.68

equal

hSTSPolicyEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy1: a HSTSPolicy

-> HSTSPolicy

policy2: a HSTSPolicy

-> m Bool

Returns: whether the policies are equal.

Tests if policy1 and policy2 are equal.

Since: 2.68

free

hSTSPolicyFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m () 

Frees policy.

Since: 2.68

getDomain

hSTSPolicyGetDomain Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m Text

Returns: policy's domain.

Gets policy's domain.

Since: 2.68

includesSubdomains

hSTSPolicyIncludesSubdomains Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m Bool

Returns: True if policy includes subdomains, False otherwise.

Gets whether policy include its subdomains.

Since: 2.68

isExpired

hSTSPolicyIsExpired Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m Bool

Returns: True if policy is expired, False otherwise.

Gets whether policy is expired. Permanent policies never expire.

Since: 2.68

isSessionPolicy

hSTSPolicyIsSessionPolicy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m Bool

Returns: True if policy is permanent, False otherwise

Gets whether policy is a non-permanent, non-expirable session policy. see hSTSPolicyNewSessionPolicy for details.

Since: 2.68

new

hSTSPolicyNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

domain: policy domain or hostname

-> CULong

maxAge: max age of the policy

-> Bool

includeSubdomains: True if the policy applies on subdomains

-> m HSTSPolicy

Returns: a new HSTSPolicy.

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.

maxAge 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 includeSubdomains is True, the strict transport security policy must also be enforced on all subdomains of domain.

Since: 2.68

newFromResponse

hSTSPolicyNewFromResponse Source #

Arguments

:: (HasCallStack, MonadIO m, IsMessage a) 
=> a

msg: a Message

-> m (Maybe HSTSPolicy)

Returns: a new HSTSPolicy, or Nothing if no valid "Strict-Transport-Security" response header was found.

Parses msg's first "Strict-Transport-Security" response header and returns a HSTSPolicy.

Since: 2.68

newFull

hSTSPolicyNewFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

domain: policy domain or hostname

-> CULong

maxAge: max age of the policy

-> Date

expires: the date of expiration of the policy or Nothing for a permanent policy

-> Bool

includeSubdomains: True if the policy applies on subdomains

-> m HSTSPolicy

Returns: a new HSTSPolicy.

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

Since: 2.68

newSessionPolicy

hSTSPolicyNewSessionPolicy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

domain: policy domain or hostname

-> Bool

includeSubdomains: True if the policy applies on sub domains

-> m HSTSPolicy

Returns: a new HSTSPolicy.

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 includeSubdomains is True, the strict transport security policy must also be enforced on all subdomains of domain.

Since: 2.68

Properties

domain

The domain or hostname that the policy applies to

clearHSTSPolicyDomain :: MonadIO m => HSTSPolicy -> m () Source #

Set the value of the “domain” field to Nothing. When overloading is enabled, this is equivalent to

clear #domain

getHSTSPolicyDomain :: MonadIO m => HSTSPolicy -> m (Maybe Text) Source #

Get the value of the “domain” field. When overloading is enabled, this is equivalent to

get hSTSPolicy #domain

setHSTSPolicyDomain :: MonadIO m => HSTSPolicy -> CString -> m () Source #

Set the value of the “domain” field. When overloading is enabled, this is equivalent to

set hSTSPolicy [ #domain := value ]

expires

the policy expiration time, or Nothing for a permanent session policy

clearHSTSPolicyExpires :: MonadIO m => HSTSPolicy -> m () Source #

Set the value of the “expires” field to Nothing. When overloading is enabled, this is equivalent to

clear #expires

getHSTSPolicyExpires :: MonadIO m => HSTSPolicy -> m (Maybe Date) Source #

Get the value of the “expires” field. When overloading is enabled, this is equivalent to

get hSTSPolicy #expires

setHSTSPolicyExpires :: MonadIO m => HSTSPolicy -> Ptr Date -> m () Source #

Set the value of the “expires” field. When overloading is enabled, this is equivalent to

set hSTSPolicy [ #expires := value ]

includeSubdomains

True if the policy applies on subdomains

getHSTSPolicyIncludeSubdomains :: MonadIO m => HSTSPolicy -> m Bool Source #

Get the value of the “include_subdomains” field. When overloading is enabled, this is equivalent to

get hSTSPolicy #includeSubdomains

setHSTSPolicyIncludeSubdomains :: MonadIO m => HSTSPolicy -> Bool -> m () Source #

Set the value of the “include_subdomains” field. When overloading is enabled, this is equivalent to

set hSTSPolicy [ #includeSubdomains := value ]

maxAge

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

getHSTSPolicyMaxAge :: MonadIO m => HSTSPolicy -> m CULong Source #

Get the value of the “max_age” field. When overloading is enabled, this is equivalent to

get hSTSPolicy #maxAge

setHSTSPolicyMaxAge :: MonadIO m => HSTSPolicy -> CULong -> m () Source #

Set the value of the “max_age” field. When overloading is enabled, this is equivalent to

set hSTSPolicy [ #maxAge := value ]