Documentation
¶
Overview ¶
Package contracttest contains reusable contract checks for secrets.Store implementations. It intentionally inspects only the public secrets API.
Index ¶
- func AssertListMetadata(t *testing.T, lister secrets.Lister, namespace secrets.Namespace)
- func ErrorText(err error) string
- func RunList(t *testing.T, lister secrets.Lister, config StoreContractOptions)
- func RunStore(t *testing.T, factory StoreFactory, options ...StoreContractOptions)
- type ContractOptions
- type StoreContractConfig
- type StoreContractOptions
- type StoreFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertListMetadata ¶
AssertListMetadata confirms that a lister does not expose a value field through the public metadata type and honors bounded pages.
func RunList ¶
func RunList(t *testing.T, lister secrets.Lister, config StoreContractOptions)
RunList exercises the optional metadata-only listing contract, including page boundaries and namespace isolation. Values are inserted by RunStore; this function only observes Metadata results.
func RunStore ¶
func RunStore(t *testing.T, factory StoreFactory, options ...StoreContractOptions)
RunStore runs resolver/store behavior shared by local and future backends. Exactly one options value is required so this reusable runner cannot smuggle in a backend-specific reference or capability assumption.
Types ¶
type ContractOptions ¶
type ContractOptions = StoreContractOptions
ContractOptions is a short alias retained for adapters that use a generic contract-options name in their test harness.
type StoreContractConfig ¶
type StoreContractConfig = StoreContractOptions
StoreContractConfig is a descriptive alias for callers that prefer the word “config” at the call site.
type StoreContractOptions ¶
type StoreContractOptions struct {
Reference secrets.Reference
Namespace secrets.Namespace
OtherReference secrets.Reference
OutsideReference secrets.Reference
RequireCreateOnly bool
RequireCompareAndSwap bool
RequireVersion bool
RequireListing bool
}
StoreContractOptions identifies safe, backend-specific references used by the contract. The runner deliberately has no default scheme or path: each backend must provide references that it can actually resolve and list.