Documentation
¶
Overview ¶
Package storetest is test support only, never imported by production code: it seeds a disposable gateway database whose confirmed revision is a given policy, optionally with a provisional revision and its deadline and an administrator, reads single values back for assertions, and builds the small test policies the seeds use. Unit tests of the packages that open a deployment use it instead of the operator's install command.
Index ¶
- Constants
- func Int(t testing.TB, path, query string) int
- func JSONBody(maxBytes int64, schema string) *policy.BodyRule
- func Policy(withB bool) policy.Policy
- func Protected() policy.Policy
- func Rate(count, windowSeconds int64) *policy.RateRule
- func Seed(t testing.TB, path string, p policy.Policy, opts Options)
- type Options
Constants ¶
const AnyObject = `{"type":"object","additionalProperties":true}`
AnyObject is a body schema that accepts any JSON object.
Variables ¶
This section is empty.
Functions ¶
func Policy ¶
Policy routes API a to upstream A and, withB, API b to upstream B, with the operations read-a, write-a, denied and (withB) read-b; the upstream addresses are never dialled.
func Protected ¶
Protected is Policy(true) with authentication on every allowed operation and the roles READER and WRITER.