修复:导入仓库密码为严格base64

This commit is contained in:
yystopf 2026-04-09 15:34:31 +08:00
parent cc05584245
commit 4fe2dc6b28
1 changed files with 7 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class Repositories::MigrateService < ApplicationService
private: params[:hidden],
mirror: wrapper_mirror || false,
auth_username: params[:login],
auth_password: Base64.decode64(params[:password] || ""),
auth_password: base64_decode_password,
auth_token: params[:auth_token],
service: params[:service] || 'git',
}
@ -41,4 +41,10 @@ class Repositories::MigrateService < ApplicationService
def wrapper_mirror
ActiveModel::Type::Boolean.new.cast(params[:is_mirror])
end
def base64_decode_password
Base64.strict_decode64(params[:password] || "")
rescue
params[:password]
end
end