yubikey

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache() cache.Repository

Types

type Options

type Options struct {
	Device    string
	Account   string
	EnableGui bool
}

Options passed in by the caller

type Yubikey

type Yubikey struct {
	GetCode func(ctx context.Context) (string, error)
	// contains filtered or unexported fields
}

func New

func New(options Options) (Yubikey, error)

func (*Yubikey) Code

func (y *Yubikey) Code(ctx context.Context) (string, error)

Code is responsible for querying the TOTP code from Yubikey device.

func (*Yubikey) GetPassword

func (y *Yubikey) GetPassword() (string, error)

Get password from cache, assign it into the instance and finally return it.

func (*Yubikey) RemovePassword

func (y *Yubikey) RemovePassword() error

Remove password from cache and fomr the instance.

func (*Yubikey) SetPassword

func (y *Yubikey) SetPassword(password string) error

Save password to cache and assign it into the instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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