yesod-csp-0.2.2.0: Add CSP headers to Yesod apps

Safe HaskellNone
LanguageHaskell2010

Yesod.Csp.Example

Description

Assorted examples demonstrating different policies.

Synopsis

Documentation

data Example Source #

Constructors

Example 

Instances

RouteAttrs Example Source # 
ParseRoute Example Source # 

Methods

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

RenderRoute Example Source # 

Associated Types

data Route Example :: * #

Methods

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

Yesod Example Source # 

Methods

approot :: Approot Example #

errorHandler :: ErrorResponse -> HandlerT Example IO TypedContent #

defaultLayout :: WidgetT Example IO () -> HandlerT Example IO Html #

urlRenderOverride :: Example -> Route Example -> Maybe Builder #

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

isAuthorized :: Route Example -> Bool -> HandlerT Example IO AuthResult #

isWriteRequest :: Route Example -> HandlerT Example IO Bool #

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

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

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

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

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

makeLogger :: Example -> IO Logger #

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

jsLoader :: Example -> ScriptLoadPosition Example #

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

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

fileUpload :: Example -> RequestBodyLength -> FileUpload #

shouldLog :: Example -> LogSource -> LogLevel -> Bool #

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

yesodMiddleware :: ToTypedContent res => HandlerT Example IO res -> HandlerT Example IO res #

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

defaultMessageWidget :: Html -> HtmlUrl (Route Example) -> WidgetT Example IO () #

YesodDispatch Example Source # 
Eq (Route Example) Source # 
Read (Route Example) Source # 
Show (Route Example) Source # 
data Route Example Source # 

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.