feat: Publish addresses with optional Herald email service#491
Merged
feat: Publish addresses with optional Herald email service#491
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds relay-agent discovery/storage for Herald-backed addresses and introduces explicit publish/unpublish address operations that update DID document profile data (and conditionally add an Email service) across Keymaster TypeScript + Python implementations, server APIs, CLIs, and UIs.
Changes:
- Discover Herald
relayAgentvia domain/configendpoints during address add/import and persist it as address metadata (relay), surfacing it via list/get address APIs. - Add
publishAddress/unpublishAddressflows (server endpoints, TS/Python implementations, CLIs, and UIs) that managedidDocumentData.addressand an optional#emailservice entry. - Extend tests and docs to cover relay discovery and publish/unpublish behavior.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/keymaster/client.test.ts | Adds client tests for publish/unpublish address API calls. |
| tests/keymaster/address.test.ts | Adds Keymaster unit tests for relay discovery and publish/unpublish DID updates. |
| services/keymaster/server/src/keymaster-api.ts | Exposes /api/v1/addresses/publish POST/DELETE endpoints and normalizes the route for logging/metrics. |
| services/herald/server/src/index.ts | Exposes serviceDID always; conditionally advertises relayAgent when email bridge is enabled. |
| python/keymaster/tests/test_address.py | Adds relay + publish/unpublish coverage for Python Keymaster. |
| python/keymaster/src/keymaster/core.py | Implements relay discovery + publish/unpublish logic and surfaces address metadata consistently. |
| python/keymaster/src/keymaster/cli.py | Adds publish-address / unpublish-address CLI commands. |
| packages/keymaster/src/types.ts | Extends stored address type with optional relay; adds Keymaster interface methods. |
| packages/keymaster/src/keymaster.ts | Implements relay discovery, address metadata surfacing, and publish/unpublish logic. |
| packages/keymaster/src/keymaster-client.ts | Adds client wrappers for new server publish/unpublish endpoints. |
| packages/keymaster/src/cli.ts | Adds CLI commands for publish/unpublish. |
| packages/keymaster/README.md | Documents new CLI commands. |
| docs/services/herald/README.md | Documents updated /api/config shape and relayAgent semantics. |
| apps/react-wallet/src/components/IdentitiesTab.tsx | Switches UI to publish/unpublish APIs instead of raw mergeData. |
| apps/keymaster-client/src/KeymasterUI.jsx | Switches UI to publish/unpublish APIs instead of raw mergeData. |
| apps/gatekeeper-client/src/KeymasterUI.jsx | Keeps parity with keymaster-client UI publish/unpublish behavior. |
| apps/browser-extension/src/components/IdentitiesTab.tsx | Switches UI to publish/unpublish APIs instead of raw mergeData. |
| AGENTS.md | Codifies relay metadata + publish/unpublish behavior parity across TS/Python. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
publishAddress/unpublishAddressflows across Keymaster APIs, CLIs, clients, and UIs. Publishing always setsdidDocumentData.address; it adds the#emailmailto:service only when the stored address has a relay.relayAgentonly when the email bridge is enabled, while still exposingserviceDIDfor general service identity./addresses/publishAPI behavior and update the generated Keymaster API JSON.Validation
npm test -- tests/keymaster/address.test.ts tests/keymaster/client.test.ts --runInBandnpm run build -w @didcid/keymasternpm run buildinservices/keymaster/servernpm run buildinservices/herald/servernpm run buildinapps/react-walletnpm run buildinapps/browser-extensionnpm run buildinapps/keymaster-clientnpm run buildinapps/gatekeeper-client.venv/bin/python -m pytest -q python/keymaster/tests/test_address.py.venv/bin/python -c "import argparse; from keymaster.cli import build_parser; p=build_parser(); sp=[a for a in p._actions if isinstance(a, argparse._SubParsersAction)][0]; assert len(sp.choices)==134"python3 -m py_compile python/keymaster/src/keymaster/core.py python/keymaster/src/keymaster/cli.py python/keymaster/tests/test_address.pygit diff --check