basicauth

package
v0.0.0-...-fe3b528 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package basicauth implements HTTP basic authentication scheme.

See https://tools.ietf.org/html/rfc7617

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StaticHandler

type StaticHandler struct {
	// Handler is the handler protected by HTTP basic authentication.
	Handler http.Handler
	// UserHash is username hash to compare against.
	UserHash []byte
	// PassHash is password hash to compare against.
	PassHash []byte
}

func Static

func Static(handler http.Handler, user, pass string) *StaticHandler

Static returns a handler that serves requests from underlying handler after successful HTTP basic authentication with static credentials.

func (*StaticHandler) ServeHTTP

func (h *StaticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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