nonce

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 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.Instance[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