atproto_core/oauth/effect
A sans-IO effect kernel: an Effect(a) is a pure description of the
HTTP + DPoP steps a flow needs, interpreted by a per-target runner.
Keys never appear here; DpopProof asks the runner for a proof.
Fetch carries string bodies (OAuth endpoints), FetchBits binary
(the resource path).
Types
pub type Effect(a) {
Fetch(
request: request.Request(String),
next: fn(
Result(response.Response(String), xrpc.TransportError),
) -> Effect(a),
)
FetchBits(
request: request.Request(BitArray),
next: fn(
Result(response.Response(BitArray), xrpc.TransportError),
) -> Effect(a),
)
DpopProof(
method: String,
url: String,
nonce: option.Option(String),
ath: option.Option(String),
next: fn(Result(String, String)) -> Effect(a),
)
Done(a)
}
Constructors
-
Fetch( request: request.Request(String), next: fn(Result(response.Response(String), xrpc.TransportError)) -> Effect( a, ), ) -
FetchBits( request: request.Request(BitArray), next: fn( Result(response.Response(BitArray), xrpc.TransportError), ) -> Effect(a), ) -
DpopProof( method: String, url: String, nonce: option.Option(String), ath: option.Option(String), next: fn(Result(String, String)) -> Effect(a), ) -
Done(a)
Values
pub fn fetch(
request: request.Request(String),
) -> Effect(
Result(response.Response(String), xrpc.TransportError),
)
A string-bodied HTTP request, yielding the response (or a transport error).
pub fn fetch_bits(
request: request.Request(BitArray),
) -> Effect(
Result(response.Response(BitArray), xrpc.TransportError),
)
A binary HTTP request (the resource path, for blobs), yielding the response.
pub fn get_checked(
url: String,
) -> Effect(Result(response.Response(String), xrpc.XrpcError))
GET url and status-check the response: the shared shape of the
metadata and resolver lookups.
pub fn proof(
method method: String,
url url: String,
nonce nonce: option.Option(String),
ath ath: option.Option(String),
) -> Effect(Result(String, String))
Ask the runner for a DPoP proof bound to this method+URL (and optional nonce and access-token hash). The runner signs it with its platform key.