Add htpasswd-style static file auth module

Can be used via `-auth.url=file://`. Only supports bcrypt password
hashes ($2y). Use e.g. `htpasswd -c -BC 14 <filename> <user>` to create
a file. Documentation forthcoming.
This commit is contained in:
Conrad Hoffmann 2024-02-05 17:23:11 +01:00
parent 536f83fa61
commit a87520cb0f
4 changed files with 101 additions and 1 deletions

View file

@ -18,6 +18,12 @@ func NewFromURL(authURL string) (AuthProvider, error) {
return NewIMAP(u.Host, true), nil
case "pam":
return NewPAM()
case "file":
path := u.Path
if u.Host != "" {
path = u.Host + path
}
return NewHtpasswd(path)
case "null":
return NewNull()
default: