yesod-csp-0.2.6.0: Add CSP headers to Yesod apps
Safe HaskellSafe-Inferred
LanguageHaskell2010

Yesod.Csp.Example

Description

Assorted examples demonstrating different policies.

Synopsis

Documentation

data Example Source #

Constructors

Example 

Instances

Instances details
YesodDispatch Example Source # 
Instance details

Defined in Yesod.Csp.Example

Yesod Example Source # 
Instance details

Defined in Yesod.Csp.Example

Methods

approot :: Approot Example #

catchHandlerExceptions :: MonadUnliftIO m => Example -> m a -> (SomeException -> m a) -> m a #

errorHandler :: ErrorResponse -> HandlerFor Example TypedContent #

defaultLayout :: WidgetFor Example () -> HandlerFor Example Html #

urlParamRenderOverride :: Example -> Route Example -> [(Text, Text)] -> Maybe Builder #

isAuthorized :: Route Example -> Bool -> HandlerFor Example AuthResult #

isWriteRequest :: Route Example -> HandlerFor Example Bool #

authRoute :: Example -> Maybe (Route Example) #

cleanPath :: Example -> [Text] -> Either [Text] [Text] #

joinPath :: Example -> Text -> [Text] -> [(Text, Text)] -> Builder #

addStaticContent :: Text -> Text -> ByteString -> HandlerFor Example (Maybe (Either Text (Route Example, [(Text, Text)]))) #

maximumContentLength :: Example -> Maybe (Route Example) -> Maybe Word64 #

maximumContentLengthIO :: Example -> Maybe (Route Example) -> IO (Maybe Word64) #

makeLogger :: Example -> IO Logger #

messageLoggerSource :: Example -> Logger -> Loc -> LogSource -> LogLevel -> LogStr -> IO () #

jsLoader :: Example -> ScriptLoadPosition Example #

jsAttributes :: Example -> [(Text, Text)] #

jsAttributesHandler :: HandlerFor Example [(Text, Text)] #

makeSessionBackend :: Example -> IO (Maybe SessionBackend) #

fileUpload :: Example -> RequestBodyLength -> FileUpload #

shouldLogIO :: Example -> LogSource -> LogLevel -> IO Bool #

yesodMiddleware :: ToTypedContent res => HandlerFor Example res -> HandlerFor Example res #

yesodWithInternalState :: Example -> Maybe (Route Example) -> (InternalState -> IO a) -> IO a #

defaultMessageWidget :: Html -> HtmlUrl (Route Example) -> WidgetFor Example () #

ParseRoute Example Source # 
Instance details

Defined in Yesod.Csp.Example

Methods

parseRoute :: ([Text], [(Text, Text)]) -> Maybe (Route Example) #

RenderRoute Example Source # 
Instance details

Defined in Yesod.Csp.Example

Associated Types

data Route Example #

Methods

renderRoute :: Route Example -> ([Text], [(Text, Text)]) #

RouteAttrs Example Source # 
Instance details

Defined in Yesod.Csp.Example

Read (Route Example) Source # 
Instance details

Defined in Yesod.Csp.Example

Show (Route Example) Source # 
Instance details

Defined in Yesod.Csp.Example

Eq (Route Example) Source # 
Instance details

Defined in Yesod.Csp.Example

data Route Example Source # 
Instance details

Defined in Yesod.Csp.Example

getExample1R :: Handler Html Source #

Allows scripts from self.

getExample2R :: Handler Html Source #

Allows all styles over https.

getExample3R :: Handler Html Source #

Allows images from a certain uri.

getExample4R :: Handler Html Source #

Allows all images.

getExample5R :: Handler Html Source #

Disallows images entirely.

getExample6R :: Handler Html Source #

Blocks forms from being submitted

runExamples :: IO () Source #

Run a webserver to serve these examples at 1, 2, etc.