nonces

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Tag feature.Tag = "srv-factory-nonces"

Variables

View Source
var (
	DefaultNumRandomBytes int           = 32
	DefaultDuration       time.Duration = time.Hour
)

Functions

This section is empty.

Types

type CFeature

type CFeature struct {
	feature.CFeature
	uses_kvc.CUsesKVC[MakeFeature]
	// contains filtered or unexported fields
}

func (*CFeature) Build

func (f *CFeature) Build(b feature.Buildable) (err error)

func (*CFeature) CreateNonce

func (f *CFeature) CreateNonce(key string) (value string)

CreateNonce will add a new nonce instance to the given key

func (*CFeature) Init

func (f *CFeature) Init(this interface{})

func (*CFeature) Make

func (f *CFeature) Make() (feat Feature)

func (*CFeature) SetDuration

func (f *CFeature) SetDuration(duration time.Duration) MakeFeature

func (*CFeature) SetNumRandomBytes

func (f *CFeature) SetNumRandomBytes(size int) MakeFeature

func (*CFeature) Startup

func (f *CFeature) Startup(ctx *cli.Context) (err error)

func (*CFeature) VerifyNonce

func (f *CFeature) VerifyNonce(key, value string) (valid bool)

VerifyNonce will return true if the nonce is valid and consume the nonce in the process

type Feature

type Feature interface {
	feature.Feature
	feature.NonceFactoryFeature
}

type MakeFeature

type MakeFeature interface {
	uses_kvc.MakeFeature[MakeFeature]

	SetDuration(duration time.Duration) MakeFeature
	SetNumRandomBytes(size int) MakeFeature

	Make() Feature
}

func New

func New() MakeFeature

func NewTagged

func NewTagged(tag feature.Tag) MakeFeature

Jump to

Keyboard shortcuts

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