valenok/mongoose — pull request #82 by jmucchiello (2013-01-17 02:28:17+00:00)
Title: Authorization via Callback

Adds callbacks to allow the embedded programmer to control authorization
requests without needing to have .htpasswd files.

In check_authorization, the user is called with an MG_REQUIRES_AUTH event. There are 4 possible responses: BYPASS grants access immediately, DENY 403s immediately, INTERNAL returns authorization control to the old mongoose code, and finally there's CALLBACK. When CALLBACK is returned, the user is prompted for the ha1 hash via the MG_GET_AUTH_HASH event when the user sends the Authenticate header.

This patch eliminates synchronizing user accounts between an embedded application's internal database and the .htpasswd files.