Copyright | (c) Eduardo Trujillo, 2016 |
---|---|
License | Apache |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Types used by the Kawaii package.
- data MiddlewareStack = MiddlewareStack [Middleware]
- data ServeConfiguration = ServeConfiguration {
- _scMiddleware :: MiddlewareStack
- _scDevTransform :: ServeConfiguration -> ServeConfiguration
- _scStagingTransform :: ServeConfiguration -> ServeConfiguration
- _scProdTransform :: ServeConfiguration -> ServeConfiguration
- _scTlsConfiguration :: Maybe TLSConfiguration
- _scPort :: Int
- _scStage :: Stage
- _scPath :: Maybe FilePath
- data TLSConfiguration = TLSConfiguration {}
- type SourceList = [Text]
- type TypeList = [Text]
- data Directive
- = BaseURI SourceList
- | ChildSrc SourceList
- | ConnectSrc SourceList
- | DefaultSrc SourceList
- | FontSrc SourceList
- | FormAction SourceList
- | FrameAncestors SourceList
- | FrameSrc SourceList
- | ImgSrc SourceList
- | ManifestSrc SourceList
- | MediaSrc SourceList
- | ObjectSrc SourceList
- | PluginTypes TypeList
- | Referrer Text
- | ReflectedXSS Text
- | ReportURI Text
- | Sandbox Text
- | ScriptSrc SourceList
- | StyleSrc SourceList
- | UpgradeInsecureRequests
- type Domain = ByteString
- data Stage
- scMiddleware :: Lens' ServeConfiguration MiddlewareStack
- scDevTransform :: Lens' ServeConfiguration (ServeConfiguration -> ServeConfiguration)
- scStagingTransform :: Lens' ServeConfiguration (ServeConfiguration -> ServeConfiguration)
- scProdTransform :: Lens' ServeConfiguration (ServeConfiguration -> ServeConfiguration)
- scTlsConfiguration :: Lens' ServeConfiguration (Maybe TLSConfiguration)
- scPort :: Lens' ServeConfiguration Int
- scStage :: Lens' ServeConfiguration Stage
- scPath :: Lens' ServeConfiguration (Maybe FilePath)
- tlsMiddleware :: Lens' TLSConfiguration (MiddlewareStack -> MiddlewareStack)
- tlsSettings :: Lens' TLSConfiguration TLSSettings
- tlsPort :: Lens' TLSConfiguration Int
Middleware Stack
data MiddlewareStack Source #
A middleware stack is a simple container of Wai middleware. The top of the stack is considered to be the outermost layer of middleware while the bottom of the stack is the innermost layer of middleware.
The stack is a Monoid
, so it can be combined with other stacks using
<>
, and an empty one can be obtained using mempty
.
MiddlewareStack [Middleware] | The constructor takes a list of middleware, where the left-most item in the list will end up at the top of the stack, and the right-most at the bottom. |
Server configuration
data ServeConfiguration Source #
The configuration for the server process.
The different transforms can be used to specify how the configuration changes depending on the stage. While starting up, the server process will take the base configuration, check the stage and pass the configuration through the appropriate transformer.
ServeConfiguration | |
|
data TLSConfiguration Source #
The configuration for the TLS/HTTPS server.
TLSConfiguration | |
|
CSP
type SourceList = [Text] Source #
Miscellaneous types
type Domain = ByteString Source #
The development stage an application is executing in.
This is used to alter the behavior of the server depending on the stage of development. For example, a local development server might only have an HTTP listener and a smaller middleware stack, while a production server also listens for TLS connections and has additional middlewares that only make sense on a public server.