Skip to content

Commit 696709d

Browse files
committed
Simplified token exchange and related requirements
1 parent 5432b8b commit 696709d

File tree

2 files changed

+27
-40
lines changed

2 files changed

+27
-40
lines changed

IETF-RFC.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -660,20 +660,19 @@ contain the following information about its OCM API:
660660
Share Creation Notification.
661661
As all Receiving Servers SHOULD require the use of TLS in API
662662
calls, it is not necessary to expose that as a criterium.
663-
Example: `["http-request-signatures", "code"]`. The array MAY
664-
include for instance:
663+
Example: `["http-request-signatures"]`. The array MAY include
664+
for instance:
665665
_ `"http-request-signatures"` - to indicate that API requests
666666
without http signatures will be rejected.
667-
_ `"code"` - to indicate that API requests without code will be
668-
rejected (i.e. the `sharedSecret` in the protocol details will be
669-
ignored).
667+
_ `"token-exchange"` - to indicate that API requests without
668+
token exchange will be rejected (see the [Code Flow](#code-flow)
669+
section).
670670
_ `"denylist"` - some servers MAY be blocked based on their IP
671671
address
672672
_ `"allowlist"` - unknown servers MAY be blocked based on their IP
673673
address \* `"invite"` - an invite MUST have been exchanged between the
674674
sender and the receiver before a Share Creation Notification can be
675675
sent
676-
677676
* OPTIONAL: publicKey (object) - The signatory used to sign outgoing
678677
request to confirm its origin.
679678
The signatory is optional, but if present, it MUST contain
@@ -770,9 +769,6 @@ To create a Share, the Sending Server SHOULD make a HTTP POST request
770769
The expiration time for the OCM share, in seconds
771770
of UTC time since Unix epoch. If omitted, it is assumed
772771
that the share does not expire.
773-
* OPTIONAL code (string)
774-
A nonce to be exchanged for a (potentially short-lived)
775-
bearer token at the Sending Server's tokenEndPoint [RFC6749]
776772
* REQUIRED protocol (object)
777773
JSON object with specific options for each protocol.
778774
The supported protocols are: - `webdav`, to access the data -
@@ -817,12 +813,10 @@ servers MAY only support `webdav`.
817813
SHOULD be relative, in which case the prefix
818814
exposed by the `/.well-known/ocm` endpoint MUST
819815
be used. Absolute URIs are deprecated.
820-
- OPTIONAL sharedSecret (string) - REQUIRED if no `code` field is
821-
given for the Share as a whole (see above). An
822-
optional secret to be used to access the Resource,
823-
such as a bearer token.
824-
To prevent leaking it in logs it MUST NOT appear in
825-
any URI.
816+
- REQUIRED sharedSecret (string)
817+
A secret to be used to access the Resource, such as
818+
a bearer token. To prevent leaking it in logs it
819+
MUST NOT appear in any URI.
826820
- OPTIONAL permissions (array of strings) -
827821
The permissions granted to the sharee. A subset
828822
of: - `read` allows read-only access including
@@ -831,12 +825,13 @@ servers MAY only support `webdav`.
831825
Resource.
832826
- OPTIONAL requirements (array of strings) -
833827
The requirements that the sharee MUST fulfill to
834-
access the Resource. A subset of: - `mfa-enforced` requires the
828+
access the Resource. A subset of: - `must-use-mfa` requires the
835829
consumer to be MFA-authenticated. This MAY be used if the
836830
recipient provider exposes the `enforce-mfa`
837-
capability. - `use-code` requires the consumer to exchange
838-
the given `code` via a signed HTTPS request. This
839-
MAY be used if the recipient provider exposes the
831+
capability. - `must-exchange-token` requires the recipient to
832+
exchange the given `sharedSecret` via a signed HTTPS request
833+
to the Sending Server's {tokenEndPoint} [RFC6749].
834+
This MAY be used if the recipient provider exposes the
840835
`receive-code` capability.
841836
* Protocol details for `webapp` MAY contain:
842837
- REQUIRED uri (string)

spec.yaml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ paths:
1818
get:
1919
summary: Discovery endpoint
2020
description: >
21-
Following RFC 8615, this endpoint returns the properties and
21+
Following [RFC8615], this endpoint returns the properties and
2222
capabilities offered by an OCM Server. This endpoint MUST be
2323
served at the OCM Server's root FQDN, e.g. as in
2424
`https://my-cloud-storage.org/.well-known/ocm`. See [OCM API Discovery](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#ocm-api-discovery)
@@ -108,9 +108,9 @@ paths:
108108
Retry-After:
109109
description: >
110110
Indication for the client when the service could be requested
111-
again in HTTP Date format as used by the Internet Message
111+
again in HTTP Date format as used by the Internet Message
112112
Format [RFC5322] (e.g. `Wed, 21 Oct 2015 07:28:00 GMT`) or the
113-
number of seconds (e.g. 3000 if you the service is expected to
113+
number of seconds (e.g. 3000 if you the service is expected to
114114
be available again within 50 minutes).
115115
schema:
116116
type: string
@@ -438,7 +438,7 @@ components:
438438
type: string
439439
enum:
440440
- http-request-signatures
441-
- code
441+
- token-exchange
442442
- denylist
443443
- allowlist
444444
- invite
@@ -557,11 +557,6 @@ components:
557557
description: >
558558
The expiration time for the share, in seconds of UTC time since
559559
Unix epoch. If omitted, it is assumed that the share does not expire.
560-
code:
561-
type: string
562-
description: |
563-
A nonce to be exchanged for a (potentially short-lived) bearer token
564-
at the Sending Server's {tokenEndPoint}.
565560
protocol:
566561
type: object
567562
description: |
@@ -611,11 +606,8 @@ components:
611606
sharedSecret:
612607
type: string
613608
description: >
614-
An optional secret to be used to access the resource, such
615-
as a bearer token. If a `code` is provided, it SHOULD be used
616-
instead via the code flow interaction, and the `sharedSecret`
617-
SHOULD be omitted. To prevent leaking it in logs it MUST NOT
618-
appear in any URI.
609+
A secret to be used to access the resource, such as a bearer token.
610+
To prevent leaking it in logs it MUST NOT appear in any URI.
619611
permissions:
620612
type: array
621613
items:
@@ -640,17 +632,17 @@ components:
640632
present it MUST NOT be empty. A recipient provider MUST reject
641633
a share whose requirements it does not understand.
642634
The following requirements are currently supported:
643-
- `mfa-enforced` requires the user accessing the resource to be
635+
- `must-use-mfa` requires the user accessing the resource to be
644636
MFA-authenticated. This requirement MAY be used if the
645637
recipient provider exposes the `enforce-mfa` capability.
646-
- `use-code` requires the recipient to exchange the given
647-
`code` via a signed HTTPS request to {tokenEndPoint} at the
638+
- `must-exchange-token` requires the recipient to exchange the given
639+
`sharedSecret` via a signed HTTPS request to tokenEndPoint at the
648640
Sending Server, in order to get a short-lived token to be used
649-
for subsequent access. This requirement MAY be used if the
650-
recipient provider exposes the `receive-code` capability.
641+
for subsequent access [RFC6749]. This requirement MAY be used if
642+
the recipient provider exposes the `receive-code` capability.
651643
enum:
652-
- mfa-enforced
653-
- use-code
644+
- must-use-mfa
645+
- must-exchange-token
654646
webapp:
655647
type: object
656648
properties:

0 commit comments

Comments
 (0)