Initial version of the document portal landed in xdg-app

Alexander Larsson alexl at redhat.com
Fri Jul 10 15:58:48 UTC 2015


I just landed the initial version of the document portal in xdg-app
git. This is the an integrated version of the latest version of the
code in my xdg-document-portal github repo.

Here is how it works:
Someone wanting to open a file in a sandboxed app uses the
org.freedesktop.portal.Documents interface to create a unique document
API for the pathname /foo/bar.txt. Say this returns the id "abc123"
(its a guint32 hex value). You can then access the file through a fuse
filesystem at "/run/user/$uid/doc/abc123/bar.txt". 

Additionally you can grant permissions for a specific app, say
org.gnome.gedit to read it. It will then also show up in
"/run/user/$uid/doc/by-app/org.gnome.gedit/abc123/bar.txt", and inside
the sandbox "by-app/org.gnome.gedit" will be mounted at
"/run/user/$uid/doc", making the file visible from the sandboxed app.

The idea here is that another portal, for instance the "content choser"
portal would open a file dialog on the host side, allow the user to
select a file, and then we pass back the document portal pathname,
allowing the app to open that and only that file.

Matthias has some initial code to do that at:
https://github.com/matthiasclasen/xdg-content-chooser
This has not been updated to the latest API changes, but i hope it can
be done soon, allowing us to run simple apps without access to the
users files.



More information about the xdg-app mailing list