Suite of AT Protocol TypeScript libraries built on web standards
21
fork

Configure Feed

Select the types of activity you want to include in your feed.

README.md

Identity Tests#

This directory contains tests for the ATP identity system, including DID resolution and caching functionality.

Current Status#

Working Tests#

  • did-document.test.ts - DID document parsing and validation ✅
  • did-cache.test.ts - DID caching functionality ✅ (fixed with mock implementation)

Partially Working Tests#

  • handle-resolver.test.ts - Handle resolution (2/4 tests passing, DNS resolution issues)

Known Issues#

PLC Tests (did-resolver.test.ts)#

The did-resolver.test.ts tests are failing due to a version compatibility issue between the PLC library packages:

  • @did-plc/lib v0.0.4 (client library)
  • @did-plc/server v0.0.1 (server library, published 2 years ago)

Problem: The server rejects signatures generated by the client with "Invalid signature on op" errors, even though the signature generation appears to be working correctly.

Root Cause: The server package is significantly older and uses different validation logic than the client library expects.

Fixed for did-cache.test.ts: Implemented a mock HTTP server approach that bypasses the PLC compatibility issue while still testing the caching functionality.

Handle Resolver Tests#

Some DNS resolution tests are failing, possibly due to network/environment issues or missing test DNS records.

Potential Solutions:

  1. Wait for updated compatible versions of the PLC packages
  2. Switch to the @atproto/plc ecosystem (if available and compatible)
  3. Mock the PLC server interactions for testing purposes
  4. Use a different DID method for testing

Server Changes#

The web/server.ts file has been successfully converted from Express to use Deno.serve while maintaining the same API and functionality. The web server tests should work once the PLC dependency issues are resolved.

Running Tests#

# Run all tests (some may be skipped due to above issues)
deno test --allow-all

# Run specific working tests
deno test --allow-all tests/did-document.test.ts
deno test --allow-all tests/did-cache.test.ts