Expand description
Shared plumbing for the store-* nodes.
Store resolution happens once, at policy-compile time: the node holds the
resulting handle and nothing reads the registry on the request path. This is
the pattern limit-count established (src/plugins/native/limit_count.rs).
Structs§
- Store
Handle - A resolved store, held by a node for its lifetime.
Functions§
- is_
value_ type_ error - True when a redis error reflects a value/type problem rather than an
outage: a command applied to a key holding the wrong type (
WRONGTYPE, surfaced by the crate as anExtensionErrorwith that code), or a numeric operation against a non-numeric value (ERR value is not an integer or out of range). Both are data faultsstore-incrreports asSTORE_VALUE_INVALID, neverSTORE_ERROR. - key_
invalid - A
keytemplate that rendered to nothing. - namespaced_
key - Builds the full redis key for a rendered policy key.
- optional_
seconds - Parses an optional positive duration in seconds.
- optional_
ttl - Parses the optional
ttl_seconds. Absent means no expiry;0is rejected. - prepare_
error_ 🔒response - Prepares the response common to every store-node error before it exits
the node’s
errorport: status + JSON body +content-type, the same shapelimit-countand the session plugins already use (e.g.authz_casdoor::store_error,limit_count.rs’sRATE_LIMIT_UNAVAILABLEbranch). - required_
template - Parses a required, templated string field.
- resolve
- Resolves the
storeconfig key to a handle, at construction time. - store_
error - A store outage. Never conflated with a miss: see the spec’s §7. Prepares a
503– the dependency is unavailable, not the caller’s fault – so a policy that wireserror -> clientcannot fail open with a200. - value_
invalid - A value that exists but is not usable as configured (bad JSON, non-numeric).
Prepares a
500: a data/config fault, not an outage.