htpasswd

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateAPIKeyHeader added in v0.11.0

func AuthenticateAPIKeyHeader(ht HTPasswd, headerValue string) bool

func NewAPIKeyMiddleware added in v0.11.0

func NewAPIKeyMiddleware(ht HTPasswd) func(http.Handler) http.Handler

func NewAPIKeyMiddlewareWithUnauthorized added in v0.11.0

func NewAPIKeyMiddlewareWithUnauthorized(ht HTPasswd, onUnauthorized func(http.ResponseWriter, *http.Request)) func(http.Handler) http.Handler

func NewBasicAuthMiddleware

func NewBasicAuthMiddleware(ht HTPasswd) func(http.Handler) http.Handler

Types

type HTPasswd

type HTPasswd interface {
	Authenticate(user, password string) (ok, present bool)
}

func NewFromFile

func NewFromFile(filename string) (HTPasswd, error)

type HTPasswdFile

type HTPasswdFile map[string]string

func (HTPasswdFile) Authenticate

func (s HTPasswdFile) Authenticate(user, password string) (ok bool, present bool)

Jump to

Keyboard shortcuts

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