Skip to main content

authorize

Function authorize 

Source
pub(crate) fn authorize(
    state: &AppState,
    headers: &HeaderMap,
    http_method: &str,
    path: &str,
    lxm: Option<&str>,
    aud: &str,
) -> Result<Caller, ApiError>
Expand description

Resolves the credential on a call at another service, and checks that it may call lxm at aud.

The credential is the one the write routes take: the account’s own agent token, or a DPoP-bound OAuth token whose scope permits the call; see auth::Writer::authorize_rpc. http_method and path are this request’s own, which a DPoP proof binds to.