Fixes #3. Thanks to @sylv.gay for the bug report.
atproto_lexicon::resolve::get_pds_from_did queried the hostname
"plc.directory" written into its body, so every lexicon resolution this crate
performs reached the public directory however the surrounding process was
configured — a deployment pointed at its own PLC directory, a mirror, or an
offline test double still resolved lexicon authorities against a host it had
deliberately not chosen. atproto-lexicon-resolve read PLC_HOSTNAME into a
variable it then discarded, which is the same bug seen from the other end.
What changed #
get_pds_from_didandget_lexicontake an&dyn atproto_identity::traits::IdentityResolver;DefaultLexiconResolver::newtakes anArc<dyn IdentityResolver>as a third argument. That resolver already owns the choice —InnerIdentityResolvercarries aplc_hostname— and the PDS has been resolving lexicon authorities through one all along, so the hardcoding was only ever on the library path.did:webvhresolves. The hand-rolleddid:plc/did:webmatch this replaces answeredInvalidDIDFormatfor it; the error variant goes with the match that raised it, and resolve-error number 3 is retired rather than reused.- One round trip instead of two: the document that names the PDS is the document
that names the DID the following
getRecordis keyed by, and the old path resolved the subject once for each. - Callers updated — the CLI binary, which now actually honours
PLC_HOSTNAME, andatpmcp's twoget_lexiconcall sites, which already held anInnerIdentityResolver.
Breaking #
Three functions each gain one argument. LexiconResolveError::InvalidDIDFormat
is removed.
Tests #
Two offline tests hold the property: a recording resolver proves the endpoint
comes from the injected resolver and that it was asked for the subject it was
given, and that a subject resolves to the DID its document names rather than the
string it was called with. A resolution that still reached for plc.directory
would fail them rather than answer.