Alternera. Plugin. Provisional. Checks behaviour
(alternera_plugin_sdk v0.9.0)
Copy Markdown
View Source
Provisional: added for the Response cache, and a change to it needs a
changelog line but no new major (docs/USER_PLUGINS_DESIGN.md).
A step's settings checked where the step stands, on a save. init/1 sees
the settings alone; a plugin whose settings name things only the pipeline
knows (the side a condition is read on, the proxy's cache vocabulary)
exports flow_errors/2, which the proxy's flow check calls with the whole
stored step and its place, after its own checks of where the step may
stand have passed. The messages it answers are the step's, prefixed with
its label by the proxy.
The checks it needs of the proxy go through Alternera.Plugin.Host:
condition_errors/2: a list of conditions read on a side, each as the pipeline's own conditions are checked;cache_settings_errors/1: a cache's key,ttl,wait_ms,store,responserules andlimits, as a cache container's are checked;cache_key_reads_body?/1: whether a cache key reads the request body.
On the SDK's test host (Alternera.Plugin.Test.Host), as in a
plugin's own tests, the conditions are checked for their shape only and
the cache settings not at all.
Summary
Types
Where the step stands: its section and the side it runs on (:request,
:response, :implementation for an Implementation's own steps, or
:on_error).
Callbacks
What is wrong with step (the stored step, string keys: "settings",
"id", "on_error"…) at place, as messages; [] when nothing is.
Functions
Whether a cache key template reads the request body.
What is wrong with a cache's settings (string keys), as a cache container's are checked.
What is wrong with conditions read on side (:request or
:response), one message per wrong condition, "condition <n>: …"
(1-based).
Types
@type place() :: %{ section: :before | :implementation | :after | :on_error, side: atom() }
Where the step stands: its section and the side it runs on (:request,
:response, :implementation for an Implementation's own steps, or
:on_error).
Callbacks
Functions
Whether a cache key template reads the request body.
What is wrong with a cache's settings (string keys), as a cache container's are checked.
What is wrong with conditions read on side (:request or
:response), one message per wrong condition, "condition <n>: …"
(1-based).