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 |
A security boundary for websites.
SecurityOrigin
is a representation of a security domain
defined by websites. A security origin consists of a protocol, a
hostname, and an optional port number.
Resources with the same security origin can generally access each
other for client-side scripting or database access. When comparing
origins, beware that if both protocol and host are Nothing
, the origins
should not be treated as equal.
Since: 2.16
Synopsis
- newtype SecurityOrigin = SecurityOrigin (ManagedPtr SecurityOrigin)
- securityOriginGetHost :: (HasCallStack, MonadIO m) => SecurityOrigin -> m (Maybe Text)
- securityOriginGetPort :: (HasCallStack, MonadIO m) => SecurityOrigin -> m Word16
- securityOriginGetProtocol :: (HasCallStack, MonadIO m) => SecurityOrigin -> m (Maybe Text)
- securityOriginIsOpaque :: (HasCallStack, MonadIO m) => SecurityOrigin -> m Bool
- securityOriginNew :: (HasCallStack, MonadIO m) => Text -> Text -> Word16 -> m SecurityOrigin
- securityOriginNewForUri :: (HasCallStack, MonadIO m) => Text -> m SecurityOrigin
- securityOriginRef :: (HasCallStack, MonadIO m) => SecurityOrigin -> m SecurityOrigin
- securityOriginToString :: (HasCallStack, MonadIO m) => SecurityOrigin -> m (Maybe Text)
- securityOriginUnref :: (HasCallStack, MonadIO m) => SecurityOrigin -> m ()
Exported types
newtype SecurityOrigin Source #
Memory-managed wrapper type.
SecurityOrigin (ManagedPtr SecurityOrigin) |
Instances
Eq SecurityOrigin Source # | |
Defined in GI.WebKit2.Structs.SecurityOrigin (==) :: SecurityOrigin -> SecurityOrigin -> Bool # (/=) :: SecurityOrigin -> SecurityOrigin -> Bool # | |
GBoxed SecurityOrigin Source # | |
Defined in GI.WebKit2.Structs.SecurityOrigin | |
ManagedPtrNewtype SecurityOrigin Source # | |
Defined in GI.WebKit2.Structs.SecurityOrigin toManagedPtr :: SecurityOrigin -> ManagedPtr SecurityOrigin | |
TypedObject SecurityOrigin Source # | |
Defined in GI.WebKit2.Structs.SecurityOrigin | |
HasParentTypes SecurityOrigin Source # | |
Defined in GI.WebKit2.Structs.SecurityOrigin | |
IsGValue (Maybe SecurityOrigin) Source # | Convert |
Defined in GI.WebKit2.Structs.SecurityOrigin gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe SecurityOrigin -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe SecurityOrigin) | |
type ParentTypes SecurityOrigin Source # | |
Defined in GI.WebKit2.Structs.SecurityOrigin |
Methods
Click to display all available methods, including inherited ones
getHost
securityOriginGetHost Source #
:: (HasCallStack, MonadIO m) | |
=> SecurityOrigin |
|
-> m (Maybe Text) | Returns: The host of the |
Gets the hostname of origin
.
It is reasonable for this to be Nothing
if its protocol does not require a host component.
Since: 2.16
getPort
securityOriginGetPort Source #
:: (HasCallStack, MonadIO m) | |
=> SecurityOrigin |
|
-> m Word16 | Returns: The port of the |
Gets the port of origin
.
This function will always return 0 if the
port is the default port for the given protocol. For example,
http://example.com has the same security origin as
http://example.com:80, and this function will return 0 for a
SecurityOrigin
constructed from either URI.
Since: 2.16
getProtocol
securityOriginGetProtocol Source #
:: (HasCallStack, MonadIO m) | |
=> SecurityOrigin |
|
-> m (Maybe Text) | Returns: The protocol of the |
Gets the protocol of origin
.
Since: 2.16
isOpaque
securityOriginIsOpaque Source #
:: (HasCallStack, MonadIO m) | |
=> SecurityOrigin |
|
-> m Bool | Returns: |
Deprecated: (Since version 2.32)
This function returns False
.
This function returns False
. SecurityOrigin
is now a simple
wrapper around a <protocol, host, port> triplet, and no longer
represents an origin as defined by web standards that may be opaque.
Since: 2.16
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Word16 |
|
-> m SecurityOrigin | Returns: A |
Create a new security origin from the provided protocol, host and port.
Since: 2.16
newForUri
securityOriginNewForUri Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m SecurityOrigin | Returns: A |
Create a new security origin from the provided.
Create a new security origin from the provided URI. Components of
uri
other than protocol, host, and port do not affect the created
SecurityOrigin
.
Since: 2.16
ref
:: (HasCallStack, MonadIO m) | |
=> SecurityOrigin |
|
-> m SecurityOrigin | Returns: The passed |
Atomically increments the reference count of origin
by one.
This function is MT-safe and may be called from any thread.
Since: 2.16
toString
securityOriginToString Source #
:: (HasCallStack, MonadIO m) | |
=> SecurityOrigin |
|
-> m (Maybe Text) | Returns: a URI representing |
Gets a string representation of origin
.
The string representation
is a valid URI with only protocol, host, and port components, or
Nothing
.
Since: 2.16
unref
:: (HasCallStack, MonadIO m) | |
=> SecurityOrigin |
|
-> m () |
Atomically decrements the reference count of origin
by one.
If the reference count drops to 0, all memory allocated by
SecurityOrigin
is released. This function is MT-safe and may be
called from any thread.
Since: 2.16