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 ¶
- func RunAll(t *testing.T, factory Factory)
- func TestAddAndGetByKid(t *testing.T, factory Factory)
- func TestAsymmetricKeyRoundTrip(t *testing.T, factory Factory)
- func TestCleanExpired(t *testing.T, factory Factory)
- func TestExpiredKidNotReturned(t *testing.T, factory Factory)
- func TestGetByUnknownKid(t *testing.T, factory Factory)
- func TestGetKeyByClientIDAlwaysNotFound(t *testing.T, factory Factory)
- func TestOverwriteSameKid(t *testing.T, factory Factory)
- func TestPersistence(t *testing.T, factory Factory)
- func TestRemoveIdempotent(t *testing.T, factory Factory)
- func TestZeroExpiryNeverExpires(t *testing.T, factory Factory)
- type Factory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestAddAndGetByKid ¶
func TestCleanExpired ¶
func TestGetByUnknownKid ¶
func TestGetKeyByClientIDAlwaysNotFound ¶
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 TestPersistence ¶
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 ¶
TestRemoveIdempotent enforces that Remove on an absent kid is not an error — KidStorage Remove is intentionally idempotent (differs from KeyStorage.DeleteKey which returns ErrKeyNotFound).