Varnish module implementing cookie-based access control.
This module is EXPERIMENTAL - do not use in production! It is only for education purpose.
-
install required packages for building the module (instructions for Fedora 22)
$ sudo dnf install automake libtool make varnish varnish-libs-devel python-docutils
-
clone repo
$ git clone git@github.com:lemonde/libvmod-access.git $ cd libvmod-access/
-
switch to master branch (for Varnish 4.0, branch 3.0 is for Varnish 3.0) :
$ git checkout master
-
build module
$ ./autogen.sh $ ./configure $ make
-
run unit tests
$ make check
-
have fun!
Prototype
access.check(STRING SERVICE, STRING COOKIE_NAME, STRING SALT)
Return value
BOOL
Description
Returns true if a request with a valid cookie is sent, false otherwise.
Example
if (req.url ~ "^/protected/")
{
if (access.check("protected_content", "__access", "salt used for checksum"))
{
// access granted
}
else
{
// access denied
}
}
MIT