Skip to content

Commit 84f2a38

Browse files
authored
feat: add serviceId to version object (#192)
1 parent 32f6ebf commit 84f2a38

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

artifacts/src/main/resources/common/example/protocol-version.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
{
44
"version": "2025-1",
55
"path": "/some/path/2025-1",
6-
"binding": "HTTPS"
6+
"binding": "HTTPS",
7+
"serviceId": "service-asdf"
78
},
89
{
910
"version": "2024-1",
@@ -16,7 +17,9 @@
1617
"authorization_code",
1718
"refresh_token"
1819
]
19-
}
20+
},
21+
"serviceId": "service-asdf"
22+
2023
},
2124
{
2225
"version": "2025-1",
@@ -28,7 +31,8 @@
2831
"profile": [
2932
"vc11-sl2021/jwt"
3033
]
31-
}
34+
},
35+
"serviceId": "service-qwerty"
3236
}
3337
]
3438
}

artifacts/src/main/resources/common/protocol-version-schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"HTTPS"
5252
]
5353
},
54+
"serviceId": {
55+
"type": "string"
56+
},
5457
"auth": {
5558
"$ref": "#/definitions/Auth"
5659
}

artifacts/src/test/java/org/eclipse/dsp/schema/common/InvalidVersionSchemaTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void verifyInvalidCases() throws IOException {
3636
assertThat(schema.validate(INVALID_AUTH_A_STRING, JSON).iterator().next().getType()).isEqualTo(TYPE);
3737
assertThat(schema.validate(INVALID_AUTH_MISSING_PROTOCOL, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
3838
assertThat(schema.validate(INVALID_AUTH_PROFILE_NOT_AN_ARRAY, JSON).iterator().next().getType()).isEqualTo(TYPE);
39+
assertThat(schema.validate(INVALID_SERVICEID_NOT_A_STRING, JSON).iterator().next().getType()).isEqualTo(TYPE);
3940
}
4041

4142
@BeforeEach
@@ -151,4 +152,22 @@ void setUp() {
151152
]
152153
}
153154
""";
155+
156+
private static final String INVALID_SERVICEID_NOT_A_STRING = """
157+
{
158+
"protocolVersions": [
159+
{
160+
"version": "1.0",
161+
"path": "/some/path/v1",
162+
"binding": "HTTPS",
163+
"auth": [{
164+
"protocol": "some-protocol",
165+
"version": "2",
166+
"profile": "one-profile"
167+
}],
168+
"serviceId": 666
169+
}
170+
]
171+
}
172+
""";
154173
}

specifications/common/common.protocol.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ endpoint should adhere to [[rfc8615]].
2525

2626
A [=Connector=] must respond to a respective HTTPS request by returning a [`VersionResponse`](#VersionResponse-table)
2727
with at least one item. The item connects the version tag (`version` attribute) with a path to the endpoint.
28-
The semantics of the `path` property are specified by each protocol binding.
28+
The semantics of the `path` property are specified by each protocol binding. The `serviceId` is a unique id for
29+
a [=Data Service=] and allows to group DSP-endpoints exposed by different [=Data Service=]s across versions. `binding`
30+
describes the DSP protocol binding such as HTTPS. `auth` describes how a DSP endpoint is secured by means of the
31+
`protocol`, `version` strings and the `profile` array.
2932

3033
This data object must comply to the [JSON Schema](message/schema/protocol-version-schema.json). The requesting
3134
[=Connector=] may select from the endpoints in the response. If the [=Connector=] can't identify a matching Dataspace
@@ -38,9 +41,8 @@ discovery of all endpoints of this version. The concatenation of `<root>` and `p
3841

3942
The following example demonstrates that a [=Connector=] offers the HTTPS binding from version `2024-1` at
4043
`<root>/some/path/2024-1`, the `2025-1` endpoints at `<root>/some/path/2025-1` and another [=Connector=] on the same
41-
root URL under `<root>/different/path/2025-1` - some of which signal the relevant authentication protocol overlay,
42-
determined by `protocol`, `version` and the `profile` array. `<root>` in the examples below is _https://provider.com_ or
43-
_https://provider.com/path-to-root/_ respectively.
44+
root URL under `<root>/different/path/2025-1` - some of which signal the relevant authentication protocol overlay.
45+
`<root>` in the examples below is _https://provider.com_ or _https://provider.com/path-to-root/_ respectively.
4446

4547
<aside class="example" title="Well-known Version Endpoint (HTTPS) at different root path">
4648
<pre class="http">GET https://provider.com/.well-known/dspace-version

0 commit comments

Comments
 (0)