pub enum RunHookError {
NotAnObject,
TokenMissingOrNotAString,
TokenEmpty,
EnvNotAnObject,
EnvValueNotAString(String),
IdentityNotAString(&'static str),
}Expand description
Why a runHookPayload string could not be read as a RunHook.
A typed error rather than serde’s own message, and the reason is the trust
contract rather than tidiness: this payload carries the agent token, and
serde_json’s messages quote the offending value. A message that quoted a
value would put payload contents into a log line and a response body, which is
the one thing docs/TRUST.md promises never happens. Each variant below names
a key or a shape and never a value.
Variants§
NotAnObject
The payload string parsed as JSON but is not an object, or is not JSON.
TokenMissingOrNotAString
No agent_token key, or one whose value is not a string.
TokenEmpty
agent_token is the empty string. Accepting it would install a credential
every caller can guess.
EnvNotAnObject
env is present but is not a JSON object.
EnvValueNotAString(String)
env holds a value that is not a string, under this key. Only the key is
named — a value is where a secret would be.
IdentityNotAString(&'static str)
An identity key is present but is not a string. Names the key, never the value: both identity values are key material.