authenticator

package
v0.0.0-...-589e68f Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

Authenticator is used to keep track of users and their connections

func NewAuthenticator

func NewAuthenticator() *Authenticator

NewAuthenticator constructs a new Authenticator

func (*Authenticator) CanAuthenticate

func (a *Authenticator) CanAuthenticate(user core.User, hash, totp string) bool

CanAuthenticate returns a boolean based on whether the provided user has the credentials to authenticate

func (*Authenticator) Connect

func (a *Authenticator) Connect(user core.User) error

Connect adds a session to the collection of active sessions

func (*Authenticator) Disconnect

func (a *Authenticator) Disconnect(sessionToken string) error

Disconnect removes a session from the records for that user

func (*Authenticator) IsConnected

func (a *Authenticator) IsConnected(user core.User) bool

IsConnected returns true if the specified user is logged in

Jump to

Keyboard shortcuts

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