Skip to content

OCS v2.draft1: provider service list #21180

Closed

Description

@martin-rueegg

remark: this issue is regarding the regarding the OCS v2 draft 1 specification. please refer to OCS v2.draft1 comments overview for further information.

the provider service list (PSL)

versioning

the OCS specification states that "Providers MAY remove the endpoint but SHALL NOT make an existing endpoint incompatible," yet there is no foreseen way, how to achieve this for the PSL itself, as the location is "hard-coded" to be at /ocs-provider/ of the root of the instance and the version is only mentioned within the file, but not as a container, which would allow multiple versions within one file.

  • one solution to this "problem" is by implementing an alternate service discovery as described in OCS v2.draft1: alternative service discovery #21177.
  • a second solution would be by encapsulating all information within different version objects, so that multiple representation of the information can co-exist in one file/response.
  • a third approach would be to announce the "versioned PSL" within the existing "root PSL v1". this could be implemented maintaining backwards compatibility (and as such adhering to the already-in-use spec) and complement the alternate service discovery. this approach shall be laid out hereafter.

new top element location

a newly introduced element location could announce where the respective version of a PSL can be found. this would only require, that the current draft (and future specs) needs to be updated in the sense, that unknown elements MUST be silently ignored.

the services element is only given, if version 2-style information about the services is actually still provided.

so the extended version 2 would look something like the following:

{
    "version": 2,
    "location": {
        // version 1 is obviously deprecated
        // version 2 is this file, so only versions as v3 can be announced here

        // PSL relative to the location of this file
        3: "v3",
            //-> .../ocs-provider/v3

        // PSL relative to the root of the webserver
        4: "/different/path/to/PSL/v4",

        // PSL on the same host, but different port
        5: "4343:/different/path/to/PSL/v5",

        // PSL on an entirely different host
        6: "https://ocs.mycloud.com[:port]/PSL/v6",
    },
    "services": {
        (...)
    }
}

format selection

currently the format (JSON vs. XML) is selected by using the GET query string format={format}. the format variable is not mandatory and no default format is specified. either of this should be done in the specification.

a more HTTP-like way of format selection would be the use of the http Accept header, which MUST be either

  • application/xml
  • application/json
    a missing header would lead to select the defined default format (e.g. JSON). any other value would lead to a 400/4xxx (see OCS v2.draft1: status codes #21175) error reply, also using the default format.

webdav or XRD style PSL

has there been a discussion of whether to use an already established resource description format? as the consumer needs to be webdav capable once it accesses the resource, the webdav PROPFIND method could basically be used to get information about the available services.

an other way to locate services is XRD which is used for Web Host Metadata in /.well-known/host-meta. a similar approach to host-meta and host-meta.json could be chosen, which would make the locator even compatible with RFC 6415 and might be included in [/.well-known/host-meta].

enhanced service information

it might well be possible, that future service (implementations) need to advert their capabilities, similar to reply of the EHLO command in ESMTP. for example, the FEDERATED_SHARING can - in the OwnCloud implementation - offer shares and/or accept shares. if it only accept shares, the webdav url is of no need and does not necessarily be advertised. or the service might implement something like "live-updates" which would mean, that the sharing site will automatically send updates to the receiving site if a file on the share has been created, modified, or deleted. such further capabilities might also be provided by add-ons or extensions to this specification. therefore it would be wise to implement some sort of capability advertising facility.

the following suggestion is displayed in JSON but could be implemented in any defined format, of course:

service description variant a: version as identifier

{
    "version": 3,
    "services": {
        "FEDERATED_SHARING": {
            "capabilities": {
                "share": {
                    // share implementation version
                    2, {
                        "endpoint": "/ocs/v2.php/cloud/shares",
                        "spec": "http://www.open-collaboration-services.org/ocs/ocs2-draft1.html#federated_sharing"
                    }
                    3, {
                        "endpoint": "/ocs/v3.php/cloud/shares",
                        "spec": "http://www.open-collaboration-services.org/ocs/ocs3.html#federated_sharing"
                        "extensions": {
                            "mailmap": {
                                "version": 1,
                                "spec": "http://www.open-collaboration-services.org/ocs/mailmap1.html"
                            },
                            "addon-x": {
                                "spec": "http://www.example.org/addon-x/3.html"
                            }
                        }
                    }
                },
                "webdav": {
                    1, {
                        "endpoint": "/public.php/webdav/",
                        "spec": "http://tools.ietf.org/html/rfc4918"
                    }
                },
                "mailmap": {
                    1, {
                        "endpoint": "/ocs/v3.php/cloud/mailmap",
                        "spec": "http://www.open-collaboration-services.org/ocs/ocs3.html#federated_sharing-mailmap"
                    }
                }
            }
        }
    }
}

service description variant b: version as property

{
    "version": 3,
    "services": {
        "FEDERATED_SHARING": {
            "capabilities": {
                "share": {[
                    // share implementation version
                    {
                        "version": 2, // mandatory if more than one version is provided
                        "endpoint": "/ocs/v2.php/cloud/shares",
                        "spec": "http://www.open-collaboration-services.org/ocs/ocs2-draft1.html#federated_sharing"
                    },
                    {
                        "version": 3, // mandatory if more than one version is provided
                        "endpoint": "/ocs/v3.php/cloud/shares",
                        "spec": "http://www.open-collaboration-services.org/ocs/ocs3.html#federated_sharing"
                        "extensions": {
                            "mailmap": {
                                "version": 1,
                                "spec": "http://www.open-collaboration-services.org/ocs/mailmap1.html"
                            },
                            "addon-x": {
                                "spec": "http://www.example.org/addon-x/3.html"
                            }
                        }
                    }
                ]},
                "webdav": {[
                    {
                        // "version" is left out, as only one array element is given
                        "endpoint": "/public.php/webdav/",
                        "spec": "http://tools.ietf.org/html/rfc4918"
                    }
                ]}
            }
        }
    }
}

Activity

  1. LukasReschke commented on Mar 1, 2016

    @LukasReschke
    Contributor

    Subscribing myself here.

  2. DeepDiver1975 commented on Jan 27, 2017

    @DeepDiver1975
    Contributor
  3. lock commented on Aug 3, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions