[full-ci] add driveAlias to the graphAPI #3283
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implements owncloud/libre-graph-api#6
Needs cs3org/reva#2623
The concept is described in the ADR https://owncloud.dev/ocis/adr/0011-global-url-format/#mixed-global-urls in the section
mixed global urls
.Related Issue
Motivation and Context
Space identifier
The primary identifier for a space is always the UUID. A unique logical ID is the only stable indentifier that works under all circumstances
A technical URL with a stable identifier
https://cloud.owncloud.com/files/spaces/95b4c6f6-d8f2-4976-b0a3-1b016bdfcb7e/relative/path/to/file.txt
.Make it more user friendly
To make the URL human-readable we replace the UUID with an alias.
https://cloud.owncloud.com/files/spaces/personal/einstein/relative/path/to/file.txt
The WebUI discovers the spaces using the
/drives
Endpoint. It should return a space with the aliaspersonal/einstein
and theid:95b4c6f6-d8f2-4976-b0a3-1b016bdfcb7e
. This aliasing allows the WebUI to use human-readable URLs and translate the alias back into a UUID which is then used to make the actual WebDAV Requests.The problem with aliases is, that they are not unique, can be customized and might clash. Therefore the UUID is always appended as an URL Parameter
?id=95b4c6f6-d8f2-4976-b0a3-1b016bdfcb7e
Stable and user friendlyURL
https://cloud.owncloud.com/files/spaces/personal/einstein/relative/path/to/file.txt?id=95b4c6f6-d8f2-4976-b0a3-1b016bdfcb7e
New Config Options
STORAGE_USERS_DRIVER_S3NG_PERSONAL_SPACE_ALIAS_TEMPLATE
{{.SpaceType}}/{{.User.Username | lower}}
STORAGE_USERS_DRIVER_S3NG_GENERAL_SPACE_ALIAS_TEMPLATE
{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}
STORAGE_USERS_DRIVER_OCIS_PERSONAL_SPACE_ALIAS_TEMPLATE
{{.SpaceType}}/{{.User.Username | lower}}
STORAGE_USERS_DRIVER_OCIS_GENERAL_SPACE_ALIAS_TEMPLATE
{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}
How Has This Been Tested?
Example responses (if appropriate):
List personal space
Response
Create a space
Response
Modify a Space
Response
Types of changes
Checklist: