You might be interested in the new auth provider API which allows precisely these sort of things to be handled gracefully without any code duplication. Take a look at the current aaa code in httpd-2.0.So I took the mod_auth_digest code and munged it to use mysql for authentication. Swell. It works great and we're heavily using it.
If you'd be willing to write this as an auth provider, I'm sure we might be interested in integrating it in our tree. -- justin
