token

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: GPL-3.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenAuth

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

TokenAuth is a singleton instance of the authenticator.

func (TokenAuth) AddRecord

func (TokenAuth) AddRecord(uid types.Uid, secret []byte, lifetime time.Duration) (int, auth.AuthErr)

AddRecord is not supprted, will produce an error.

func (*TokenAuth) Authenticate

func (ta *TokenAuth) Authenticate(token []byte) (types.Uid, int, time.Time, auth.AuthErr)

Authenticate checks validity of provided token.

func (*TokenAuth) GenSecret

func (ta *TokenAuth) GenSecret(uid types.Uid, authLvl int, lifetime time.Duration) ([]byte, time.Time, auth.AuthErr)

GenSecret generates a new token.

func (*TokenAuth) Init

func (ta *TokenAuth) Init(jsonconf string) error

Init initializes the authenticator: parses the config and sets salt, serial number and lifetime.

func (TokenAuth) IsUnique

func (TokenAuth) IsUnique(token []byte) (bool, auth.AuthErr)

IsUnique is not supported, will produce an error.

func (TokenAuth) UpdateRecord

func (TokenAuth) UpdateRecord(uid types.Uid, secret []byte, lifetime time.Duration) auth.AuthErr

UpdateRecord is not supported, will produce an error.

Jump to

Keyboard shortcuts

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