Commit 8ba1a70e authored by Stan Hu's avatar Stan Hu

Merge branch '328674-fix-lfs-push-for-auth-method-password' into 'master'

Fix LFS push mirroring for mirrors set up a long time ago

See merge request gitlab-org/gitlab!59972
parents f972c1ea 6408aab2
---
title: Fix LFS push mirroring for mirrors set up a long time ago
merge_request: 59972
author:
type: fixed
......@@ -97,7 +97,10 @@ module Gitlab
end
def basic_auth
return unless credentials[:auth_method] == "password"
# Some legacy credentials have a nil auth_method, which means password
# https://gitlab.com/gitlab-org/gitlab/-/issues/328674
return unless credentials.fetch(:auth_method, 'password') == 'password'
return if credentials.empty?
{ username: credentials[:user], password: credentials[:password] }
end
......
......@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Lfs::Client do
let(:base_url) { "https://example.com" }
let(:username) { 'user' }
let(:password) { 'password' }
let(:credentials) { { user: username, password: password, auth_method: 'password' } }
let(:credentials) { { user: username, password: password } }
let(:git_lfs_content_type) { 'application/vnd.git-lfs+json' }
let(:git_lfs_user_agent) { "GitLab #{Gitlab::VERSION} LFS client" }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment