Skip to content

Commit 439aa3a

Browse files
committed
Clarified that discovery happens on the owner's OCM address
1 parent abcd8a4 commit 439aa3a

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

IETF-RFC.md

+9-13
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ We define the following concepts (with some non-normative references to related
7373
* __Discovering Server__ - a server that tries to obtain information in OCM API discovery
7474
* __Discoverable Server__ - a server that tries to supply information in OCM API discovery
7575
* __OCM Address__ - a string of the form `<Receiving Party's identifier>@<fqdn>` which can be used to uniquely identify a user or group "at" an OCM Server. `<Receiving Party's identifier>` is an opaque string,
76-
unique at the server. `<fqdn>` is the Fully Qualified Domain Name by which the server is identified. This can, but doesn't need to be, the domain at which the OCM API of that server is hosted.
76+
unique at the server. `<fqdn>` is the Fully Qualified Domain Name by which the server is identified. This MUST be the domain at which the OCM API of that server is hosted.
7777
* __OCM Notification__ - a message from the Receiving Server to the Sending Server or vice versa, using the OCM Notifications endpoint.
7878
* __Invite Message__ - out-of-band message used to establish contact between parties and servers in the Invite Flow, containing an Invite Token (see below) and the Invite Sender's OCM Address
7979
* __Invite Sender__ - the party sending an Invite
@@ -395,11 +395,9 @@ If `multi` is given, one or more protocol
395395

396396
* Protocol details for `webdav` MAY contain:
397397
* REQUIRED uri (string)
398-
An URI to access the remote resource. The URI MAY be relative,
398+
An URI to access the remote resource. The URI SHOULD be relative,
399399
in which case the prefix exposed by the `/.well-known/ocm` endpoint MUST
400-
be used, or it MAY be absolute. The latter is recommended in case the
401-
receiver cannot unambiguously identify the sending server's endpoint (e.g.
402-
because of reverse proxies).
400+
be used. Absolute URIs are deprecated.
403401
* OPTIONAL sharedSecret (string) - required if no `code` field is given for the Share as a whole (see above).
404402
An optional secret to be used to access the resource,
405403
such as a bearer token.
@@ -419,10 +417,9 @@ If `multi` is given, one or more protocol
419417
* Protocol details for `webapp` MAY contain:
420418
* REQUIRED uri (string)
421419
An URI to a client-browsable view of the shared resource, such that
422-
users may use the web applications available at the site. The URI MAY
420+
users may use the web applications available at the site. The URI SHOULD
423421
be relative, in which case the prefix exposed by the `/.well-known/ocm`
424-
endpoint MUST be used, or it MAY be absolute. Similar considerations
425-
as for the `webdav.uri` field apply.
422+
endpoint MUST be used. Absolute URIs are deprecated.
426423
* REQUIRED viewMode (string)
427424
The permissions granted to the sharee. A subset of:
428425
- `view` allows access to the web app in view-only mode.
@@ -433,16 +430,15 @@ If `multi` is given, one or more protocol
433430
for example in the form of a bearer token.
434431
* Protocol details for `datatx` MAY contain:
435432
* REQUIRED srcUri (string)
436-
An URI to access the remote resource. The URI MAY be relative,
433+
An URI to access the remote resource. The URI SHOULD be relative,
437434
in which case the prefix exposed by the `/.well-known/ocm` endpoint MUST
438-
be used, or it MAY be absolute. Similar considerations as for the
439-
`webdav.uri` field apply.
435+
be used. Absolute URIs are deprecated.
440436
* OPTIONAL sharedSecret (string)
441437
An optional secret to be used to access the resource,
442438
for example in the form of a bearer token.
443439
To prevent leaking it in logs it MUST NOT appear in any URI.
444440
* OPTIONAL size (integer)
445-
The size of the file to be transferred from the sending server.
441+
The size of the file to be transferred from the sending server.
446442

447443
## Decision to Discard
448444
The Receiving Server MAY discard the notification if any of the following hold true:
@@ -493,7 +489,7 @@ They could give the Receiving Party the option to accept or reject the Share, or
493489

494490
# Resource Access
495491
To access the Resource, the Receiving Server MAY use multiple ways, depending on the body of the Share Creation Notification. The procedure is as follows:
496-
1. A root path `<sender-ocm-path>` MUST be obtained by querying the [Discovery](#ocm-api-discovery) endpoint at the Sending Server and getting `resourceTypes[0].protocols.webdav`.
492+
1. The receiver MUST extract the OCM Server FQDN from the `owner` field of the received share, and MUST query the [Discovery](#ocm-api-discovery) endpoint at that address: the `resourceTypes[0].protocols.webdav` value is the `<sender-ocm-path>` to be used in step 3.
497493
2. If `code` is not empty, the receiver SHOULD make a signed POST request to the `/token` path inside the Sending Server's OCM API, to exchange the code for a short-lived bearer token, and then use that bearer token to access the Resource.
498494
3. 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>:@<sender-host><sender-ocm-path>`. Note that this access method, based on Basic Auth, is _deprecated_ and may be removed in a future release of the Protocol.
499495
4. Otherwise, if `protocol.name` = `multi`, the receiver MUST inspect the `protocol.webdav.uri` property: if it's a complete URI, the receiver MUST make a HTTP PROPFIND request against it to access the remote resource. If it only contains an identifier `<key>`, the receiver MUST make a HTTP PROPFIND request to `https://<sender-host><sender-ocm-path>/<key>` in order to access the remote resource. Additionally, the receiver MUST pass an `Authorization: bearer` header with either the short-lived bearer token obtained in step 2, if applicable, or the `protocol.webdav.sharedSecret` value.

spec.yaml

+5-7
Original file line numberDiff line numberDiff line change
@@ -606,12 +606,10 @@ components:
606606
uri:
607607
type: string
608608
description: >
609-
An URI to access the remote resource. The URI MAY be relative,
609+
An URI to access the remote resource. The URI SHOULD be relative,
610610
such as a key or a UUID, in which case the prefix exposed by the
611-
`/.well-known/ocm` endpoint MUST be used to access the resource,
612-
or it MAY be absolute, including a hostname. The latter is
613-
recommended in case the receiver cannot unambiguously identify
614-
the sending server's endpoint (e.g. because of reverse proxies).
611+
`/.well-known/ocm` endpoint MUST be used to access the resource, or
612+
it MAY be absolute, including a hostname. The latter is deprecated.
615613
In all cases, for a `folder` resource, the composed URI acts
616614
as the root path, such that other files located within it SHOULD
617615
be accessible by appending their relative path to that URI.
@@ -666,7 +664,7 @@ components:
666664
description: >
667665
An URI to a client-browsable view of the remote resource, such that
668666
users may use a web application available at the sender site.
669-
The URI MAY be relative, such as a key or a UUID, in which case
667+
The URI SHOULD be relative, such as a key or a UUID, in which case
670668
the prefix exposed by the `/.well-known/ocm` endpoint MUST be used
671669
to access the resource, or it MAY be absolute, including a hostname.
672670
Similar considerations as for the `webdav` case apply here.
@@ -710,7 +708,7 @@ components:
710708
type: string
711709
description: >
712710
An URI to access the resource at the sending server. The URI
713-
MAY be relative, such as a key or a UUID, in which case the
711+
SHOULD be relative, such as a key or a UUID, in which case the
714712
prefix exposed by the `/.well-known/ocm` endpoint SHOULD be used
715713
to access the resource, or it MAY be absolute, including a
716714
hostname. Similar considerations as for the `webdav` case apply.

0 commit comments

Comments
 (0)