htpasswd

package
v1.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashAlgorithm

type HashAlgorithm int
const (
	BCrypt HashAlgorithm = iota
	MD5
	SHA
)

func (HashAlgorithm) String

func (a HashAlgorithm) String() string

type Htpasswd

type Htpasswd struct {
	// contains filtered or unexported fields
}

func New

func New() *Htpasswd

func Read

func Read(r io.Reader) (*Htpasswd, error)

func (*Htpasswd) Delete

func (this *Htpasswd) Delete(name string)

Delete a password by user

func (*Htpasswd) Set

func (this *Htpasswd) Set(name, passwd string, hash HashAlgorithm) error

Set a password for a user with a named hashing algorithm

func (*Htpasswd) String

func (this *Htpasswd) String() string

func (*Htpasswd) Users

func (this *Htpasswd) Users() []string

Return with usernames

func (*Htpasswd) Verify

func (this *Htpasswd) Verify(name, passwd string) bool

Validate a password for a user

func (*Htpasswd) Write

func (this *Htpasswd) Write(w io.Writer) error

Write out passwords

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL