Skip to main content

RunHookError

Enum RunHookError 

Source
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.

Trait Implementations§

Source§

impl Debug for RunHookError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RunHookError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RunHookError

Source§

impl PartialEq for RunHookError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RunHookError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.