提交 83ef6fa0 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/security/gitlab@12-8-stable-ee

上级 a01497b0
......@@ -2,7 +2,7 @@
class RemoteMirrorEntity < Grape::Entity
expose :id
expose :url
expose :safe_url, as: :url
expose :enabled
expose :auth_method
......
---
title: Return only safe urls for mirrors
merge_request:
author:
type: security
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe RemoteMirrorEntity do
let(:project) { create(:project, :repository, :remote_mirror) }
let(:project) { create(:project, :repository, :remote_mirror, url: "https://test:password@gitlab.com") }
let(:remote_mirror) { project.remote_mirrors.first }
let(:entity) { described_class.new(remote_mirror) }
......@@ -15,4 +15,9 @@ describe RemoteMirrorEntity do
:ssh_known_hosts, :ssh_public_key, :ssh_known_hosts_fingerprints
)
end
it 'does not expose password information' do
expect(subject[:url]).not_to include('password')
expect(subject[:url]).to eq(remote_mirror.safe_url)
end
end
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册