Skip to content
代码片段 群组 项目
未验证 提交 6745e2b4 编辑于 作者: Marcel van Remmerden's avatar Marcel van Remmerden 提交者: GitLab
浏览文件

Show confirmation that GitLab.com instance applications are provided by GitLab

上级 b39acc92
No related branches found
No related tags found
无相关合并请求
......@@ -19,9 +19,14 @@
.gl-text-gray-500.gl-pb-5.gl-text-sm= t scope, scope: [:doorkeeper, :scope_desc]
.info-well
.well-segment
%p.gl-text-orange-500
= sprite_icon('warning-solid')
= html_escape(_('Make sure you trust %{client_name} before authorizing.')) % { client_name: "<strong>#{html_escape(@pre_auth.client.name)}</strong>".html_safe }
- if Gitlab.com? && !@pre_auth.client.application.owner
%p.gl-text-green-500
= sprite_icon('tanuki-verified')
= _('This application is provided by GitLab.')
- else
%p.gl-text-orange-500
= sprite_icon('warning-solid')
= html_escape(_('Make sure you trust %{client_name} before authorizing.')) % { client_name: "<strong>#{html_escape(@pre_auth.client.name)}</strong>".html_safe }
%p
= html_escape(_('%{owner} %{created_date} ago.')) % { owner: auth_app_owner_text(@pre_auth.client.application.owner), created_date: time_ago_in_words(@pre_auth.client.application.created_at.to_date) }
- domain = URI.parse(@pre_auth.redirect_uri).host.gsub('www.', '')
......
......@@ -54078,6 +54078,9 @@ msgstr ""
msgid "This also resolves this thread"
msgstr ""
 
msgid "This application is provided by GitLab."
msgstr ""
msgid "This application will be able to:"
msgstr ""
 
......@@ -128,6 +128,44 @@
expect(response).to render_template('doorkeeper/authorizations/redirect')
end
context 'when showing applications as provided' do
let!(:application) do
create(
:oauth_application,
owner_id: nil,
owner_type: nil,
scopes: application_scopes,
redirect_uri: 'http://example.com',
confidential: confidential
)
end
context 'when on GitLab.com' do
before do
allow(Gitlab).to receive(:com?).and_return(true)
end
it 'displays the provided application message' do
subject
expect(response.body).to have_css('p.gl-text-green-500', text: 'This application is provided by GitLab.')
expect(response.body).to have_css('[data-testid="tanuki-verified-icon"]')
end
end
context 'when not on GitLab.com' do
before do
allow(Gitlab).to receive(:com?).and_return(false)
end
it 'displays the warning message' do
subject
expect(response.body).to have_css(
'p.gl-text-orange-500', text: "Make sure you trust #{application.name} before authorizing.")
expect(response.body).to have_css('[data-testid="warning-solid-icon"]')
end
end
end
context 'with gl_auth_type=login' do
let(:minimal_scope) { Gitlab::Auth::READ_USER_SCOPE.to_s }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册