Repository navigation
feat(diddoc): add an HTTP handler that serves a DID document - #94
Conversation
Services publishing a did:web identity each wrote their own handler for /.well-known/did.json, and none of them told clients how long the document could be cached. This one sends a Cache-Control max-age (five minutes unless configured), an ETag derived from the document and a Last-Modified time, and answers conditional requests with a 304. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Picks up the did:web resolver cache, and adds a test that runs the resolver against the handler: one fetch, then a 304 for each revalidation. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Other services had no way to know how long the delegator's DID document, which holds the key its signatures are checked against, could be cached. - The service's own DID document at `/.well-known/did.json` is now served by the shared handler from fil-forge/libforge#94. Responses say the document may be cached for five minutes and carry an `ETag` and `Last-Modified`, and a client that already holds the current document gets a 304 with no body. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
DID documents hold the keys that signatures are checked against. This service cached other services' documents for a fixed three hours whatever their hosts said, and published its own with no caching information at all. Both sides now follow HTTP caching, so a rotated key is picked up within minutes. - The three-hour cache this service kept around did:web resolution is gone. The resolver caches documents itself since fil-forge/ucantone#80: for as long as the document's host says, or five minutes when it does not say, after which it checks with the host whether the document has changed. - The service's own DID document at `/.well-known/did.json` is now served by the shared handler from fil-forge/libforge#94. Responses say the document may be cached for five minutes and carry an `ETag` and `Last-Modified`, and a client that already holds the current document gets a 304 with no body. The cache in front of did:plc resolution is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
DID documents hold the keys that signatures are checked against. This service cached other services' documents for a fixed one hour whatever their hosts said, and published its own with no caching information at all. Both sides now follow HTTP caching, so a rotated key is picked up within minutes. - The one-hour cache this service kept around did:web resolution is gone. The resolver caches documents itself since fil-forge/ucantone#80: for as long as the document's host says, or five minutes when it does not say, after which it checks with the host whether the document has changed. - The service's own DID document at `/.well-known/did.json` is now served by the shared handler from fil-forge/libforge#94. Responses say the document may be cached for five minutes and carry an `ETag` and `Last-Modified`, and a client that already holds the current document gets a 304 with no body. The cache in front of did:plc resolution is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
DID documents hold the keys that signatures are checked against. This service cached other services' documents for a fixed three hours whatever their hosts said, and published its own with no caching information at all. Both sides now follow HTTP caching, so a rotated key is picked up within minutes. - The three-hour cache this service kept around did:web resolution is gone. The resolver caches documents itself since fil-forge/ucantone#80: for as long as the document's host says, or five minutes when it does not say, after which it checks with the host whether the document has changed. - The service's own DID document at `/.well-known/did.json` is now served by the shared handler from fil-forge/libforge#94. Responses say the document may be cached for five minutes and carry an `ETag` and `Last-Modified`, and a client that already holds the current document gets a 304 with no body. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Other services had no way to know how long Ingot's DID document, which holds the key its signatures are checked against, could be cached. - The service's own DID document at `/.well-known/did.json` is now served by the shared handler from fil-forge/libforge#94. Responses say the document may be cached for five minutes and carry an `ETag` and `Last-Modified`, and a client that already holds the current document gets a 304 with no body. Not run locally: the Postgres-backed tests and the integration suite. Only the DID document test was run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Every service that publishes a did:web identity has its own small handler for
/.well-known/did.json, and none of them tells clients how long the document may be cached. This adds one handler for all of them to share.ETagderived from the document's content and aLast-Modifiedtime, and a client that already holds the current document gets a 304 with no body. TheETagis the same across restarts and replicas serving the same document.net/httphandler, so it mounts in echo and fiber through their adaptors.It pairs with the did:web resolver cache in fil-forge/ucantone#80, which reads these headers, but does not depend on it. Moving the services over to this handler follows in their own PRs.
🤖 Generated with Claude Code