kidstoretest

package
v0.0.83 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package kidstoretest provides shared test suites for all KidStorage implementations. Each backend (in-memory KidStore, FS, GORM, GAE) calls these tests with its own factory function, mirroring keystoretest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAll

func RunAll(t *testing.T, factory Factory)

RunAll runs the complete KidStorage test suite against the provided factory.

func TestAddAndGetByKid

func TestAddAndGetByKid(t *testing.T, factory Factory)

func TestAsymmetricKeyRoundTrip

func TestAsymmetricKeyRoundTrip(t *testing.T, factory Factory)

func TestCleanExpired

func TestCleanExpired(t *testing.T, factory Factory)

func TestExpiredKidNotReturned

func TestExpiredKidNotReturned(t *testing.T, factory Factory)

func TestGetByUnknownKid

func TestGetByUnknownKid(t *testing.T, factory Factory)

func TestGetKeyByClientIDAlwaysNotFound

func TestGetKeyByClientIDAlwaysNotFound(t *testing.T, factory Factory)

TestGetKeyByClientIDAlwaysNotFound enforces the documented KidStorage semantic: lookup by clientID is meaningless for a kid-indexed store and must always return ErrKeyNotFound, regardless of whether the client has any kids registered.

func TestOverwriteSameKid

func TestOverwriteSameKid(t *testing.T, factory Factory)

func TestPersistence

func TestPersistence(t *testing.T, factory Factory)

TestPersistence verifies the store reads back what it wrote. For persistent backends (FS, GORM, GAE) this exercises the actual storage layer; for in-memory it is trivially true. Cross-instance restart proof is handled in backend-specific tests where reopening makes sense.

func TestRemoveIdempotent

func TestRemoveIdempotent(t *testing.T, factory Factory)

TestRemoveIdempotent enforces that Remove on an absent kid is not an error — KidStorage Remove is intentionally idempotent (differs from KeyStorage.DeleteKey which returns ErrKeyNotFound).

func TestZeroExpiryNeverExpires

func TestZeroExpiryNeverExpires(t *testing.T, factory Factory)

Types

type Factory

type Factory func(t *testing.T) keys.KidStorage

Factory creates a fresh KidStorage for each test.

Jump to

Keyboard shortcuts

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