ownCloud
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

26. Application based user settings

Context and Problem Statement

To share user settings across devices applications want to store user specific settings on the server. The ePUB app wants to remember which page the user is on. The iOS app wants to rember search queries. The Caldav app needs a space to store data.

Decision Drivers

Considered Options

  • OCS provisioning API
  • settings service
  • libregraph API

Decision Outcome

Chosen option: ???

Positive Consequences:

  • TODO

Negative Consequences:

  • TODO

Pros and Cons of the Options

OCS provisioning API

Nextcloud added a /ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey} endpoint

  • Bad, legacy API we want to get rid of

settings service

  • Bad, yet another API. Always uses POST requests.

libregraph API

The MS Graph API has a special approot driveItem that apps can use to store arbitrary files. See also: Using an App Folder to store user content without access to all files and a blog post with the section Store data in the application’s personal folder.

It basically uses the /me/drive/special/approot:/{filename} endpoint to

PUT https://graph.microsoft.com/v1.0/me/drive/special/approot:/settings.json:/content
content-type: text/plain
authorization: Bearer abc

{"key": "value"}

or

GET https://graph.microsoft.com/v1.0/me/drive/special/approot:/settings.json:/content
authorization: Bearer abc

On single page apps you need two requests:

GET https://graph.microsoft.com/v1.0/me/drive/special/approot:/settings.json?select=@microsoft.graph.downloadUrl
authorization: Bearer abc

followed by

GET <url from the response['@microsoft.graph.downloadUrl'] property>

Currently, applications have no dedicated tokens that we could use to derive the appid from. All apps should have an appid and be discoverable under

GET /applications

In any case for libregraph we could introduce a LIBRE_GRAPH_APPID header to make these requests possible rather soon.

Then we can decide if we want to store these files in the users personal drive, or if we create a space for every app that then uses the userid as a folder that contains all the files for the user.

  • Good, because clients can remain in libregraph API land
  • Bad, we currently have no application tokens