| 1 |
<?xml version="1.0"?> |
| 2 |
|
| 3 |
<!-- |
| 4 |
Copyright (C) 2015 Red Hat, Inc. |
| 5 |
|
| 6 |
SPDX-License-Identifier: LGPL-2.1-or-later |
| 7 |
|
| 8 |
This library is free software; you can redistribute it and/or |
| 9 |
modify it under the terms of the GNU Lesser General Public |
| 10 |
License as published by the Free Software Foundation; either |
| 11 |
version 2.1 of the License, or (at your option) any later version. |
| 12 |
|
| 13 |
This library is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
Lesser General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU Lesser General |
| 19 |
Public License along with this library; if not, write to the |
| 20 |
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 |
Boston, MA 02110-1301, USA. |
| 22 |
|
| 23 |
Author: Alexander Larsson <[email protected]> |
| 24 |
--> |
| 25 |
|
| 26 |
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> |
| 27 |
<!-- |
| 28 |
org.freedesktop.portal.Documents: |
| 29 |
@short_description: Document portal |
| 30 |
|
| 31 |
The document portal allows to make files from the outside world |
| 32 |
available to sandboxed applications in a controlled way. |
| 33 |
|
| 34 |
Exported files will be made accessible to the application via |
| 35 |
a fuse filesystem that gets mounted at ``/run/user/$UID/doc/``. The |
| 36 |
filesystem gets mounted both outside and inside the sandbox, but |
| 37 |
the view inside the sandbox is restricted to just those files |
| 38 |
that the application is allowed to access. |
| 39 |
|
| 40 |
Individual files will appear at ``/run/user/$UID/doc/$DOC_ID/filename``, |
| 41 |
where $DOC_ID is the ID of the file in the document store. It is |
| 42 |
returned by the org.freedesktop.portal.Documents.Add() and |
| 43 |
org.freedesktop.portal.Documents.AddNamed() calls. |
| 44 |
|
| 45 |
The permissions that the application has for a document store entry |
| 46 |
(see org.freedesktop.portal.Documents.GrantPermissions()) are reflected |
| 47 |
in the POSIX mode bits in the fuse filesystem. |
| 48 |
|
| 49 |
The D-Bus interface for the document portal is available under the |
| 50 |
bus name org.freedesktop.portal.Documents and the object path |
| 51 |
/org/freedesktop/portal/documents. |
| 52 |
|
| 53 |
This documentation describes version 5 of this interface. |
| 54 |
--> |
| 55 |
<interface name="org.freedesktop.portal.Documents"> |
| 56 |
<property name="version" type="u" access="read"/> |
| 57 |
|
| 58 |
<!-- |
| 59 |
GetMountPoint: |
| 60 |
@path: the path at which the fuse filesystem is mounted |
| 61 |
|
| 62 |
Returns the path at which the document store fuse filesystem |
| 63 |
is mounted. This will typically be ``/run/user/$UID/doc/``. |
| 64 |
--> |
| 65 |
<method name="GetMountPoint"> |
| 66 |
<arg type="ay" name="path" direction="out"/> |
| 67 |
</method> |
| 68 |
|
| 69 |
<!-- |
| 70 |
Add: |
| 71 |
@o_path_fd: open file descriptor for the file to add |
| 72 |
@reuse_existing: whether to reuse an existing document store entry for the file |
| 73 |
@persistent: whether to add the file only for this session or permanently |
| 74 |
@doc_id: the ID of the file in the document store |
| 75 |
|
| 76 |
Adds a file to the document store. The file is passed in the |
| 77 |
form of an open file descriptor to prove that the caller has |
| 78 |
access to the file. |
| 79 |
--> |
| 80 |
<method name="Add"> |
| 81 |
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/> |
| 82 |
<arg type="h" name="o_path_fd" direction="in"/> |
| 83 |
<arg type="b" name="reuse_existing" direction="in"/> |
| 84 |
<arg type="b" name="persistent" direction="in"/> |
| 85 |
<arg type="s" name="doc_id" direction="out"/> |
| 86 |
</method> |
| 87 |
|
| 88 |
<!-- |
| 89 |
AddNamed: |
| 90 |
@o_path_parent_fd: open file descriptor for the parent directory |
| 91 |
@filename: the basename for the file |
| 92 |
@reuse_existing: whether to reuse an existing document store entry for the file |
| 93 |
@persistent: whether to add the file only for this session or permanently |
| 94 |
@doc_id: the ID of the file in the document store |
| 95 |
|
| 96 |
Creates an entry in the document store for writing a new file. |
| 97 |
--> |
| 98 |
<method name="AddNamed"> |
| 99 |
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/> |
| 100 |
<arg type="h" name="o_path_parent_fd" direction="in"/> |
| 101 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QByteArray"/> |
| 102 |
<arg type="ay" name="filename" direction="in"/> |
| 103 |
<arg type="b" name="reuse_existing" direction="in"/> |
| 104 |
<arg type="b" name="persistent" direction="in"/> |
| 105 |
<arg type="s" name="doc_id" direction="out"/> |
| 106 |
</method> |
| 107 |
|
| 108 |
<!-- |
| 109 |
AddFull: |
| 110 |
@o_path_fds: open file descriptors for the files to export |
| 111 |
@flags: flags, 1 == ``reuse_existing``, 2 == ``persistent``, 4 == ``as-needed-by-app``, 8 = ``export-directory`` |
| 112 |
@app_id: an application ID, or empty string |
| 113 |
@permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete' |
| 114 |
@doc_ids: the IDs of the files in the document store |
| 115 |
@extra_info: Extra info returned |
| 116 |
|
| 117 |
Adds multiple files to the document store. The file is passed in the |
| 118 |
form of an open file descriptor to prove that the caller has |
| 119 |
access to the file. |
| 120 |
|
| 121 |
If the ``as-needed-by-app`` flag is given, files will only be added to |
| 122 |
the document store if the application does not already have access to them. |
| 123 |
For files that are not added to the document store, the @doc_ids array will |
| 124 |
contain an empty string. |
| 125 |
|
| 126 |
Additionally, if @app_id is specified, it will be given the permissions |
| 127 |
listed in org.freedesktop.portal.Documents.GrantPermissions(). |
| 128 |
|
| 129 |
The method also returns some extra info that can be used to avoid |
| 130 |
multiple roundtrips. For now it only contains as "mountpoint", the |
| 131 |
fuse mountpoint of the document portal. |
| 132 |
|
| 133 |
This method was added in version 2 of this interface. |
| 134 |
|
| 135 |
Support for exporting directories was added in version 4 of this interface. |
| 136 |
--> |
| 137 |
<method name="AddFull"> |
| 138 |
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/> |
| 139 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QList<QDBusUnixFileDescriptor>"/> |
| 140 |
<arg type="ah" name="o_path_fds" direction="in"/> |
| 141 |
<arg type="u" name="flags" direction="in"/> |
| 142 |
<arg type="s" name="app_id" direction="in"/> |
| 143 |
<arg type="as" name="permissions" direction="in"/> |
| 144 |
<arg type="as" name="doc_ids" direction="out"/> |
| 145 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> |
| 146 |
<arg type="a{sv}" name="extra_out" direction="out"/> |
| 147 |
</method> |
| 148 |
|
| 149 |
<!-- |
| 150 |
AddNamedFull: |
| 151 |
@o_path_fds: open file descriptor for the parent directory |
| 152 |
@filename: the basename for the file |
| 153 |
@flags: flags, 1 == ``reuse_existing``, 2 == ``persistent``, 4 == ``as-needed-by-app`` |
| 154 |
@app_id: an application ID, or empty string |
| 155 |
@permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete' |
| 156 |
@doc_id: the ID of the file in the document store |
| 157 |
@extra_info: Extra info returned |
| 158 |
|
| 159 |
Creates an entry in the document store for writing a new file. |
| 160 |
|
| 161 |
If the ``as-needed-by-app`` flag is given, file will only be added to |
| 162 |
the document store if the application does not already have access to it. |
| 163 |
For file that is not added to the document store, the @doc_id will |
| 164 |
contain an empty string. |
| 165 |
|
| 166 |
Additionally, if @app_id is specified, it will be given the permissions |
| 167 |
listed in org.freedesktop.portal.Documents.GrantPermissions(). |
| 168 |
|
| 169 |
The method also returns some extra info that can be used to avoid |
| 170 |
multiple roundtrips. For now it only contains as "mountpoint", the |
| 171 |
fuse mountpoint of the document portal. |
| 172 |
|
| 173 |
This method was added in version 3 of this interface. |
| 174 |
--> |
| 175 |
<method name="AddNamedFull"> |
| 176 |
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/> |
| 177 |
<arg type="h" name="o_path_fd" direction="in"/> |
| 178 |
<arg type="ay" name="filename" direction="in"/> |
| 179 |
<arg type="u" name="flags" direction="in"/> |
| 180 |
<arg type="s" name="app_id" direction="in"/> |
| 181 |
<arg type="as" name="permissions" direction="in"/> |
| 182 |
<arg type="s" name="doc_id" direction="out"/> |
| 183 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> |
| 184 |
<arg type="a{sv}" name="extra_out" direction="out"/> |
| 185 |
</method> |
| 186 |
|
| 187 |
<!-- |
| 188 |
GrantPermissions: |
| 189 |
@doc_id: the ID of the file in the document store |
| 190 |
@app_id: the ID of the application to which permissions are granted |
| 191 |
@permissions: the permissions to grant, possible values are ``read``, ``write``, ``grant-permissions`` and ``delete`` |
| 192 |
|
| 193 |
Grants access permissions for a file in the document store |
| 194 |
to an application. |
| 195 |
|
| 196 |
This call is available inside the sandbox if the application |
| 197 |
has the ``grant-permissions`` permission for the document. |
| 198 |
--> |
| 199 |
<method name="GrantPermissions"> |
| 200 |
<arg type="s" name="doc_id" direction="in"/> |
| 201 |
<arg type="s" name="app_id" direction="in"/> |
| 202 |
<arg type="as" name="permissions" direction="in"/> |
| 203 |
</method> |
| 204 |
|
| 205 |
<!-- |
| 206 |
RevokePermissions: |
| 207 |
@doc_id: the ID of the file in the document store |
| 208 |
@app_id: the ID of the application from which permissions are revoked |
| 209 |
@permissions: the permissions to revoke, possible values are 'read', 'write', 'grant-permissions' and 'delete' |
| 210 |
|
| 211 |
Revokes access permissions for a file in the document store |
| 212 |
from an application. |
| 213 |
|
| 214 |
This call is available inside the sandbox if the application |
| 215 |
has the ``grant-permissions`` permission for the document. |
| 216 |
--> |
| 217 |
<method name="RevokePermissions"> |
| 218 |
<arg type="s" name="doc_id" direction="in"/> |
| 219 |
<arg type="s" name="app_id" direction="in"/> |
| 220 |
<arg type="as" name="permissions" direction="in"/> |
| 221 |
</method> |
| 222 |
|
| 223 |
<!-- |
| 224 |
Delete: |
| 225 |
@doc_id: the ID of the file in the document store |
| 226 |
|
| 227 |
Removes an entry from the document store. The file itself is |
| 228 |
not deleted. |
| 229 |
|
| 230 |
This call is available inside the sandbox if the application |
| 231 |
has the ``delete`` permission for the document. |
| 232 |
--> |
| 233 |
<method name="Delete"> |
| 234 |
<arg type="s" name="doc_id" direction="in"/> |
| 235 |
</method> |
| 236 |
|
| 237 |
<!-- |
| 238 |
Lookup: |
| 239 |
@filename: a path in the host filesystem |
| 240 |
@doc_id: the ID of the file in the document store, or '' if the file is not in the document store |
| 241 |
|
| 242 |
Looks up the document ID for a file. |
| 243 |
|
| 244 |
This call is not available inside the sandbox. |
| 245 |
--> |
| 246 |
<method name="Lookup"> |
| 247 |
<arg type="ay" name="filename" direction="in"/> |
| 248 |
<arg type="s" name="doc_id" direction="out"/> |
| 249 |
</method> |
| 250 |
|
| 251 |
<!-- |
| 252 |
Info: |
| 253 |
@doc_id: the ID of the file in the document store |
| 254 |
@path: the path for the file in the host filesystem |
| 255 |
@apps: a dictionary mapping application IDs to the permissions for that application |
| 256 |
|
| 257 |
Gets the filesystem path and application permissions for a document store |
| 258 |
entry. |
| 259 |
|
| 260 |
This call is not available inside the sandbox. |
| 261 |
--> |
| 262 |
<method name="Info"> |
| 263 |
<arg type="s" name="doc_id" direction="in"/> |
| 264 |
<arg type="ay" name="path" direction="out"/> |
| 265 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QMap<QString,QStringList>"/> |
| 266 |
<arg type="a{sas}" name="apps" direction="out"/> |
| 267 |
</method> |
| 268 |
|
| 269 |
<!-- |
| 270 |
List: |
| 271 |
@app_id: an application ID, or '' to list all documents |
| 272 |
@docs: a dictionary mapping document IDs to their filesystem path |
| 273 |
|
| 274 |
Lists documents in the document store for an application (or for |
| 275 |
all applications). |
| 276 |
|
| 277 |
This call is not available inside the sandbox. |
| 278 |
--> |
| 279 |
<method name="List"> |
| 280 |
<arg type="s" name="app_id" direction="in"/> |
| 281 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QMap<QString,QByteArray>"/> |
| 282 |
<arg type="a{say}" name="docs" direction="out"/> |
| 283 |
</method> |
| 284 |
|
| 285 |
<!-- |
| 286 |
GetHostPaths: |
| 287 |
@doc_ids: the list of IDs of the files in the document store |
| 288 |
@paths: a dictionary mapping document IDs to the paths in the host filesystem |
| 289 |
|
| 290 |
Gets the host filesystem paths for document store entries. |
| 291 |
|
| 292 |
The host filesystem path is also available in the ``user.document-portal.host-path`` extended file attribute. |
| 293 |
|
| 294 |
This call is available inside the sandbox, if the application has the ``read`` permission for the documents. |
| 295 |
|
| 296 |
This method was added in version 5 of this interface. |
| 297 |
--> |
| 298 |
<method name="GetHostPaths"> |
| 299 |
<arg type="as" name="doc_ids" direction="in"/> |
| 300 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QMap<QString,QByteArray>"/> |
| 301 |
<arg type="a{say}" name="paths" direction="out"/> |
| 302 |
</method> |
| 303 |
</interface> |
| 304 |
</node> |