golazy.dev
–
golazy.dev
/
lazyauth
/
fileauth
Index
|
Files
package fileauth ¶
import "golazy.dev/lazyauth/fileauth"
Functions ¶
func HashPassword ¶
func HashPassword(password string) (string, error)
func VerifyPassword ¶
VerifyPassword checks password against an encoded PBKDF2 hash.
func VerifyPassword(encoded string, password string) bool
Types ¶
type Provider ¶
Provider authenticates users from a JSON Lines file.
type Provider struct {
// contains filtered or unexported fields
}
func MustOpen ¶
MustOpen loads users from path or panics.
func MustOpen(path string) *Provider
func Open ¶
Open loads users from path.
func Open(path string) (*Provider, error)
func (p *Provider) Authenticate ¶
Authenticate implements lazyauth.Authenticator.
func (p *Provider) Authenticate(_ context.Context, credential lazyauth.Credential) (lazyauth.User, error)
HashPassword hashes password with PBKDF2-HMAC-SHA256.