| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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
- newtype HSTSPolicy = HSTSPolicy (ManagedPtr HSTSPolicy)
- newZeroHSTSPolicy :: MonadIO m => m HSTSPolicy
- hSTSPolicyCopy :: (HasCallStack, MonadIO m) => HSTSPolicy -> m HSTSPolicy
- hSTSPolicyEqual :: (HasCallStack, MonadIO m) => HSTSPolicy -> HSTSPolicy -> m Bool
- hSTSPolicyFree :: (HasCallStack, MonadIO m) => HSTSPolicy -> m ()
- hSTSPolicyGetDomain :: (HasCallStack, MonadIO m) => HSTSPolicy -> m Text
- hSTSPolicyIncludesSubdomains :: (HasCallStack, MonadIO m) => HSTSPolicy -> m Bool
- hSTSPolicyIsExpired :: (HasCallStack, MonadIO m) => HSTSPolicy -> m Bool
- hSTSPolicyIsSessionPolicy :: (HasCallStack, MonadIO m) => HSTSPolicy -> m Bool
- hSTSPolicyNew :: (HasCallStack, MonadIO m) => Text -> CULong -> Bool -> m HSTSPolicy
- hSTSPolicyNewFromResponse :: (HasCallStack, MonadIO m, IsMessage a) => a -> m (Maybe HSTSPolicy)
- hSTSPolicyNewFull :: (HasCallStack, MonadIO m) => Text -> CULong -> Date -> Bool -> m HSTSPolicy
- hSTSPolicyNewSessionPolicy :: (HasCallStack, MonadIO m) => Text -> Bool -> m HSTSPolicy
- clearHSTSPolicyDomain :: MonadIO m => HSTSPolicy -> m ()
- getHSTSPolicyDomain :: MonadIO m => HSTSPolicy -> m (Maybe Text)
- setHSTSPolicyDomain :: MonadIO m => HSTSPolicy -> CString -> m ()
- clearHSTSPolicyExpires :: MonadIO m => HSTSPolicy -> m ()
- getHSTSPolicyExpires :: MonadIO m => HSTSPolicy -> m (Maybe Date)
- setHSTSPolicyExpires :: MonadIO m => HSTSPolicy -> Ptr Date -> m ()
- getHSTSPolicyIncludeSubdomains :: MonadIO m => HSTSPolicy -> m Bool
- setHSTSPolicyIncludeSubdomains :: MonadIO m => HSTSPolicy -> Bool -> m ()
- getHSTSPolicyMaxAge :: MonadIO m => HSTSPolicy -> m CULong
- setHSTSPolicyMaxAge :: MonadIO m => HSTSPolicy -> CULong -> m ()
Exported types
newtype HSTSPolicy Source #
Memory-managed wrapper type.
Constructors
| HSTSPolicy (ManagedPtr HSTSPolicy) |
Instances
| Eq HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
| GBoxed HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
| ManagedPtrNewtype HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy Methods toManagedPtr :: HSTSPolicy -> ManagedPtr HSTSPolicy | |
| TypedObject HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
| HasParentTypes HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
| tag ~ 'AttrSet => Constructible HSTSPolicy tag Source # | |
Defined in GI.Soup.Structs.HSTSPolicy Methods new :: MonadIO m => (ManagedPtr HSTSPolicy -> HSTSPolicy) -> [AttrOp HSTSPolicy tag] -> m HSTSPolicy | |
| IsGValue (Maybe HSTSPolicy) Source # | Convert |
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 # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
newZeroHSTSPolicy :: MonadIO m => m HSTSPolicy Source #
Construct a HSTSPolicy struct initialized to zero.
Methods
Click to display all available methods, including inherited ones
copy
Arguments
| :: (HasCallStack, MonadIO m) | |
| => HSTSPolicy |
|
| -> m HSTSPolicy | Returns: a copy of |
Copies policy.
Since: 2.68
equal
Arguments
| :: (HasCallStack, MonadIO m) | |
| => HSTSPolicy |
|
| -> HSTSPolicy |
|
| -> m Bool | Returns: whether the policies are equal. |
Tests if policy1 and policy2 are equal.
Since: 2.68
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => HSTSPolicy |
|
| -> m () |
Frees policy.
Since: 2.68
getDomain
Arguments
| :: (HasCallStack, MonadIO m) | |
| => HSTSPolicy |
|
| -> m Text | Returns: |
Gets policy's domain.
Since: 2.68
includesSubdomains
hSTSPolicyIncludesSubdomains Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => HSTSPolicy |
|
| -> m Bool | Returns: |
Gets whether policy include its subdomains.
Since: 2.68
isExpired
Arguments
| :: (HasCallStack, MonadIO m) | |
| => HSTSPolicy |
|
| -> m Bool |
Gets whether policy is expired. Permanent policies never
expire.
Since: 2.68
isSessionPolicy
hSTSPolicyIsSessionPolicy Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => HSTSPolicy |
|
| -> m Bool |
Gets whether policy is a non-permanent, non-expirable session policy.
see hSTSPolicyNewSessionPolicy for details.
Since: 2.68
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> CULong |
|
| -> Bool |
|
| -> m HSTSPolicy | Returns: a new |
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 |
|
| -> m (Maybe HSTSPolicy) | Returns: a new |
Parses msg's first "Strict-Transport-Security" response header and
returns a HSTSPolicy.
Since: 2.68
newFull
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> CULong |
|
| -> Date |
|
| -> Bool |
|
| -> m HSTSPolicy | Returns: a new |
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 |
|
| -> Bool |
|
| -> m HSTSPolicy | Returns: a new |
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
sethSTSPolicy [ #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
sethSTSPolicy [ #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
sethSTSPolicy [ #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
sethSTSPolicy [ #maxAge:=value ]