diff options
author | Alexander Larsson <alexl@redhat.com> | 2020-05-04 12:35:16 +0200 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2020-06-16 09:48:38 +0200 |
commit | 35631f143e2ba009567bef32e99c1492c29b4ef0 (patch) | |
tree | 69ae9204e8358f229c71589f5a6ad4099a8a8f28 | |
parent | de3fbdf2e6eab69801a8e0c42de5eb2be0faca02 (diff) | |
download | flatpak-35631f143e2ba009567bef32e99c1492c29b4ef0.tar.gz |
By default, always try to auth to OCI remotes
This makes for instance docker hub work.
(cherry picked from commit fdfcae7a91e3af207c4acec918276511f112cafe)
-rw-r--r-- | common/flatpak-auth.c | 4 | ||||
-rw-r--r-- | common/flatpak-dir.c | 5 |
2 files changed, 9 insertions, 0 deletions
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 2c8e12ea..19de4fd3 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -11233,6 +11233,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->collection_id == NULL) { if (state->summary != NULL) /* In the optional case we might not have a summary */ |