mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-24 16:57:42 -04:00
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.
This commit is contained in:
committed by
Alexander Larsson
parent
3411cf0336
commit
b77f7c9383
@@ -51,6 +51,7 @@ FlatpakAuthenticatorRequest *flatpak_auth_create_request (FlatpakAuth
|
||||
GError **error);
|
||||
gboolean flatpak_auth_request_ref_tokens (FlatpakAuthenticator *authenticator,
|
||||
FlatpakAuthenticatorRequest *request,
|
||||
const char *remote,
|
||||
const char **refs,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
@@ -129,6 +129,7 @@ flatpak_auth_create_request (FlatpakAuthenticator *authenticator,
|
||||
gboolean
|
||||
flatpak_auth_request_ref_tokens (FlatpakAuthenticator *authenticator,
|
||||
FlatpakAuthenticatorRequest *request,
|
||||
const char *remote,
|
||||
const char **refs,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
@@ -141,7 +142,7 @@ flatpak_auth_request_ref_tokens (FlatpakAuthenticator *authenticator,
|
||||
|
||||
options = g_object_get_data (G_OBJECT (authenticator), "authenticator-options");
|
||||
|
||||
if (!flatpak_authenticator_call_request_ref_tokens_sync (authenticator, token, options, refs,
|
||||
if (!flatpak_authenticator_call_request_ref_tokens_sync (authenticator, token, options, remote, refs,
|
||||
&handle, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
|
||||
@@ -2810,7 +2810,7 @@ request_tokens_for_remote (FlatpakTransaction *self,
|
||||
priv->active_webflow = &data;
|
||||
|
||||
data.request = request;
|
||||
if (!flatpak_auth_request_ref_tokens (authenticator, request, (const char **)refs->pdata, cancellable, error))
|
||||
if (!flatpak_auth_request_ref_tokens (authenticator, request, remote, (const char **)refs->pdata, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
while (!data.done)
|
||||
|
||||
@@ -175,6 +175,7 @@
|
||||
<method name="RequestRefTokens">
|
||||
<arg type='s' name='handle_token' direction='in'/>
|
||||
<arg type='a{sv}' name='authenticator_options' direction='in'/>
|
||||
<arg type='s' name='remote' direction='in'/>
|
||||
<arg type='as' name='refs' direction='in'/>
|
||||
<arg type='o' name='handle' direction='out'/>
|
||||
</method>
|
||||
|
||||
@@ -172,6 +172,7 @@ handle_request_ref_tokens (FlatpakAuthenticator *authenticator,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *arg_handle_token,
|
||||
GVariant *arg_authenticator_option,
|
||||
const gchar *arg_remote,
|
||||
const gchar *const *arg_refs)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
Reference in New Issue
Block a user