drivers

package
v0.0.0-...-72724d7 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDB is simple error to propagate up the call stack
	ErrDB = errors.New("database error")
)

Functions

This section is empty.

Types

type YKAuth

type YKAuth struct {
	zerolog.Logger
	*sql.DB
}

YKAuth is a wrapper around a database client and a logger It handles the communication with the YKAuth database

func NewYKAuth

func NewYKAuth(db *sql.DB, options ...func(*YKAuth)) *YKAuth

NewYKAuth creates a new YKAuth structure with sensible defaults.

func (*YKAuth) LoadUser

func (y *YKAuth) LoadUser(name, public string) (*yubico.User, error)

LoadUser is responsible from loading a user by its name from the underlying database.

type YKKSM

type YKKSM struct {
	zerolog.Logger
	*sql.DB
}

YKKSM is a wrapper around a database client and a logger It handles the communication with the YKKSM database

func NewYKKSM

func NewYKKSM(db *sql.DB, options ...func(*YKKSM)) *YKKSM

NewYKKSM creates a new YKKSM structure with sensible defaults

func (*YKKSM) Retrieve

func (y *YKKSM) Retrieve(pubid []byte) (key []byte, name string, err error)

Retrieve implements the Retriever interface. It retrieves the key and name by its pubid and returns it.

type YKVal

type YKVal struct {
	zerolog.Logger
	*sql.DB
}

YKVal is a wrapper around a database client and a logger It handles the communication with the YKVal database

func NewYKVal

func NewYKVal(db *sql.DB, options ...func(*YKVal)) *YKVal

NewYKVal creates a new YKVal structure with sensible defaults

func (*YKVal) LoadClient

func (y *YKVal) LoadClient(id uint64) (*yubico.Client, error)

LoadClient implements the ClientLoader interface. It retrieves a client by its id from the database and returns it.

func (*YKVal) YubikeyLoad

func (y *YKVal) YubikeyLoad(name string) (*yubico.Yubikey, error)

YubikeyLoad implements the YubikeyLoader interface. It retrieves yubikey from the underlying database and returns it.

func (*YKVal) YubikeyProduce

func (y *YKVal) YubikeyProduce(token *yubico.Token, _ string) (*yubico.Yubikey, error)

YubikeyProduce implements the YubikeyProducer interface. It creates a new yubikey, save it and then return it to the caller

func (*YKVal) YubikeyUpdate

func (y *YKVal) YubikeyUpdate(yubikey *yubico.Yubikey) error

YubikeyUpdate implements the YubikeyUpdater interface. It pushes the new state to the underlying database.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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