Skip to content

NarrationBox/htpasswd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis CI

This is a simple utility library to manipulate htpasswd files

If you want to authenticate against a htpasswd file use something like https://github.com/abbot/go-http-auth .

Supported hashing algorithms:

  • sha-512 (requires mkpasswd to be installed)
  • bcrypt

This is what you can

Set user credentials in a htpasswd file:

file := "/tmp/demo.htpasswd"
name := "joe"
password := "secret"
err := htpasswd.SetPassword(file, name, password, htpasswd.HashBCrypt)

Remove a user:

err := htpasswd.RemoveUser(file, name)

Read user hash table:

passwords, err := htpasswd.ParseHtpasswdFile(file)

Have fun.

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%