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

Safe HaskellSafe
LanguageHaskell2010

Servant.API.IsSecure

Synopsis

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 Source #

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

Eq IsSecure Source # 
Ord IsSecure Source # 
Read IsSecure Source # 
Show IsSecure Source # 
Generic IsSecure Source # 

Associated Types

type Rep IsSecure :: * -> * #

Methods

from :: IsSecure -> Rep IsSecure x #

to :: Rep IsSecure x -> IsSecure #

HasLink * sub => HasLink * ((:>) * IsSecure sub) Source # 

Associated Types

type MkLink ((* :> IsSecure) sub) (endpoint :: (* :> IsSecure) sub) a :: * Source #

Methods

toLink :: (Link -> a) -> Proxy ((* :> IsSecure) sub) endpoint -> Link -> MkLink ((* :> IsSecure) sub) endpoint a Source #

type Rep IsSecure Source # 
type Rep IsSecure = D1 * (MetaData "IsSecure" "Servant.API.IsSecure" "servant-0.14-LDkMJtLkTYV34skhWhwIW" False) ((:+:) * (C1 * (MetaCons "Secure" PrefixI False) (U1 *)) (C1 * (MetaCons "NotSecure" PrefixI False) (U1 *)))
type MkLink * ((:>) * IsSecure sub) a Source # 
type MkLink * ((:>) * IsSecure sub) a = MkLink * sub a