auth

package
v0.0.0-...-48e7947 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationContext

type AuthenticationContext interface {
	AuthenticateUser(login, password string) (string, error)
	ExcludeOperation(method, uri string)
	LoadUser(login, salt, hash string) error
}

AuthenticationContext holds the context of all authentication operations

func NewAuthenticationMiddleware

func NewAuthenticationMiddleware() (mux.MiddlewareFunc, AuthenticationContext)

NewAuthenticationMiddleware creates a new authentication context and provides a middleware func to build middleware instances

type PasswordInformation

type PasswordInformation struct {
	Salt string
	Hash string
}

PasswordInformation consists of salt and hash

func HashPassword

func HashPassword(password string) PasswordInformation

HashPassword generates random salt and calculates password hash

Jump to

Keyboard shortcuts

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