auth

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware

func NewMiddleware(authn Authenticator, whitelist ...string) goa.Middleware

NewMiddleware creates a static auth middleware.

Types

type Authenticator

type Authenticator interface {
	Validate(r *http.Request) bool
}

Authenticator is a generic interface to validate an HTTP request

type HtpasswdFile

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

HtpasswdFile is a map for usernames to passwords.

func NewHtpasswdFromFile

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

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

func (*HtpasswdFile) Validate

func (h *HtpasswdFile) Validate(r *http.Request) bool

Validate HTTP request credentials

Jump to

Keyboard shortcuts

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