pub struct Network {
private: PrivateAddresses,
local: Arc<dyn LocalRepositories>,
}Expand description
The real fetch: resolve the DID to its #atproto_pds endpoint, then
com.atproto.repo.getRecord there.
Both hops go through [didbot_http::pinned_client], which resolves the
host once, refuses it at a private address, pins the connection to what
it resolved to and follows no redirect. Both hops read a bounded body.
Every URL here is named by somebody else — the DID’s own document says
which server holds the repository — which is the same posture
didbot_serve::tree::oidc takes toward an issuer a token names.
Fields§
§private: PrivateAddresses§local: Arc<dyn LocalRepositories>Implementations§
Source§impl Network
impl Network
Sourcepub fn new(local: Arc<dyn LocalRepositories>, private: PrivateAddresses) -> Self
pub fn new(local: Arc<dyn LocalRepositories>, private: PrivateAddresses) -> Self
A fetcher that refuses what local already holds, and refuses a
private address unless private allows one.
Sourceasync fn endpoint(&self, did: &str) -> Result<String, Unknown>
async fn endpoint(&self, did: &str) -> Result<String, Unknown>
The #atproto_pds endpoint did’s document names.
Sourceasync fn get_bounded(
&self,
url: &str,
max_bytes: usize,
) -> Result<Vec<u8>, Unknown>
async fn get_bounded( &self, url: &str, max_bytes: usize, ) -> Result<Vec<u8>, Unknown>
A GET through a client pinned to url’s own addresses, with its
body read against max_bytes.
Sourceasync fn send(&self, url: &str) -> Result<Response, Unknown>
async fn send(&self, url: &str) -> Result<Response, Unknown>
A GET through a client pinned to url’s own addresses, with the
status left to the caller.
Sourceasync fn list_records(&self, endpoint: &str, collection: &RecordRef) -> Fetched
async fn list_records(&self, endpoint: &str, collection: &RecordRef) -> Fetched
com.atproto.repo.listRecords for every record in collection at
endpoint, as an array of {"uri": …, "value": …}.
An empty collection is Fetched::Absent, the same answer a key
nothing holds gets: the repository answered, and holds nothing
there.