auth

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator added in v1.4.0

type Authenticator interface {
	Validate(r *http.Request) (ok bool, username string)
}

Authenticator is a generic interface to validate HTTP request credentials. It's returns the authentication result along with the principal (username) if it has one.

type HtpasswdFile added in v1.4.0

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

HtpasswdFile is a map for usernames to passwords.

func NewHtpasswdFromFile added in v1.4.0

func NewHtpasswdFromFile(path string) (*HtpasswdFile, error)

NewHtpasswdFromFile reads the users and passwords from a htpasswd file and returns them.

func (*HtpasswdFile) Validate added in v1.4.0

func (h *HtpasswdFile) Validate(r *http.Request) (ok bool, username string)

Validate HTTP request credentials

Jump to

Keyboard shortcuts

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