Remove com.atproto.server.createActorAuth and the actor-request credential #646

Merged ngerakines.me
targeting main from lexicon-identity-resolver
Merged opened by and assigned to ngerakines.me
targeting main from lexicon-identity-resolver

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_did and get_lexicon take an &dyn atproto_identity::traits::IdentityResolver; DefaultLexiconResolver::new takes an Arc<dyn IdentityResolver> as a third argument. That resolver already owns the choice — InnerIdentityResolver carries a plc_hostname — and the PDS has been resolving lexicon authorities through one all along, so the hardcoding was only ever on the library path.
  • did:webvh resolves. The hand-rolled did:plc/did:web match this replaces answered InvalidDIDFormat for 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 getRecord is keyed by, and the old path resolved the subject once for each.
  • Callers updated — the CLI binary, which now actually honours PLC_HOSTNAME, and atpmcp's two get_lexicon call sites, which already held an InnerIdentityResolver.

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.

Commits 0