Version: 4.1.2
6.9 Password Protection
(require web-server/dispatchers/dispatch-passwords) |
The web-server/dispatchers/dispatch-passwords module defines a dispatcher constructor that performs HTTP Basic authentication filtering.
| ||||||||||||
| ||||||||||||
password-file : path-string? = "passwords" | ||||||||||||
|
The first returned value is a procedure that refreshes the password file used by the dispatcher.
The dispatcher that is returned does the following: Checks if the request contains Basic authentication credentials, and that they are included in password-file. If they are not, authentication-responder is called with a header that requests credentials. If they are, then next-dispatcher is invoked.
password-file is parsed as:
(list ([domain : string?] |
[path : string-regexp?] |
(list [user : symbol?] |
[pass : string?]) |
...) |
...) |
For example:
'(("secret stuff" "/secret(/.*)?" (bubba "bbq") (Billy "BoB")))