Skip to content

Commit b6f781e

Browse files
committed
Support multiple app names/media types in a webapp share
1 parent 6ae48ad commit b6f781e

2 files changed

Lines changed: 96 additions & 32 deletions

File tree

‎IETF-OCM.md‎

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,23 +1235,57 @@ described in [OCM-IP].
12351235
token in a form field named `access_token` (see
12361236
[Resource Access](#resource-access)). The shared secret MUST NOT
12371237
be exposed to the browser and MUST NOT appear in any URI.
1238-
- OPTIONAL appName (string)
1239-
A human-friendly name of the web application, to be used in user
1240-
interfaces when referring to this Share.
1238+
- OPTIONAL apps (array of objects)
1239+
The web applications available at the Sending Server to access
1240+
the Shared Resource. This is useful in particular when the
1241+
Resource is a folder, whose files can be opened by different web
1242+
applications depending on their format. If present, the array
1243+
MUST NOT be empty and MUST NOT contain more than one entry per
1244+
given `name`. Each entry contains:
1245+
- REQUIRED name (string) - A human-friendly name of the web
1246+
application, to be used in user interfaces when referring to
1247+
this Share.
1248+
- REQUIRED mediaTypes (array of strings) - The media types (MIME
1249+
types) that this web application can handle. The array MUST
1250+
NOT be empty. This can be any media type entries from the IANA
1251+
Media Type registry. The receiver MAY use this as a hint for UI
1252+
or routing decisions, e.g. to show which web application opens
1253+
a given file, and MAY ignore values it does not understand.
1254+
Unlike `appIconHint`, this describes formats the web
1255+
application can open rather than the share-level icon hint.
1256+
[RFC6838]
1257+
1258+
The order of the entries MAY be used by the Sending Server to
1259+
express a preference: when multiple web applications can handle
1260+
the same media type, the receiver SHOULD consider the first
1261+
matching entry as the default one. All web applications listed
1262+
are accessed through the same `uri`, `sharedSecret`, `targets`,
1263+
`permissions` and `requirements`. Example:
1264+
1265+
~~~
1266+
"apps": [
1267+
{
1268+
"name": "HedgeDoc",
1269+
"mediaTypes": ["text/markdown", "text/html"]
1270+
},
1271+
{
1272+
"name": "Collabora",
1273+
"mediaTypes": [
1274+
"application/vnd.oasis.opendocument.text",
1275+
"application/vnd.oasis.opendocument.spreadsheet"
1276+
]
1277+
}
1278+
]
1279+
~~~
1280+
{: type="json"}
12411281
- OPTIONAL appIconHint (string)
12421282
A string in the form of a media type (MIME type) that describes the
12431283
share as a whole, primarily intended as a way for the receiving
12441284
server to select an appropriate local icon for the share. This is
12451285
display metadata and MUST NOT be interpreted as fetchable or
1246-
executable content. It does not need to appear in `mediaTypes`, but
1247-
SHOULD describe the primary shared resource. [RFC6838]
1248-
- OPTIONAL mediaTypes (array of strings)
1249-
An array of media types (MIME types) the webapp server can handle.
1250-
This can be any media type entries from the IANA Media Type
1251-
registry. The receiver MAY use this as a hint for UI or routing
1252-
decisions, and MAY ignore values it does not understand. Unlike
1253-
`appIconHint`, this describes formats the webapp can open rather
1254-
than the share-level icon hint. [RFC6838]
1286+
executable content. It does not need to appear in any of the
1287+
`apps` media types, but SHOULD describe the primary shared
1288+
resource. [RFC6838]
12551289
* Protocol details for `ssh` MAY contain:
12561290
- OPTIONAL accessTypes (array of strings) - The type of access
12571291
being granted to the remote resource. If omitted, it defaults to
@@ -2868,6 +2902,11 @@ version in the IETF datatracker. It is meant to ease the review
28682902
process and it shall be removed when going to RFC last call.
28692903
The complete changelog is updated in the OCM-API GitHub repository.
28702904

2905+
## Version 08
2906+
* Introduced an `apps` array in the `webapp` protocol payload, listing
2907+
the available web applications each with the media types it can
2908+
handle. It replaces the `appName` and `mediaTypes` properties.
2909+
28712910
## Version 07
28722911
* Required the `keyid` signature parameter and that it matches the
28732912
`kid` of the verification key in the signer's JWK Set.

‎spec.yaml‎

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -848,25 +848,45 @@ components:
848848
describes the share as a whole, primarily intended as a way for
849849
the receiving server to select an appropriate local icon for the
850850
share. This is display metadata and MUST NOT be interpreted as
851-
fetchable or executable content. It does not need to appear in
852-
`mediaTypes`, but SHOULD describe the primary shared resource.
853-
appName:
854-
type: string
855-
description: >
856-
An optional human-friendly name of the web application to be used
857-
in user interfaces when referring to this share.
858-
mediaTypes:
851+
fetchable or executable content. It does not need to appear in any
852+
of the `apps` media types, but SHOULD describe the primary shared
853+
resource.
854+
apps:
859855
type: array
860-
description: >
861-
An optional array that describes the media (MIME) types that the
862-
webapp server can handle. This is a hint for receiver UI and
863-
routing decisions, and receivers MAY ignore values they do not
864-
understand. Unlike `appIconHint`, this describes formats the
865-
webapp can open rather than the share-level icon hint.
866856
minItems: 1
867-
uniqueItems: true
857+
description: >
858+
An optional array of the web applications available at the
859+
Sending Server to access the shared resource, useful in particular
860+
when the resource is a folder whose files can be opened by different
861+
web applications. The array MUST NOT contain more than one entry per
862+
given `name`. The order of the entries MAY express a preference:
863+
when multiple web applications can handle the same media type, the
864+
receiver SHOULD consider the first matching entry as the default one.
865+
All listed web applications are accessed through the same `uri`,
866+
`sharedSecret`, `targets`, `permissions` and `requirements`.
868867
items:
869-
type: string
868+
type: object
869+
required:
870+
- name
871+
- mediaTypes
872+
properties:
873+
name:
874+
type: string
875+
description: >
876+
A human-friendly name of the web application to be used
877+
in user interfaces when referring to this share.
878+
mediaTypes:
879+
type: array
880+
minItems: 1
881+
uniqueItems: true
882+
description: >
883+
The media (MIME) types that this web application can handle.
884+
This is a hint for receiver UI and routing decisions, and
885+
receivers MAY ignore values they do not understand.
886+
Unlike `appIconHint`, this describes formats the web
887+
application can open rather than the share-level icon hint.
888+
items:
889+
type: string
870890
ssh:
871891
type: object
872892
properties:
@@ -933,11 +953,16 @@ components:
933953
requirements:
934954
- must-use-mfa
935955
- must-exchange-token
936-
appName: HedgeDoc
937956
appIconHint: text/markdown
938-
mediaTypes:
939-
- text/markdown
940-
- text/html
957+
apps:
958+
- name: HedgeDoc
959+
mediaTypes:
960+
- text/markdown
961+
- text/html
962+
- name: Collabora
963+
mediaTypes:
964+
- application/vnd.oasis.opendocument.text
965+
- application/vnd.oasis.opendocument.spreadsheet
941966
ssh:
942967
accessTypes: ["datatx"]
943968
uri: extuser@cloud.example.org:/7c084226-d9a1-11e6-bf26-cec0c932ce01

0 commit comments

Comments
 (0)