Skip to main content

require_agent_token

Function require_agent_token 

Source
pub fn require_agent_token(
    registry: &dyn Registry,
    headers: &HeaderMap,
) -> Result<String, ApiError>
Expand description

Resolves an agent token from the Authorization header, for com.atproto.repo.*’s write routes and uploadBlob.

Bearer <token>, because atproto has one bearer scheme and the kind of bearer a route wants is which store the token is checked against, not a separate word in the header. A token Registry::verify_agent_token does not recognise is invalid_token.