servant-0.20.2: A family of combinators for defining webservices APIs

Safe Haskell | None
Language | Haskell2010

Servant.API.IsSecure

Synopsis

- data IsSecure
  - = Secure
  - | NotSecure

# Documentation

| Use `IsSecure` whenever your request handlers need to know whether the connection to the server is secure or not. This would make the request handlers receive an argument of type `IsSecure`, whose value can be one of `Secure` (HTTPS) or `NotSecure` (HTTP).

Example:

    >>> type API = "sensitive-data" :> IsSecure :> Get '[JSON] NationSecrets

data IsSecure #

Was this request made over an SSL connection?

Note that this value will not tell you if the client originally made this request over SSL, but rather whether the current connection is SSL. The distinction lies with reverse proxies. In many cases, the client will connect to a load balancer over SSL, but connect to the WAI handler without SSL. In such a case, the handlers would get `NotSecure`, but from a user perspective, there is a secure connection.

Constructors

Secure | the connection to the server is secure (HTTPS)
NotSecure | the connection to the server is not secure (HTTP)

#### Instances

Instances details

Generic IsSecure # |

Instance details

Defined in Servant.API.IsSecure

Associated Types

type Rep IsSecure |
Instance details Defined in Servant.API.IsSecure type Rep IsSecure = D1 ('MetaData "IsSecure" "Servant.API.IsSecure" "servant-0.20.2-9fHyWNA72dIEEHjgDnkpGL" 'False) (C1 ('MetaCons "Secure" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NotSecure" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: IsSecure -> Rep IsSecure x #

to :: Rep IsSecure x -> IsSecure #

Read IsSecure # |
Instance details Defined in Servant.API.IsSecure Methods readsPrec :: Int -> ReadS IsSecure # readList :: ReadS [IsSecure] # readPrec :: ReadPrec IsSecure # readListPrec :: ReadPrec [IsSecure] #
Show IsSecure # |
Instance details Defined in Servant.API.IsSecure Methods showsPrec :: Int -> IsSecure -> ShowS # show :: IsSecure -> String # showList :: [IsSecure] -> ShowS #
Eq IsSecure # |
Instance details Defined in Servant.API.IsSecure Methods (==) :: IsSecure -> IsSecure -> Bool # (/=) :: IsSecure -> IsSecure -> Bool #
Ord IsSecure # |
Instance details Defined in Servant.API.IsSecure Methods compare :: IsSecure -> IsSecure -> Ordering # (<) :: IsSecure -> IsSecure -> Bool # (<=) :: IsSecure -> IsSecure -> Bool # (>) :: IsSecure -> IsSecure -> Bool # (>=) :: IsSecure -> IsSecure -> Bool # max :: IsSecure -> IsSecure -> IsSecure # min :: IsSecure -> IsSecure -> IsSecure #
HasLink sub => HasLink (IsSecure :> sub :: Type) # |
Instance details Defined in Servant.Links Methods toLink :: (Link -> a) -> Proxy (IsSecure :> sub) -> Link -> MkLink (IsSecure :> sub) a #
type Rep IsSecure # |
Instance details Defined in Servant.API.IsSecure type Rep IsSecure = D1 ('MetaData "IsSecure" "Servant.API.IsSecure" "servant-0.20.2-9fHyWNA72dIEEHjgDnkpGL" 'False) (C1 ('MetaCons "Secure" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NotSecure" 'PrefixI 'False) (U1 :: Type -> Type))
type MkLink (IsSecure :> sub :: Type) a # |
Instance details Defined in Servant.Links type MkLink (IsSecure :> sub :: Type) a = MkLink sub a