Repository navigation
Closed
Labels
Description
hi @karlitschek
as suggested, i opened an issue with my comments regarding your OCS v2 draft 1 specification (as retrieved on 12.12.2015).
hoping that this will help keeping the overview while discussing the draft, i will spilt the issue into several sub-issues. this issue here shall be an umbrella issue and host the general discussion. references to and from the sub-issues are welcome and suggested. this first post shall be updated to reference the sub-issues, if possible.
following the outline of the document with the associated sub-issues:
- Abstract
- Notational Conventions
- Terminology
- OCS v2.draft1: text errata #21174: text errata
- Security Considerations
- Authentication
- Transmission layer
- Secrets
- Performance / Scalability
- Cookies
- HTTP Basic Authentication
- Formats / Encoding
- Encoding
- Date and time format
- Output format / OCS Format
- Reserved status codes
- OCS v2.draft1: status codes #21175: status codes
- Reserved status codes
- Service Discovery / Provider service list
- OCS v2.draft1: alternative service discovery #21177: alternative service discovery
- OCS v2.draft1: provider service list #21180: provider service list
- Cross-Origin communication
- Versioning
- Modules
- FEDERATED_SHARING
- OCS v2.draft1: FEDERATED_SHARING service #21185: FEDERATED_SHARING service
- Sending a share offer to other providers
- Accept a share
- Reject a share
- Unshare a file
- Accessing shared files
- PRIVATE_DATA
- Set value
- Get all values of store
- Get value of a key in a store
- Delete a key-value entry
- SHARING
- Get a list of shares
- Get a list of shares from a specific file or folder
- Get information about a specific share
- Create a new share
- Delete an existing share
- Update an existing share
- PROVISIONING
- Create user
- Get users
- Get a user
- Edit user attributes
- Delete user
- Get group memberships
- Add user to group
- Remove user from group
- Promote user to subadmin of group
- Remove subadmin privileges of user
- Get subadmin privileges of user
- Get groups on the server
- Create a new group
- Get members of a group
- Get subadmins of a group
- Delete a group
- Get list of installed apps
- Get application information
- Enable application
- Disable application
- ACTIVITY
- Request
- Response
- FEDERATED_SHARING
the next post will include my original mail for reference.
looking forward for future discussion.
thanks,
martin.
Activity
martin-rueegg commentedon Dec 13, 2015
On Dec 12, 2015, at 17:07, metaworx - Martin Rüegg wrote:
hi frank
i had the idea of implementing some oc2oc replication in order to keep two sites (partially) in sync. i did not find out, if federated sharing is actually doing that already, but i assume it is more an relayed access. so as soon as that share is unshared, the files are no longer available in the receiving site.
anyway, i came across your ocs draft and wanted to make some comments. if i should direct this mail to a mailing list or an issue tracker, please let me know. and: it became quite a long mail. hope you don't mind!
in the following, i'm refering to the OCS v2 draft v1
http://www.open-collaboration-services.org/ocs/ocs2-draft1.html (retrieved as of today)
the first question is regarding the
federation id
it is created as
user@server/url. is the https default port (443) considered to be standard (and as such left away) and if an other port is used it will be added likeuser@server[:port]/url?as the user can include the
@character itself, i guess the last@is considered to be the user/server separator. so hopefully no one attempts to have a@in their base url ... :-)Service Discovery / Provider service list
given the fact, that this resource is available at
https://server[:port][/root-url]/ocs-provider/and the share endpoints in the OC implementation are located athttps://server[:port][/root-url]/ocs/...the "Relative IRI to the endpoint" is intended to be relative to theroot-url/, not theroot-url/ocs-provider/url. this should be stated explicitly in the documentation.the endpoints should also be able to include absolute paths, in case that the service is implemented on an other web server than the main resource (e.g.
https://demo.owncloud.org/ocs-provider/buthttps://ocs.owncloud.org/v2.php/cloud/shares).in case the server does not support federated sharing (i.e. disabled by administrator), then the /ocs-provider/ MUST NOT include the service, or an additional parameter "status" should be included, which could have
200for available501for not implemented503for temporary unavailablein case of
501the endpoints parameter MUST NOT be provided.furthermore the
webdavparameter should be OPTIONAL, depending of weather or not outgoing shares are available, i.e. if the admin only allows incoming shares, thewebdavinterface is not required.in the section Accessing shared files, the
webdavresource is calledaccess. this is ambiguous.Reserved status codes
generally in the documentation there is the use of
OCS success message. this should be changed to readOCS response message, which is the minimum response and MUST include the ocs/meta element and MAY include the ocs/data element.it should also be made clear, when the documentation intends an http status code, and when a OCS status code. best might be if always both codes are given, eg.
200/200(where the first represents the http, the second the OCS status codei suggest, that globally
301/-)301status code,307/-)307status code,400/-)400error400error needs to be sent by the script203/XXX)203MUST be used,403MUST be used404seems more intuitive, but rfc2616 states: "This status code is commonly used when the server does not wish to reveal exactly why the request has been refused (...).")501MUST be used401/XXX?)401MUST be sent as http status code,401OCS response MAY be included (not sure if http standard allows that for a401response)403PRIVATE_DATA, see above),404will be sent by the webserver, if the resource is not available. this would include, if a service/module is not implemented, as there are no defined well-known URIs except the/ocs-provider/410SHOULD be sent, if a share has been unshared or rejected.(this implies, that re-sharing the same resource would require a newremoteId.)503SHOULD be sent eg. in maintenance mode, an OCS response MAY be included (eg. with the announcement, see https://apps.owncloud.com/content/show.php/Announcement+Center?content=173921)this seems all very complicated. but it makes it more consistent for the client, e.g. in the case a resource is accessed which is not actually an OCS resource or the webserver generates the error before processing the script.
maybe the above rules need a revision, it would be easier to create a table with the conditions and both the http and OCS status codes.
Output format / OCS Format
the term 'customer' instead of 'consumer' is used.
the default format should be defined for the case, where the format parameter is missing. or the format parameter should be mandatory and result in a malformed request if missing.
alternatively to the GET parameter, the http
Acceptheader could be set to eitherapplication/xmlorapplication/json?the ocs/data is defined as mandatory. i suggest to define it optional (MAY).
FEDERATED_SHARING
if i understand it correctly, the sharing/sending site is creating the
{remoteId}. so in theory, two independent instances can create the same{remoteId}for a resource, as it is not specified that it needs to include the server[:port]/url part of the federation id. as a result, the actual share can only be identified by the{remoteId}/{token}combination.this is fine for the accept/reject actions. but the url structure for the
unsharerequest is not unique in that sense! if site B and C are sharing the resource with{remoteId}8 to site A, the requestcould be issued by site B or C. an exact identification is not possible, however (yes, the host and port might be identified through connection parameters, but the instance
root-urlnot). now given the fact, that by any chance the{token}would also be the same (ok, is unlikely), the receiving site has a problem. also, if the{token}is not valid for any of the resources with{remoteId}8.there should be noted, that
500http error codes MAY be acceptable as defined at reserved status codes. actually, i would suggest that they SHOULD or MUST be acceptable.of course, any future request to the now unshared resource will fail, yet the configuration on site A will be inconsistent. so i would suggest that the sending site SHOULD repeat the unshare request after every future attempt to access the share (which MUST be replied by http
410) until a200success response is received. or the http410code MAY be interpreted as aunsharerequest.internal server error should send a http
500with OCS500for debugging info.if federation is disabled, either http 404 MUST be returned. (the resource should not be given by the service list in the first place. see above.)
same applies for the responses to the other requests.
furthermore i suggest, that the
unsharerequest also MUST include the{remote}IRI parameter of the originalsharerequest. or the URL structure should include that, to remain RESTful:example.org/{share}/{remote}/{remoteId}/declinenext an
updaterequest should probably be introduced atexample.org/{share}/{remote}/{remoteId}/updatein order to change, eg.
{token}(for security reasons it makes sense to update the token once in a while, or at least, if the token has been compromised){remote}IRI. (due to server migration, domain-name change, url-change)owner(in case the username on the sending server get's updated)the request should include the (old)
{token}and the new paramter.responses should be treated equally as with the
unsharerequests (repeated until success, probably in regular intervals in case of a{remote}IRI change.)alternatively to the
updaterequest, a mandatoryPRIVATE_DATAstore could be defined, using{remote}as HTTP-Auth username and the{token}as password (or both somehow mangled into the password to avoid name conflicts with existing users, even this is quite unlikely). the store MUST be located atexample.org/{store}/{remoteId}/and MUST support the keys{token}{remote}{owner}{shareWith}which
{shareWith}) MUST be read-only.other keys MUST be allowed and MUST begin with
X-orx-(to avoid naming conflicts with future reserved keys), but SHOULD only be accepted once the share has been accepted by the user.if
{storeName}is optional in thePRIVATE_DATAdefinition, then it could also be defined, that the missing storeName ("") only allows keys defined by the standard, while user-defined values MUST using an arbitrary{storeName}. In that case, thex-prefix would not be required. alternatively an other fix definedstoreNamecould be used, e.g.share-metadata.PRIVATE_DATA
see also notes above regarding the mandatory store for shares.
same remark as for
FEDERATED_SHARINGrequests regarding500responses should be added.status codes of the ocs response messages should be defined, eg.
200/200OK403/1100store not found403/1200key not found403/1201key not allowed (for store)403/1202key read-only (for store and delete)why is the store in the response called
appand notstore? this is inconsistent. furthermore i'd like to ask why is store not surrounding the element? e.g.datastorename: blaelementkey: foovalue: barelementkey: foo2value: barGet all values of store
URL structure must not include
/{key}.while it should be added to the "Get value of a key in a store" section instead.
ok, i will not go into Sharing, Provisioning, and Activity for now. maybe later, if appreciated.
thanks,
martin.
LukasReschke commentedon Mar 1, 2016
Subscribing myself here.
DeepDiver1975 commentedon Jan 27, 2017
To some extend the API specification is continued here: https://github.com/GEANT/OCM-API
lock commentedon Aug 3, 2019
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.