-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds the technical definition of watchers to the specification #181
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Stephen Curran <[email protected]>
spec/specification.md
Outdated
##### Watcher Endpoints and Behaviour | ||
|
||
A [[ref: watcher]] that has its HTTP URL published in the [[ref: DID Log]] of a `did:webvh` must support the following endpoints. The query parameters **MUST NOT** be used in combination: | ||
|
||
- `HTTP GET <WATCHER URL>?vhscid=<SCID>` — Returns the most recent `did:webvh` [[ref: DID Log]] file for the DID with the provided `<SCID>` from the [[ref: watchers]] cache. | ||
|
||
- `HTTP GET <WATCHER URL>?vhscid-witness=<SCID>` — Returns the most recent `did:webvh` `witness.json` file for the DID with the provided `<SCID>` from the [[ref: watchers]] cache. | ||
|
||
- `HTTP GET <WATCHER URL>?vhscid=<SCID>&resource=<RESOURCE_PATH>` — Requests the cached version of the specified `<RESOURCE_PATH>` for the given `<SCID>`. If the resource is not found in the cache, the watcher **SHOULD** return a `404 Not Found` response. | ||
|
||
- `HTTP POST <WATCHER URL>?vhscid=<SCID>` — Sent by the [[ref: DID Controller]] or another authorized party to notify the [[ref: watcher]] that the `did:webvh` DID has been updated and should be retrieved from the DID's web location. | ||
|
||
- `HTTP POST <WATCHER URL>?vhscid-entry=<SCID>` — Sent by the [[ref: DID Controller]] or another authorized party to notify the [[ref: watcher]] that the `did:webvh` DID has been updated and provides, as the body of the message, the [[ref: JSON Line]] that is the new [[ref: DID log entry]]. | ||
|
||
- This endpoint can be used when the [[ref: watcher]] is also a [[ref: witness]] and is used to notify the [[ref: witness]] that a new entry has been created that the witness must verify and approve. | ||
|
||
- `HTTP POST <WATCHER URL>?vhscid=<SCID>&resource=<RESOURCE_PATH>` — Sent by the [[ref: DID Controller]] or another authorized party to notify the [[ref: watcher]] that a new [[ref: DID resource]] (file) has been published under the given `<RESOURCE_PATH>` and should be retrieved and cached. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we only have 1 endpoint defined or have a set of endpoints relevant to their actions? Having only 1 endpoint might overload this endpoint.
The operations a watcher should do can be summed up as:
- Return latest log entry for a given SCID
- Signal a new log entry is available for a given SCID
- Return witness file for a given SCID
- Request witness signature for a given log entry and SCID
- Only on the case of a witness-watcher
- Return resource for a given SCID and resource path
- Signal new resource for a given SCID and resource path
I would suggest to divide these operations into 3 endpoints to avoid overloading:
<WATCHER URL>/log
<WATCHER URL>/witness
<WATCHER URL>/resource
Operations can be carried as such:
GET <WATCHER URL>/log?scid=<SCID>
Returns latest log entry.
POST <WATCHER URL>/log?scid=<SCID>
Empty body, fetch and update log entries.
GET <WATCHER URL>/witness?scid=<SCID>
Returns witness file.
POST <WATCHER URL>/witness?scid=<SCID>
{
"logEntry": {...},
"options": {
"callbackUrl": "https://..."
}
}
Validates and signs the log entry provided in request body. This endpoint can return a 200 with the witness proof or a 202 with an empty body, having the proof returned as a POST request to the callbackUrl
provided.
GET <WATCHER URL>/resource?scid=<SCID>&path=<resourcePath>
Returns resource
POST <WATCHER URL>/resource?scid=<SCID>&path=<resourcePath>
Fetch and updates resource
Signed-off-by: Stephen Curran <[email protected]>
Signed-off-by: Stephen Curran <[email protected]>
Updated the PR to add items discussed at the 2025-03-13 Meeting. Notably:
Not done yet:
|
Adds the concept of watchers to the spec. As always, provides a relatively short/simple technical implementation, and leaves the governance / implementation details out of the spec. That said, it does add more implementation details than, say, the witness implmentation.
Watchers are a list of URLs that monitor the DID. The URL must respond to a core set of 5 endpoints to return the cached DID Log, return the cached witness.json file, return a cached resource, webhook about an update to the DID, webhook about an update to a resource.
It's a slippery slope to define how much to include.
Questions from me:
Signed-off-by: Stephen Curran [email protected]