Skip to content

Commit

Permalink
version endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbader-sap authored Nov 30, 2023
1 parent a6c434b commit 0c9e509
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
13 changes: 13 additions & 0 deletions common/common.binding.https.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# General Binding Aspects

## 4 The Well-Known Version Metadata Endpoint

Each implementation must provide the version metadata endpoint, which must use the `dspace-version` [Well-Known Uniform Resource Identifier](https://www.rfc-editor.org/rfc/rfc8615.html) at the top of the
path hierarchy:

`/.well-known/dspace-version`

The contents of the response is a JSON object defined in the [Dataspace Protocol](./common.protocol.md#exposure-of-dataspace-protocol-versions).

Note that if multiple connectors are hosted under the same base URL, a path segment appended to the base well-known URL can be used, for example,
`https://example.com/.well-known/dspace-version/connector1.`
23 changes: 23 additions & 0 deletions common/common.protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# General Requirements

## Exposure of Dataspace Protocol Versions

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

A Connector must respond to a respective request by providing a JSON-LD object containing an array of supported versions with at least one item. The item connects the version tag (`version` attribute) with the absolute URL path segment of the root path for all endpoints of this version. The following example specifies that this Connector offers version `1.0` endpoints at `<host>/some/path/v1`.

```
{
"@context": "https://w3id.org/dspace/v0.8/context.json",
"protocolVersions": [
{
"version": "1.0",
"path": "/some/path/v1"
}
]
}
```

This data object must comply to the [JSON Schema](schema/version-schema.json) and the [SHACL Shape](shape/version-shape.ttl).

The requesting Connector may select from the endpoints in the response. If the Connector can't identify a matching Dataspace Protocol Version, it must terminate the communication.
39 changes: 39 additions & 0 deletions common/schema/version-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "VersionSchema",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/Version"
}
],
"$id": "https://w3id.org/dspace/schemas/v0.8/VersionSchema",
"definitions": {
"Version": {
"type": "object",
"properties": {
"@context": {
"type": "string",
"const": "https://w3id.org/dspace/v0.8/context.json"
},
"protocolVersions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": ["version", "path"]
},
"minItems": 1
}
},
"required": ["@context", "protocolVersions"]
}
}
}
Empty file added common/shape/version-shape.ttl
Empty file.

0 comments on commit 0c9e509

Please sign in to comment.