yubico

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ID      int
	Active  bool
	Created int
	Secret  string
	Email   string
	Notes   string
	OTP     string
}

Client is a structure containing all the information representing a remote client

func (*Client) Key

func (c *Client) Key() []byte

Key gets a base64 representation of the client secret

type ClientLoader

type ClientLoader interface {
	LoadClient(id uint64) (*Client, error)
}

ClientLoader is an interface abstracting a loading of a client. It will most likely been loaded from a database, but we want to abstract that away.

type ClientLoaderFunc

type ClientLoaderFunc func(uint64) (*Client, error)

ClientLoaderFunc is a wrapper for a function to implement the ClientLoader interface

func (ClientLoaderFunc) LoadClient

func (clf ClientLoaderFunc) LoadClient(id uint64) (*Client, error)

LoadClient wraps a function to implement ClientLoader interface

type Token

type Token struct {
	*yubikey.Token
	Public string
}

Token is a structure wrapping a token associated with a readable public part

func (*Token) String

func (t *Token) String() string

String is a string dump of the token (not complete).

type User

type User struct {
	Name string
	Hash string
}

User is a structure representing a user of yubistack validating a token

type UserLoader

type UserLoader interface {
	LoadUser(name, public string) (*User, error)
}

UserLoader is an interface abstracting a loading of a user from store. It will most likely been loaded from a database, but we want to abstract that away.

type UserLoaderFunc

type UserLoaderFunc func(name, public string) (*User, error)

UserLoaderFunc is a wrapper for a function to implement the UserLoader interface

func (UserLoaderFunc) LoadUser

func (ulf UserLoaderFunc) LoadUser(name, public string) (*User, error)

LoadUser wraps a function to implement UserLoader interface

type Yubikey

type Yubikey struct {
	Active     bool
	Created    int64
	Modified   int64
	PublicName string
	Counter    uint // Number of time the key is plugged
	Use        uint // Number of time the key is tapped
	Low        uint
	High       uint
	Nonce      string
	Notes      string
}

Yubikey is a structure representing a Yubikey state

func (*Yubikey) Clone

func (y *Yubikey) Clone() *Yubikey

Clone will creates a new pointer with all fields the same as the original

func (*Yubikey) String

func (y *Yubikey) String() string

String is a string dump of the Yubikey state (not complete).

func (*Yubikey) Update

func (y *Yubikey) Update(token *Token, nonce string, now int64) *Yubikey

Update is setting internal state of Yubikey to new values passed as parameters

type YubikeyDBMapper

type YubikeyDBMapper interface {
	YubikeyLoader
	YubikeyUpdater
	YubikeyProducer
}

YubikeyDBMapper is an interface aggregator for Yubikey database interactions.

type YubikeyLoader

type YubikeyLoader interface {
	YubikeyLoad(name string) (*Yubikey, error)
}

YubikeyLoader is an interface abstracting a loading of a Yubikey state. It will most likely been loaded from a database, but we want to abstract that away.

type YubikeyLoaderFunc

type YubikeyLoaderFunc func(name string) (*Yubikey, error)

YubikeyLoaderFunc is a wrapper for a function to implement the YubikeyLoader interface

func (YubikeyLoaderFunc) YubikeyLoad

func (ylf YubikeyLoaderFunc) YubikeyLoad(name string) (*Yubikey, error)

YubikeyLoad wraps a function to implement YubikeyLoader interface

type YubikeyProducer

type YubikeyProducer interface {
	YubikeyProduce(token *Token, nonce string) (*Yubikey, error)
}

YubikeyProducer is an interface abstracting the creation of a Yubikey. It will most likely been saved to a database, but we want to abstract that away.

type YubikeyProducerFunc

type YubikeyProducerFunc func(token *Token, nonce string) (*Yubikey, error)

YubikeyProducerFunc is a wrapper for a function to implement the YubikeyProducer interface

func (YubikeyProducerFunc) YubikeyProduce

func (ypf YubikeyProducerFunc) YubikeyProduce(token *Token, nonce string) (*Yubikey, error)

YubikeyProduce wraps a function to implement ClientLoader interface

type YubikeyUpdater

type YubikeyUpdater interface {
	YubikeyUpdate(*Yubikey) error
}

YubikeyUpdater is an interface abstracting the update of a Yubikey state. It will most likely been saved to a database, but we want to abstract that away.

type YubikeyUpdaterFunc

type YubikeyUpdaterFunc func(*Yubikey) error

YubikeyUpdaterFunc is a wrapper for a function to implement the YubikeyUpdater interface

func (YubikeyUpdaterFunc) YubikeyUpdate

func (yuf YubikeyUpdaterFunc) YubikeyUpdate(key *Yubikey) error

YubikeyUpdate wraps a function to implement YubikeyUpdater interface

Jump to

Keyboard shortcuts

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