Skip to main content

store-delete

Removes a key from a declared store.

- id: clear-retries
type: store-delete
config:
store: sessions
key: "retry:{{request.cookies.fb_sid}}"

Config

KeyTypeRequiredDefaultMeaning
storestringyesName of a declared stores: entry
keystring (templated)yesKey to delete

Ports

PortKindMeaning
successsuccessThe key was removed, or it did not exist
errorerrorThe store could not be reached, or the key rendered empty

Deleting an absent key is a success

There is no miss port here, unlike store-get. Deleting a key that was never set, or has already expired, is not a failure — it is the state the caller wanted. A miss port would be mandatory-wired in every policy that clears state, to signal something almost no caller acts on differently from ordinary success.

Keys are namespaced

Every key is stored as <store key_prefix>:kv:<your key>, so policy keys cannot collide with the session, rate-limit and ACME keys that share the same store.

Errors

CodeWhen
STORE_ERRORThe store could not be reached
STORE_KEY_INVALIDkey rendered to an empty string (would put every request on one shared key)

See also

store-get · store-set · store-incr