Skip to content

Commit 137540e

Browse files
authored
Fixed paths used in the discovery endpoint (#76)
* Amended the paths used in the discovery endpoint This is to reflect how ownCloud and Nextcloud are actually using the /ocm-provider endpoint to access a share, following further reverse engineering. * Improved description of share access and minor fixes
1 parent 635591b commit 137540e

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@ the [OpenAPI](https://github.com/OAI/OpenAPI-Specification) (fka Swagger) specif
2323
* For the core sharing functionality, the provider knows the consumer (both endpoint and user) when it creates a share with the consumer (also see [#26](https://github.com/cs3org/OCM-API/issues/26)). In addition, an optional invitation workflow is available in this specification (see below), which gives the consumer a way to automatically trust a provider (and vice versa). The [ScienceMesh](https://sciencemesh.io) infrastructure provides a managed white list of trusted federated sites.
2424
* Consumer doesn't have to accept a share, the resource will be available to the consumer immediately ([#25](https://github.com/cs3org/OCM-API/issues/25)).
2525
* Dealing with incoming shares is a vendor specific implementation. One vendor might use an 'accept before' process while another vendor might use a 'decline after' approach. This is considered part of the UX and thus not part of the interaction between different vendors. However, the consumer could notify the provider by using the introduced `/notifications` endpoint (also see [#27](https://github.com/cs3org/OCM-API/issues/27)).
26-
* Reverting access to outgoing shares is a vendor specific implementation. One vendor might delete an entire share while another might invalidate an access token. This is considered part of vendor specific internals and thus not part of the interaction between different vendors. However, the provider could notify the consumer by using the introduced `/notifications` endpoint (also see [#27](https://github.com/cs3org/OCM-API/issues/27)).
27-
* The actual file sync isn't a part of this specification. To keep this specification 'future proof', the file sync protocol will be embedded as a separate object in Open Cloud Mesh API calls. This protocol object contains all protocol specific options, e.g. WebDAV specific options.
26+
* Reverting access to outgoing shares is a vendor specific implementation. One vendor might delete an entire share while another might invalidate an access token. This is considered part of vendor-specific internals and thus not part of the interaction between different vendors. However, the provider could notify the consumer by using the introduced `/notifications` endpoint (also see [#27](https://github.com/cs3org/OCM-API/issues/27)).
27+
* The actual file sync is not part of this specification. To keep this specification 'future proof', the file sync protocol will be embedded as a separate object in Open Cloud Mesh API calls. This protocol object contains all protocol specific options, e.g. WebDAV specific options.
2828

2929

3030
## Specification
3131
### Discovery
3232
Authentication between services is already established. This means that this specification doesn't cover the way a service authenticates incoming API calls (e.g. through an API Key, VPN connection or IP whitelisting). In this scope we assume that the services are already authenticated.
3333

34-
If a finite whitelist of receiver servers exists on the sender
35-
side, then this list may already contain all necessary endpoint details.
34+
If a finite whitelist of receiver servers exists on the sender side, then this list may already contain all necessary endpoint details.
3635

3736
When a sending server allows sending to any internet-hosted receiving server, then discovery can happen from the sharee address, using the `/ocm-provider` well-known URL that receiving servers MAY provide according to this [specification](https://cs3org.github.io/OCM-API/docs.html?branch=develop&repo=OCM-API&user=cs3org#/paths/~1ocm-provider/get).
3837

@@ -47,7 +46,7 @@ To access a share, the receiving server MAY use multiple ways, depending on the
4746

4847
* If `protocol.name` = `multi`, the receiver SHOULD make a HTTP PROPFIND request to `protocol.webdav.uri` to access the remote share. If `protocol.webdav.sharedSecret` is not empty, the receiver SHOULD pass it as a `Authorization: bearer` header.
4948

50-
* If `protocol.name` = `webdav`, the receiver SHOULD inspect the `protocol.options` property. If it contains a `sharedSecret`, as in the [legacy example](https://cs3org.github.io/OCM-API/docs.html?branch=develop&repo=OCM-API&user=cs3org#/paths/~1shares/post), then the receiver SHOULD make a HTTP PROPFIND request to `https://<sharedSecret>:@<host><path>`, where `<host>` is the remote server, and `<path>` is obtained by querying the [Discovery](#discovery) endpoint at the remote server and extracting the path from `resourceTypes[0].protocols.webdav`.
49+
* If `protocol.name` = `webdav`, the receiver SHOULD inspect the `protocol.options` property. If it contains a `sharedSecret`, as in the [legacy example](https://cs3org.github.io/OCM-API/docs.html?branch=develop&repo=OCM-API&user=cs3org#/paths/~1shares/post), then the receiver SHOULD make a HTTP PROPFIND request to `https://<sharedSecret>:@<host><path>`, where `<host>` is the remote server, and `<path>` is obtained by querying the [Discovery](#discovery) endpoint at the remote server and getting `resourceTypes[0].protocols.webdav`.
5150

5251
In both cases, when the share is a folder and the receiver accesses a resource within the share, it SHOULD append its relative path to that URL.
5352

spec.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -288,29 +288,26 @@ definitions:
288288
webdav:
289289
type: string
290290
description: |
291-
The top-level WebDAV endpoint full URI. In order to access
292-
a remote shared resource, implementations MAY use this
293-
URI as a prefix: e.g. if in a new share request's payload
294-
a `protocol.options.sharedSecret` property is defined
295-
(see singleProtocolLegacy example), implementations MAY
296-
need to append it to this URI to access the resource.
297-
example: https://my-cloud-storage.org/remote.php/dav/ocm
291+
The top-level WebDAV path at this endpoint. In order to access
292+
a remote shared resource, implementations MAY use this path
293+
as a prefix, or as the full path (see sharing examples).
294+
example: /remote.php/dav/ocm/
298295
webapp:
299296
type: string
300297
description: |
301-
The top-level endpoint full URI for web apps. This value
298+
The top-level path for web apps at this endpoint. This value
302299
is provided for documentation purposes, and it SHALL NOT
303300
be intended as a prefix for share requests.
304-
example: https://my-cloud-storage.org/external/ocm
301+
example: /external/ocm/
305302
datatx:
306303
type: string
307304
description: |
308-
The top-level endpoint full URI for data transfers. This
305+
The top-level path to be used for data transfers. This
309306
value is provided for documentation purposes, and it SHALL
310307
NOT be intended as a prefix. In addition, implementations
311308
are expected to execute the transfer using WebDAV as
312309
the wire protocol.
313-
example: https://my-cloud-storage.org/remote.php/dav/ocm
310+
example: /remote.php/dav/ocm/
314311
capabilities:
315312
type: array
316313
description: |

0 commit comments

Comments
 (0)