gi-soup-3.0.2: Libsoup bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Soup.Structs.HSTSPolicy

Description

HSTSPolicy implements HTTP policies, as described by RFC 6797.

domain represents the host that this policy applies to. The domain must be IDNA-canonicalized. [ctorhSTSPolicy.new] 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.

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

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

HasParentTypes HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

IsGValue (Maybe HSTSPolicy) Source #

Convert HSTSPolicy to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Soup.Structs.HSTSPolicy

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe HSTSPolicy -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe HSTSPolicy)

type ParentTypes HSTSPolicy Source # 
Instance details

Defined in GI.Soup.Structs.HSTSPolicy

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

Methods

Click to display all available methods, including inherited ones

Expand

Methods

copy, equal, free, includesSubdomains, isExpired, isSessionPolicy.

Getters

getDomain, getExpires, getMaxAge.

Setters

None.

copy

hSTSPolicyCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m HSTSPolicy

Returns: a copy of policy

Copies policy.

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.

free

hSTSPolicyFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m () 

Frees policy.

getDomain

hSTSPolicyGetDomain Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m Text

Returns: policy's domain.

Gets policy's domain.

getExpires

hSTSPolicyGetExpires Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m DateTime

Returns: A DateTime or Nothing if unset

Returns the expiration date for policy.

getMaxAge

hSTSPolicyGetMaxAge Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> HSTSPolicy

policy: a HSTSPolicy

-> m CULong

Returns: Max age in seconds

Returns the max age for policy.

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.

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.

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 [ctorhSTSPolicy.new_session_policy] for details.

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 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.

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.

newFull

hSTSPolicyNewFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

domain: policy domain or hostname

-> CULong

maxAge: max age of the policy

-> DateTime

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 [ctorhSTSPolicy.new], to use with an existing expiration date.

See [ctorhSTSPolicy.new] for details.

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 [classhSTSEnforcer] 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.