Commit Graph

8 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
260c6f713d tests: Test passing of arguments to authenticator 2019-12-13 15:08:29 +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
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
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
2b06b0328c test-authenticator: Support requesting a web flow
If request-webflow file exists, then the authenticator will listen
to a local socket and start a webflow request with a uri pointing to it.
If anything connects to the uri it will consider the flow ok and continue.
If the client calls close() instead it will silently succeed anyway
if require-webflow doesn't exists, and fail if is exists.
2019-11-26 16:37:01 +01:00
Alexander Larsson
094c1ee0ff tests: Add a test authenticator
This is a trivial implementation of org.freedesktop.Flatpak.Authenticator
that just reads the contents of the "required-token" file and returns
that as the tokens for all refs.
2019-11-26 16:37:01 +01:00