Namespaces
A namespace is a set of paths with a common prefix. Depending on the endpoint you are talking to you will encounter a different kind of namespace: In ownCloud Classic all paths are considered relative to the users home. The CS3 API uses a global namespace and the storage providers use a local namespace with paths relative to the storage providers root.
The different paths in the namespaces need to be translated while passing references from service to service. While the oc10 endpoints all work on paths we internally reference shared resources by id, so the shares don’t break when a file is renamed or moved inside a storage space. The following table lists the various namespaces, paths and id based references:
| oc10 namespace | CS3 global namespace | storage provider | reference | content |
|---|---|---|---|---|
|
|
home |
|
currently logged in users home |
|
|
users |
id based access |
all users, used to access collaborative shares |
|
|
public |
id based access |
publicly shared files, used to access public links |
|
oCIS currently is configured to jail users into the CS3 |
|
In the global CS3 namespaces we plan to move |
ownCloud Namespaces
In contrast to the global namespace of CS3, ownCloud always presented a user specific namespace on all endpoints. It will always list the users private files under /. Shares can be mounted at an arbitrary location in the users private spaces. See the webdav and ocs sections for more details end examples.
With the spaces concept we are planning to introduce a global namespace to the ownCloud webdav endpoints. This will push the users private space down in the hierarchy: it will move from /webdav to /webdav/home or /webdav/users/<username>.
CS3 Global Namespaces
The CS3 global namespace in oCIS is configured in the storage spaces registry. oCIS uses these defaults:
| global namespace | description |
|---|---|
|
an alias for the currently logged in uses private space |
|
user private spaces |
|
a virtual listing of share spaces a user has access to |
|
a virtual folder listing public shares |
|
TODO: project or group spaces |
Technically, the /home namespace is not necessary: the storage spaces registry knows the path to a users private space in the /users namespace and the gateway can forward the requests to the responsible storage provider.
|
*@jfd: Why don’t we use |
The /shares namespace is used to solve two problems:
-
To query all shares the current user has access to the share manager can be used to list the resource ids. While the shares can then be navigated by resource id, they will return the relative path in the actual storage provider, leaking parent folders of the shared resource.
-
When accepting a remote share e.g., for OCM the resource does not exist on the local instance. They are made accessible in the global namespace under the
/sharesnamespace.
|
@jfd: Should we split |
Browser URLs vs API URLs
In ownCloud Classic you can not only create public links but also private links. Both can be copy pasted into an email or chat to grant others access to a file. Most often though, end users will copy and paste the URL from their browsers location bar.
| URL | description |
|---|---|
https://demo.owncloud.com/apps/files/?dir=/Photos/Vacation&fileid=24 |
The normal browser URL |
https://demo.owncloud.com/apps/files/?fileid=24 |
the |
https://demo.owncloud.com/f/24 |
private links are the shortened version of this and work in the same way |
https://demo.owncloud.com/s/piLdAAt1m3Bg0Fk |
public link |
|
The
(Depending on the order in which they accept the shares) X and Y now have two folders You could argue that the path should always use a global path in the CS3 namespace:
By using a global path like this X and Y would always end up in the correct folder. However, there are two caveats:
That is the reason why URLs always have to contain some kind of stable identifier. By introducing the concept of storage spaces and treating user homes, project drives and shares we can create a URL that contains an identifier for the storage space and a path relative to the root of it. |
In ocis we will unify the way links sharing works, however there will always be at least two types of URLs:
-
The URL you see in the browsers location bar, and
-
The URL that a client uses to actually access a file.