diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 2041b5ae0..210c79c40 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -1078,12 +1078,10 @@ flatpak_remote_state_new_image_source (FlatpakRemoteState *self, if (registry_uri == NULL) return NULL; - image_source = flatpak_image_source_new_remote (registry_uri, oci_repository, digest, NULL, error); + image_source = flatpak_image_source_new_remote (registry_uri, oci_repository, digest, token, NULL, error); if (image_source == NULL) return NULL; - flatpak_image_source_set_token (image_source, token); - return g_steal_pointer (&image_source); } diff --git a/common/flatpak-image-source-private.h b/common/flatpak-image-source-private.h index 94e4cc1aa..beca07b04 100644 --- a/common/flatpak-image-source-private.h +++ b/common/flatpak-image-source-private.h @@ -39,14 +39,13 @@ FlatpakImageSource *flatpak_image_source_new_local (GFile *file, FlatpakImageSource *flatpak_image_source_new_remote (const char *uri, const char *oci_repository, const char *digest, + const char *token, GCancellable *cancellable, GError **error); FlatpakImageSource *flatpak_image_source_new_for_location (const char *location, GCancellable *cancellable, GError **error); -void flatpak_image_source_set_token (FlatpakImageSource *self, - const char *token); void flatpak_image_source_set_delta_url (FlatpakImageSource *self, const char *delta_url); diff --git a/common/flatpak-image-source.c b/common/flatpak-image-source.c index 2454d4a5e..3844d37ea 100644 --- a/common/flatpak-image-source.c +++ b/common/flatpak-image-source.c @@ -177,6 +177,7 @@ FlatpakImageSource * flatpak_image_source_new_remote (const char *uri, const char *oci_repository, const char *digest, + const char *token, GCancellable *cancellable, GError **error) { @@ -186,6 +187,8 @@ flatpak_image_source_new_remote (const char *uri, if (!registry) return NULL; + flatpak_oci_registry_set_token (registry, token); + return flatpak_image_source_new (registry, oci_repository, digest, cancellable, error); } @@ -325,13 +328,6 @@ flatpak_image_source_new_for_location (const char *location, } } -void -flatpak_image_source_set_token (FlatpakImageSource *self, - const char *token) -{ - flatpak_oci_registry_set_token (self->registry, token); -} - void flatpak_image_source_set_delta_url (FlatpakImageSource *self, const char *delta_url)