Clack.Middleware.Csrf - Middleware for easy CSRF protection.
SYNOPSIS
;; building application.
(builder <clack-middleware-csrf> app)
;; in CL-EMB template.
<form name="test-form" method="post" action="/">
<input type="text" name="name" />
<%= (csrf-html-tag session) %>
<input type="submit" value="Send" />
</form>
DESCRIPTION
Block behavior
(builder
<clack-middleware-session>
(<clack-middleware-csrf>
:block-app #'(lambda (env)
@ignore env
'(302
(:location "http://en.wikipedia.org/wiki/CSRF")
nil)))
app)
AUTHOR
- Eitarow Fukamachi (e.arrows@gmail.com)
SEE ALSO
EXTERNAL SYMBOLS
-
Class: <clack-middleware-csrf> inherits (<middleware>)
Clack Middleware for easy CSRF protection.
- block-app Accessor: block-app
- one-time-p Accessor: one-time-p
-
Method: call
[(this <clack-middleware-csrf>) env]
-
Function: csrf-html-tag
[session]
Return an 'input' tag containing random CSRF token.
Note this has a side-effect, natually. This function stores the generated id into the current session when called.