Skip to content

Commit 7db54af

Browse files
authored
feat: add did doc registration and align well-known version endpoint (#122)
1 parent 6edffbc commit 7db54af

File tree

5 files changed

+105
-22
lines changed

5 files changed

+105
-22
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"title": "CatalogServiceDidServiceSchema",
4+
"type": "object",
5+
"allOf": [
6+
{
7+
"$ref": "#/definitions/CatalogServiceDidService"
8+
}
9+
],
10+
"$id": "https://w3id.org/dspace/2025/1/catalog/catalogservice-did-service-schema.json",
11+
"definitions": {
12+
"CatalogServiceDidService": {
13+
"type": "object",
14+
"properties": {
15+
"@context": {
16+
"allOf": [
17+
{
18+
"$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
19+
},
20+
{
21+
"type": "array",
22+
"contains": {
23+
"type": "string",
24+
"const": "https://www.w3.org/ns/did/v1"
25+
}
26+
}
27+
]
28+
},
29+
"type": {
30+
"type": "string",
31+
"const": "CatalogService"
32+
},
33+
"id": {
34+
"type": "string"
35+
},
36+
"serviceEndpoint": {
37+
"type": "string",
38+
"pattern": "https?://.*?/catalog$"
39+
}
40+
},
41+
"required": [
42+
"id",
43+
"type",
44+
"serviceEndpoint"
45+
]
46+
}
47+
}
48+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"@context": [
3+
"https://w3id.org/dspace/2025/1/context.jsonld",
4+
"https://www.w3.org/ns/did/v1"
5+
],
6+
"id":"some:id",
7+
"type": "CatalogService",
8+
"serviceEndpoint": "https://bar.example.com/some/path/catalog"
9+
}

artifacts/src/main/resources/context/dspace.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,17 @@
427427
}
428428
}
429429
},
430+
"CatalogService": {
431+
"@id":"dspace:CatalogService",
432+
"@context": {
433+
"id": "@id",
434+
"type": "@type",
435+
"serviceEndpoint": {
436+
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
437+
"@type": "@id"
438+
}
439+
}
440+
},
430441
"ACCEPTED": "dspace:ACCEPTED",
431442
"FINALIZED": "dspace:FINALIZED",
432443
"REQUESTED": "dspace:REQUESTED",

specifications/catalog/catalog.protocol.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,13 @@ upstream [=Catalog Services=] and advertises their
157157
respective [=Catalogs=] as a
158158
single [=Catalog Service=]. The broker is expected to honor upstream access
159159
control requirements.
160+
161+
### Discovery of [=Catalog Services=]
162+
163+
A Participant may publicize their [=Catalog Service=] via a DID document, see [[?did-core]]. In that case, the
164+
Participant MUST add an entry to the DID document's `service` array adhering to the corresponding [JSON schema](message/schema/catalogservice-did-service-schema.json).
165+
166+
<aside class="example" title="Catalog Service Did Service Example">
167+
<pre class="json" data-include="message/example/catalogservice-did-service.json">
168+
</pre>
169+
</aside>

specifications/common/common.protocol.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,50 @@ does not require authorization.
88

99
## Schemas & Contexts
1010

11-
All protocol [=Messages=] are normatively defined by a [[json-schema]]. This specification also uses JSON-LD 1.1 and provides
12-
a JSON-LD context to serialize data structures and [=Message=] types as it facilitates extensibility. The JSON-LD context is
13-
designed to produce [=Message=] serializations using compaction that validate against the Json Schema for the given [=Message=]
14-
type. This allows implementations to choose whether to process [=Messages=] as plain JSON or as JSON-LD and maintain
15-
interoperability between those approaches. Extensions that use JSON-LD are encouraged to provide similar contexts that
16-
facilitate this approach to interoperability.
11+
All protocol [=Messages=] are normatively defined by a [[json-schema]]. This specification also uses JSON-LD 1.1 and
12+
provides a JSON-LD context to serialize data structures and [=Message=] types as it facilitates extensibility. The
13+
JSON-LD context is designed to produce [=Message=] serializations using compaction that validate against the Json Schema
14+
for the given [=Message=] type. This allows implementations to choose whether to process [=Messages=] as plain JSON or
15+
as JSON-LD and maintain interoperability between those approaches. Extensions that use JSON-LD are encouraged to provide
16+
similar contexts that facilitate this approach to interoperability.
1717

1818
## Exposure of Versions {#exposure-of-dataspace-protocol-versions}
1919

2020
### Generic Definition
2121

22-
[=Connectors=] implementing the [=Dataspace Protocol=] may operate on different versions. Therefore, it is necessary that
23-
they can discover the supported versions of each other reliably and unambiguously. Each [=Connector=] must expose
24-
information of at least one Dataspace Protocol Version it supports. The specifics of how this information is obtained
22+
[=Connectors=] implementing the [=Dataspace Protocol=] may operate on different versions. Therefore, it is necessary
23+
that they can discover the supported versions of each other reliably and unambiguously. Each [=Connector=] must expose
24+
information of at least one Dataspace Protocol version it supports. The specifics of how this information is obtained
2525
its defined by specific protocol bindings.
2626

2727
A [=Connector=] must respond to a respective request by providing a JSON object containing an array of supported
2828
versions with at least one item. The item connects the version tag (`version` attribute) with the absolute URL path
29-
segment of the root path for all endpoints of this version. The following example specifies that this [=Connector=]
30-
offers version `1.0` endpoints at `<host>/some/path/v1`.
29+
segment of the domain-only path for all endpoints of this version. The following example specifies that
30+
this [=Connector=] offers version `2024-1` endpoints at `<host>/some/path/2024-1`, the `2025-1` endpoints at
31+
`<host>/some/path/2025-1` and another [=Connector=] on the same host under `<host>/different/path/2025-1`.
3132

3233
```json
3334
{
3435
"protocolVersions": [
3536
{
36-
"version": "1.0",
37-
"path": "/some/path/v1"
37+
"version": "2024-1",
38+
"path": "/some/path/2024-1"
39+
},
40+
{
41+
"version": "2025-1",
42+
"path": "/some/path/2025-1"
43+
},
44+
{
45+
"version": "2025-1",
46+
"path": "/different/path/2025-1"
3847
}
3948
]
4049
}
4150
```
4251

43-
This data object must comply to the [JSON Schema](message/schema/protocol-version-schema.json). The requesting [=Connector=] may select
44-
from the endpoints in the response. If the [=Connector=] can't identify a matching Dataspace Protocol Version, it must
45-
terminate the communication.
52+
This data object must comply to the [JSON Schema](message/schema/protocol-version-schema.json). The requesting
53+
[=Connector=] may select from the endpoints in the response. If the [=Connector=] can't identify a matching Dataspace
54+
Protocol Version, it must terminate the communication.
4655

4756
### HTTPS Binding
4857

@@ -55,9 +64,5 @@ Resource Identifier [[rfc8615]] at the top of the path hierarchy:
5564
/.well-known/dspace-version
5665
```
5766

58-
The contents of the response is a JSON object defined in section [[[#exposure-of-dataspace-protocol-versions]]].
59-
60-
Note that if multiple [=Connectors=] are hosted under the same base URL, a path segment appended to the base well-known
61-
URL can be used, for example, `https://example.com/.well-known/dspace-version/connector1.`
62-
63-
The version endpoint MUST be unprotected and unversioned.
67+
The contents of the response is a JSON object defined in section [[[#exposure-of-dataspace-protocol-versions]]]. The
68+
version endpoint MUST be unversioned and unauthenticated.

0 commit comments

Comments
 (0)