Skip to main content

require_token

Function require_token 

Source
pub(crate) fn require_token(
    state: &AppState,
    caller: Option<&Caller>,
    site: ActorSite,
    actor: &str,
) -> Result<(), ApiError>
Expand description

For a route that acts for the agent its token names (its memory, accounts, presets): the request must carry a token this srv minted. Without one the route has no one to act for, and a body’s agent_id is only a claim, so it is refused instead of being taken at its word.