Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ portal_sources = files(
'org.freedesktop.portal.Wallpaper.xml',
)

portal_experimental_sources = files(
'org.freedesktop.portal.experimental.Credential.xml',
)

portal_host_sources = files(
'org.freedesktop.host.portal.Registry.xml',
)
Expand Down Expand Up @@ -73,10 +77,23 @@ portal_impl_sources = files(
'org.freedesktop.impl.portal.Wallpaper.xml',
)

portal_impl_experimental_sources = files(
'org.freedesktop.impl.portal.experimental.Credential.xml',
)
portal_handler_experimental_sources = files(
'org.freedesktop.handler.portal.experimental.Credential.xml',
)

background_monitor_sources = files(
'org.freedesktop.background.Monitor.xml',
)

install_data([portal_sources, portal_host_sources, portal_impl_sources],
install_data([
portal_sources,
portal_experimental_sources,
portal_host_sources,
portal_impl_sources,
portal_impl_experimental_sources,
],
install_dir: datadir / 'dbus-1' / 'interfaces',
)
152 changes: 152 additions & 0 deletions data/org.freedesktop.handler.portal.experimental.Credential.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?xml version="1.0"?>
<!--
Copyright (C) 2025 Isaiah Inuwa <dev@iinuwa.xyz>

SPDX-License-Identifier: LGPL-2.1-or-later

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.

Author: Isaiah Inuwa <dev@iinuwa.xyz>
-->
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<!--
org.freedesktop.handler.portal.experimental.Credential:
@short_description: Credential portal frontend handler interface

The Credential portal allows sandboxed applications to retrieve
web credentials. The frontend implementation is delegates to a separate
handler, `credentialsd <https://github.com/linux-credentials/credentialsd>`_,
that implements the interface described in this document.
-->
<interface name="org.freedesktop.handler.portal.experimental.Credential">
<!--
CreateCredential:
@parent_window: Identifier for the application window, see :doc:`window-identifiers`.
@origin: The origin of the request. Must be a valid HTTPS origin.
@type: Type of the credential to create. Currently, ``publicKey`` is the only supported type.
@options: The credential request context and parameters.
@app_id: App id of the application.
@response: Numeric response. The values allowed match the values allowed for :ref:`org.freedesktop.portal.Request::Response` signal.
@results: Vardict with the results of the call.

Requests a credential of a particular type to be created for a particular origin.

Supported keys in the @options vardict:

* ``activation_token`` (``s``)

A token that can be used to activate the credential selection dialog.

* ``@public_key`` (``a{sv}``):

A string of JSON that corresponds to the WebAuthn
`PublicKeyCredentialCreationOptions`_ type.
Required if @type is ``publicKey``.

* ``top_origin`` (``s``)

The top-level origin of the client window for cross-origin requests.
Pass an empty string to denote a same-origin request.

The following keys are returned in the @results vardict:

* ``type`` (``s``)

Type of the created credential.
Currently, ``publicKey`` is the only supported type.

* ``registration_response_json`` (``s``)

If ``type`` is ``publicKey``, a string of JSON that corresonds to the WebAuthn
`PublicKeyCredential`_ type with the ``response`` field set as
an `AuthenticatorAttestationResponse`_.

.. _AuthenticatorAttestationResponse: https://www.w3.org/TR/webauthn-3/#authenticatorattestationresponse
.. _PublicKeyCredential: https://www.w3.org/TR/webauthn-3/#publickeycredential
.. _PublicKeyCredentialCreationOptions: https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialcreationoptions
-->
<method name="CreateCredential">
<arg type="s" name="parent_window" direction="in"/>
<arg type="s" name="origin" direction="in"/>
<arg type="s" name="type" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In3" value="QVariantMap"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="s" name="app_id" direction="in"/>
<arg type="u" name="response" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
<arg type="a{sv}" name="results" direction="out"/>
</method>

<!--
GetCredential:
@parent_window: Identifier for the application window, see :doc:`window-identifiers`
@origin: The origin of the request. Must be a valid HTTPS origin.
@options: Vardict with optional further information.
@app_id: App id of the application
@response: Numeric response. The values allowed match the values allowed for :ref:`org.freedesktop.portal.Request::Response` signal.
@results: Vardict with the results of the call.

Requests a credential for a particular origin.

Supported keys in the @options vardict:


* ``activation_token`` (``s``)

A token that can be used to activate the credential selection dialog.

* ``@public_key`` (``s``):

A string of JSON that corresponds to the WebAuthn
`PublicKeyCredentialRequestOptions`_ type.

* ``top_origin`` (``s``)

The top-level origin of the client window for cross-origin requests.
Pass an empty string to denote a same-origin request.

Parameters for at least one credential request type must be included in
@options. Currently, the only supported type is `public_key`.

The following keys are returned in the @results vardict:

* ``type`` (``s``)

Type of the returned credential.
Currently, ``publicKey`` is the only supported type.

* ``authentication_response_json`` (``s``)

If ``type`` is ``publicKey``, a string of JSON that corresonds to the
WebAuthn `PublicKeyCredential`_ type with the ``response`` field set as
an `AuthenticatorAssertionResponse`_.

.. _AuthenticationAssertionResponse: https://www.w3.org/TR/webauthn-3/#authenticatorassertionresponse
.. _PublicKeyCredential: https://www.w3.org/TR/webauthn-3/#publickeycredential
.. _PublicKeyCredentialAssertionOptions: https://www.w3.org/TR/webauthn-3/#dictionary-assertion-options
-->
<method name="GetCredential">
<arg type="s" name="parent_window" direction="in"/>
<arg type="s" name="origin" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="s" name="app_id" direction="in"/>
<arg type="u" name="response" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
<arg type="a{sv}" name="results" direction="out"/>
</method>

<property name="version" type="u" access="read"/>
</interface>
</node>
Loading
Loading