diff --git a/spec.yaml b/spec.yaml index 3b4920c8..2407b6f7 100644 --- a/spec.yaml +++ b/spec.yaml @@ -30,6 +30,20 @@ parameters: the HAL navigation links (e.g. `_links.next.href`) to paginate. These links enable the possibility to use vendor specific pagination. paths: + /ocm-provider: + get: + summary: Discovery endpoint + description: > + This endpoint returns a number of properties used to discover the capabilities + offered by a remote cloud storage. The endpoint is named `/ocm-provider` owing + to already established practices and constraints with the main cloud storages + that implement OCM (see https://github.com/cs3org/OCM-API/pull/37#issuecomment-435875108 + for more details). + responses: + "200": + description: The capabilities of this OCM service + schema: + $ref: "#/definitions/Discovery" /shares: post: summary: Create a new share @@ -218,6 +232,96 @@ definitions: (e.g. no use of special characters) providing more information on the cause of the error. example: RESOURCE_NOT_FOUND + Discovery: + type: object + required: + - enabled + - apiVersion + - endPoint + - resourceTypes + properties: + enabled: + type: boolean + description: Whether the OCM service is enabled at this endpoint + apiVersion: + type: string + description: The OCM API version this endpoint supports + example: 1.0.0 + endPoint: + type: string + description: The URI of the OCM API available at this endpoint + example: https://my-cloud-storage.org/ocm + provider: + type: string + description: A friendly branding name of this endpoint + example: MyCloudStorage + resourceTypes: + type: array + description: | + A list of all supported resource types with their access protocols. + Each resource type is identified by its `name`: the list MUST NOT + contain more than one resource type object per given `name`. + items: + type: object + properties: + name: + type: string + description: | + A supported resource type (file, folder, calendar, contact, ...). + Implementations MUST support `file` at a minimum. + example: file + shareTypes: + type: array + description: | + The supported recipient share types. + Implementations MUST support `user` at a minimum. + items: + type: string + enum: ["user", "group", "federation"] + example: ["user"] + protocols: + type: object + description: | + The supported protocols to access shares at this endpoint. + Implementations MUST support `webdav` at a minimum. + properties: + webdav: + type: string + description: | + The top-level WebDAV endpoint full URI. In order to access + a remote shared resource, implementations MAY use this + URI as a prefix: e.g. if in a new share request's payload + a `protocol.options.sharedSecret` property is defined + (see singleProtocolLegacy example), implementations MAY + need to append it to this URI to access the resource. + example: https://my-cloud-storage.org/remote.php/dav/ocm + webapp: + type: string + description: | + The top-level endpoint full URI for web apps. This value + is provided for documentation purposes, and it SHALL NOT + be intended as a prefix for share requests. + example: https://my-cloud-storage.org/external/ocm + datatx: + type: string + description: | + The top-level endpoint full URI for data transfers. This + value is provided for documentation purposes, and it SHALL + NOT be intended as a prefix. In addition, implementations + are expected to execute the transfer using WebDAV as + the wire protocol. + example: https://my-cloud-storage.org/remote.php/dav/ocm + capabilities: + type: array + description: | + The optional capabilities exposed at this endpoint according to the present + specifications. As implementations MUST provide `/shares` to be compliant, + it is not necessary to expose it as a capability. + items: + type: string + enum: ["/notifications", "/invite-accepted"] + example: + ["/invite-accepted"] NewShare: type: object required: