mirror of
https://git.sr.ht/~sircmpwn/tokidoki
synced 2025-12-12 14:17:21 +01:00
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:
parent
536f83fa61
commit
a87520cb0f
4 changed files with 101 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue