atproto_core/oauth/resource
A DPoP-authenticated resource request as an Effect: attach
Authorization: DPoP <token> and a proof bound to method, URL, and
access-token hash (ath), with the server-nonce retry. The token only
ever goes to the session’s PDS origin; a request for any other origin is
refused before anything is signed or sent.
Types
pub type ResourceError {
ForeignOrigin(url: String)
ProofFailed(reason: String)
RequestFailed(error: xrpc.TransportError)
}
Constructors
-
ForeignOrigin(url: String)The request targets an origin other than the session’s PDS.
-
ProofFailed(reason: String) -
RequestFailed(error: xrpc.TransportError)
Values
pub fn resource_error_to_string(error: ResourceError) -> String
pub fn send(
req: request.Request(BitArray),
pds pds: remote.Origin,
access_token access_token: String,
ath ath: String,
) -> effect.Effect(
Result(response.Response(BitArray), ResourceError),
)
Send req with the access token, if and only if it targets pds.