Skip to content

feat(remote): resolve identities by did:atomic identifier - #260

Open
graywolf336 wants to merge 1 commit into
devfrom
feature/identity-did-lookup
Open

graywolf336 wants to merge 1 commit into
devfrom
feature/identity-did-lookup

Conversation

@graywolf336

@graywolf336 graywolf336 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Signed objects (attestations, delegations) carry only the signer's did:atomic:... identifier — base32(blake3(public_key)), a one-way fingerprint of the key. Verifying such an object requires recovering the public key by DID, which the client had no path to do.

The server side (companion PR in atomic-storage — linked below) adds GET /identities/by-did/{did}, backed by a new key_fingerprint lookup column.

What

StorageClient::resolve_identity_by_did(did) in atomic-remote/src/storage.rs, next to the existing public-key resolution:

  • Calls GET /identities/by-did/{did} with the same bearer auth as resolve_identity_by_email/by_name (the endpoint is authenticated because holding a DID proves nothing — DIDs circulate in public signed objects).
  • Verifies the answer before returning it as success: the returned key is re-checked with atomic_canonical::did::did_matches_public_key. The server indexes by the fingerprint, so a spoofed answer would otherwise be well-formed — and a client that trusts this key to verify a signature must not take it on faith. Mismatch, missing key, and unparseable key all fail the call; never silently succeed. (Done inside the method, so callers cannot forget it.)
  • Tests: match passes; mismatch / missing / unparseable all error.

atomic-identity added as a dependency of atomic-remote for PublicKey::from_base32 (already a workspace member dep).

Verification

cargo fmt -p atomic-remote -- --check
cargo clippy -p atomic-remote --all-targets -- -D warnings   # clean
cargo test -p atomic-remote                                  # 221+14 pass

Companion

Server PR: atomicdotdev/atomic-storage#108 (merge server first or ship together — this method 404s against servers without the endpoint, which surfaces as a clean RemoteError, not a panic).

Signed objects carry only the signer's DID (a blake3 fingerprint of the
public key); verifying them requires recovering the key by DID. Adds
StorageClient::resolve_identity_by_did against the new
GET /identities/by-did/{did} endpoint, authenticating like the
name/email resolution.

The returned key is re-derived against the requested DID before the
call succeeds (via atomic_canonical::did::did_matches_public_key): a
server that answers a fingerprint lookup with the wrong key must not
silently validate a spoofed signer. Unit tests cover the match and
every untrustworthy-answer path (mismatch, missing, unparseable).
@graywolf336

Copy link
Copy Markdown
Contributor Author

Heads-up for reviewers: this branch is intentionally based on a4e2809 (the commit just before #207 merged to dev), not dev tip. atomic-storage's CI resolves the sibling checkout by branch name, and storage has not yet adapted to the #207 align_to_view/TrackingOptions API changes — pinning the sibling to the last compatible commit keeps the companion storage PR's CI meaningful. The diff against dev is unaffected (merge-base is a4e2809); I verified fmt/clippy/test for atomic-remote on this base.

@graywolf336
graywolf336 force-pushed the feature/identity-did-lookup branch from 6c992b3 to e60f47c Compare October 15, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant