Commit Graph

10 Commits

Author SHA1 Message Date
Alexander Larsson
aabadfdc8e authenticator: Fix sandboxed authenticators
We rely on broadcast signals for authenticator replies rather than unicast
as these are not filtered by the sandbox (due to them being opt-in by the
receiver).

Actually this already worked fine in the flatpak side as the generated
code already subscribes to the signals, this just switches the internal
authenticators (test and oci) to using the new way to emit signals.
2019-12-19 10:33:21 +01:00
Alexander Larsson
4902acbebf authenticator: Change how authenticator options are stored
We used to store all options as a gvariant format string like so:

 xa.authenticator-options={"key1": <"a string value">, "key2": <"foo">}

But nobody really knows how to write these things, so now we
have instead multiple options with a common prefix that
get collected like so:

 xa.authenticator-options.key1="a string value"
 xa.authenticator-options.key2="foo"

This means all options are strings, but most options are, and
if not you can just parse them.
2019-12-12 14:27:59 +01:00
Alexander Larsson
38c86bdf0f Authenticator: Add extra a{sv} args for future use
These are not used atm, but make the APIs future proof.
2019-12-12 14:27:59 +01:00
Alexander Larsson
5b58f7f7c2 Auth: Add flatpak_auth_request_emit_basic_auth() helper 2019-12-12 12:16:53 +01:00
Alexander Larsson
4dba1c389b authenticator: Add more data to token request
This adds the remote uri, and the per-ref commit id, as well
as extensible per-ref and per-request dicts we can add stuff to
as needed.

These will be used for the OCI case.
2019-12-12 12:16:53 +01:00
Alexander Larsson
3f6245d41b authenticator: Add a parent_window handle to request_tokens
This allows the authenticator to directly do UI and parent it to the
relevant window. The actual parent string is specified just like
the xdg-desktop-portal one.

There is a new flatpak_transaction_set_parent_window() function that
clients can use to signal the what window they want to be parented to.
2019-11-26 16:37:01 +01:00
Alexander Larsson
90dc9ace2a authenticator: Pass token-type for each ref
This allows the authenticator to handle each token type differently.
For example, this allows a "purchase" type to run the donation
webflow, but not require login (and then store the fact that this was
run locally).
2019-11-26 16:37:01 +01:00
Alexander Larsson
b77f7c9383 authenticator: Pass remote name to RequestRefTokens
This makes it very easy to reuse a single authenticator for several
remotes. This is useful for the a default authenticator implementation
that we can ship with flatpak and use for e.g. flathub.
2019-11-26 16:37:01 +01:00
Alexander Larsson
9a8bf2be31 auth: Add helpers dbus helpers for sending webflow signals 2019-11-26 16:37:01 +01:00
Alexander Larsson
e6465da03b Add some helper functions for working with authenticators
This will be used by later code in combination with the gdbus
generated code.
2019-11-26 16:37:01 +01:00