authentication

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Anonymous = "anonymous"
	Basic     = "Basic"
)
View Source
const (
	Accept = "accept"
)
View Source
const Reject = "reject"

Variables

This section is empty.

Functions

func NewAcceptAll

func NewAcceptAll() http.Authenticator

NewAcceptAll authenticator that will treat all incoming requests as authenticated

func NewBasic

func NewBasic(get GetHashAndSalt, authenticationTTL time.Duration) http.Authenticator

NewBasic authenticator for doing basic authentication against a http context. Expects the username and password to be Base64 encoded separated by a ':'. Usernames must not contain a colon however password's can. The information should be included in the 'Authorization' header in the following format: Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l where 'QWxhZGRpbjpPcGVuU2VzYW1l' is the base64 encoded string 'Aladdin:OpenSesame'

func NewBasicHashAndSalt

func NewBasicHashAndSalt(password string) (hash, salt string)

NewBasicHashAndSalt creates a hash and salt for the passed password that will authenticate using the BasicAuthenticator in this package.

func NewRejectAll

func NewRejectAll() http.Authenticator

Types

type GetHashAndSalt

type GetHashAndSalt func(user string) (hash string, salt string, ok bool)

GetHashAndSalt for a specified user identity string. Boolean indicates whether the retrieval was successful

Jump to

Keyboard shortcuts

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