From fdfcae7a91e3af207c4acec918276511f112cafe Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 4 May 2020 12:35:16 +0200 Subject: [PATCH] By default, always try to auth to OCI remotes This makes for instance docker hub work. --- common/flatpak-auth.c | 4 ++++ common/flatpak-dir.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/common/flatpak-auth.c b/common/flatpak-auth.c index 9d0f689f..9e45da41 100644 --- a/common/flatpak-auth.c +++ b/common/flatpak-auth.c @@ -49,6 +49,10 @@ flatpak_auth_new_for_remote (FlatpakDir *dir, if (!ostree_repo_get_remote_option (repo, remote, FLATPAK_REMOTE_CONFIG_AUTHENTICATOR_NAME, NULL, &name, error)) return NULL; } + + if (name == NULL && flatpak_dir_get_remote_oci (dir, remote)) + name = g_strdup ("org.flatpak.Authenticator.Oci"); + if (name == NULL || *name == 0 /* or if no repo */) { flatpak_fail (error, _("No authenticator configured for remote `%s`"), remote); diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 7e0d90f8..6b3b9a05 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -10683,6 +10683,11 @@ _flatpak_dir_get_remote_state (FlatpakDir *self, } } + if (flatpak_dir_get_remote_oci (self, remote_or_uri)) + { + state->default_token_type = 1; + } + if (state->summary != NULL) /* In the optional case we might not have a summary */ { VarSummaryRef summary = var_summary_from_gvariant (state->summary);