storetest

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package storetest holds store conformance tests shared by every backend, so the memory, SQLite, Postgres and MongoDB stores are held to one behavior.

Index

Constants

Alg is the algorithm name the version tests record for an encrypted row.

Variables

This section is empty.

Functions

func RunSecretExpiry

func RunSecretExpiry(t *testing.T, newStore ExpiryFactory)

RunSecretExpiry runs the expiry-filter conformance tests against the store newStore builds. One store is seeded once and every case reads from it.

func RunTenantIsolation

func RunTenantIsolation(t *testing.T, newStore TenantFactory)

RunTenantIsolation runs the cross-tenant isolation conformance tests against the store newStore builds. The app and two tenants each hold a secret under one key, and no read, write or delete under one of them may reach another's.

func RunVersionEncryption

func RunVersionEncryption(t *testing.T, newStore VersionEncryptionFactory)

RunVersionEncryption runs the version-encryption conformance tests against the store newStore builds.

Types

type ExpiryFactory

type ExpiryFactory func(t *testing.T) secret.Store

ExpiryFactory returns a fresh, empty secret store.

type TenantFactory

type TenantFactory func(t *testing.T) secret.Store

TenantFactory returns a fresh, empty secret store.

type VersionEncryptionFactory

type VersionEncryptionFactory func(t *testing.T) (s secret.Store, legacy func(key, appID string, version int64))

VersionEncryptionFactory returns a fresh, empty store plus a legacy function. legacy rewrites one version row the way a row written before the encryption_alg column looks: its algorithm unset (NULL or absent), not "".

Jump to

Keyboard shortcuts

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