nonce

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheNonceStore

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

CacheNonceStore is a nonce store that stores nonces in cache.

func NewCacheNonceStore

func NewCacheNonceStore(c cache.CacheInstance[bool]) *CacheNonceStore

NewCacheNonceStore creates a new nonce store that stores nonces in cache.

func (*CacheNonceStore) Create

func (s *CacheNonceStore) Create(ctx context.Context) (string, error)

func (*CacheNonceStore) Verify

func (s *CacheNonceStore) Verify(ctx context.Context, nonce string) (bool, error)

type Store

type Store interface {
	// Create a new nonce.
	Create(ctx context.Context) (string, error)

	// Verify checks if a nonce is valid.
	Verify(ctx context.Context, nonce string) (bool, error)
}

Store represents a nonce store methods.

Jump to

Keyboard shortcuts

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