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 |
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
- newtype HSTSPolicy = HSTSPolicy (ManagedPtr 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
- hSTSPolicyGetExpires :: (HasCallStack, MonadIO m) => HSTSPolicy -> m DateTime
- hSTSPolicyGetMaxAge :: (HasCallStack, MonadIO m) => HSTSPolicy -> m CULong
- 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 -> DateTime -> Bool -> m HSTSPolicy
- hSTSPolicyNewSessionPolicy :: (HasCallStack, MonadIO m) => Text -> Bool -> m HSTSPolicy
Exported types
newtype HSTSPolicy Source #
Memory-managed wrapper type.
HSTSPolicy (ManagedPtr HSTSPolicy) |
Instances
Eq HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy (==) :: HSTSPolicy -> HSTSPolicy -> Bool # (/=) :: HSTSPolicy -> HSTSPolicy -> Bool # | |
GBoxed HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
ManagedPtrNewtype HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy toManagedPtr :: HSTSPolicy -> ManagedPtr HSTSPolicy | |
TypedObject HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
HasParentTypes HSTSPolicy Source # | |
Defined in GI.Soup.Structs.HSTSPolicy | |
IsGValue (Maybe HSTSPolicy) Source # | Convert |
Defined in GI.Soup.Structs.HSTSPolicy 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 |
Methods
Click to display all available methods, including inherited ones
Methods
copy, equal, free, includesSubdomains, isExpired, isSessionPolicy.
Getters
getDomain, getExpires, getMaxAge.
Setters
None.
copy
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m HSTSPolicy | Returns: a copy of |
Copies policy
.
equal
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> HSTSPolicy |
|
-> m Bool | Returns: whether the policies are equal. |
Tests if policy1
and policy2
are equal.
free
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m () |
Frees policy
.
getDomain
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m Text | Returns: |
Gets policy
's domain.
getExpires
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m DateTime |
Returns the expiration date for policy
.
getMaxAge
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m CULong | Returns: Max age in seconds |
Returns the max age for policy
.
includesSubdomains
hSTSPolicyIncludesSubdomains Source #
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m Bool | Returns: |
Gets whether policy
include its subdomains.
isExpired
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m Bool |
Gets whether policy
is expired.
Permanent policies never expire.
isSessionPolicy
hSTSPolicyIsSessionPolicy Source #
:: (HasCallStack, MonadIO m) | |
=> HSTSPolicy |
|
-> m Bool |
Gets whether policy
is a non-permanent, non-expirable session policy.
See [ctorhSTSPolicy
.new_session_policy] for details.
new
:: (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
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 #
:: (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
.
newFull
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> CULong |
|
-> DateTime |
|
-> Bool |
|
-> m HSTSPolicy | Returns: a new |
Full version of [ctorhSTSPolicy
.new], to use with an existing
expiration date.
See [ctorhSTSPolicy
.new] for details.
newSessionPolicy
hSTSPolicyNewSessionPolicy Source #
:: (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 [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
.