Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
fbaabb39
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fbaabb39
编写于
6月 29, 2016
作者:
P
Patricio Cano
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename `enabled_git_access_protocols` to singular.
上级
120a1189
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
15 addition
and
14 deletion
+15
-14
CHANGELOG
CHANGELOG
+2
-1
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+2
-2
app/models/application_setting.rb
app/models/application_setting.rb
+1
-1
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+1
-1
db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
...d_enabled_git_access_protocols_to_application_settings.rb
+1
-1
lib/gitlab/protocol_access.rb
lib/gitlab/protocol_access.rb
+2
-2
spec/features/admin/admin_disables_git_access_protocol_spec.rb
...features/admin/admin_disables_git_access_protocol_spec.rb
+2
-2
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+1
-1
spec/requests/api/internal_spec.rb
spec/requests/api/internal_spec.rb
+3
-3
未找到文件。
CHANGELOG
浏览文件 @
fbaabb39
...
...
@@ -23,6 +23,8 @@ v 8.10.0 (unreleased)
- Add notification settings dropdown for groups
- Allow importing from Github using Personal Access Tokens. (Eric K Idema)
- API: Todos !3188 (Robert Schilling)
- Add "Enabled Git access protocols" to Application Settings
- Implement Subresource Integrity for CSS and JavaScript assets. This prevents malicious assets from loading in the case of a CDN compromise.
- Fix user creation with stronger minimum password requirements !4054 (nathan-pmt)
- PipelinesFinder uses git cache data
- Check for conflicts with existing Project's wiki path when creating a new project.
...
...
@@ -176,7 +178,6 @@ v 8.9.0
- Fix horizontal scrollbar for long commit message.
- GitLab Performance Monitoring now tracks the total method execution time and call count per method
- Add Environments and Deployments
- Add "Enabled Git access protocols" to Application Settings
- Redesign account and email confirmation emails
- Don't fail builds for projects that are deleted
- Support Docker Registry manifest v1
...
...
app/helpers/application_settings_helper.rb
浏览文件 @
fbaabb39
...
...
@@ -32,11 +32,11 @@ module ApplicationSettingsHelper
end
def
allowed_protocols_present?
current_application_settings
.
enabled_git_access_protocol
s
.
present?
current_application_settings
.
enabled_git_access_protocol
.
present?
end
def
enabled_protocol
case
current_application_settings
.
enabled_git_access_protocol
s
case
current_application_settings
.
enabled_git_access_protocol
when
'http'
gitlab_config
.
protocol
when
'ssh'
...
...
app/models/application_setting.rb
浏览文件 @
fbaabb39
...
...
@@ -59,7 +59,7 @@ class ApplicationSetting < ActiveRecord::Base
presence:
true
,
inclusion:
{
in:
->
(
_object
)
{
Gitlab
.
config
.
repositories
.
storages
.
keys
}
}
validates
:enabled_git_access_protocol
s
,
validates
:enabled_git_access_protocol
,
inclusion:
{
in:
%w(ssh http)
,
allow_blank:
true
,
allow_nil:
true
}
validates_each
:restricted_visibility_levels
do
|
record
,
attr
,
value
|
...
...
app/views/admin/application_settings/_form.html.haml
浏览文件 @
fbaabb39
...
...
@@ -46,7 +46,7 @@
.form-group
%label
.control-label.col-sm-2
Enabled Git access protocols
.col-sm-10
=
select
(
:application_setting
,
:enabled_git_access_protocol
s
,
[[
'Both SSH and HTTP(S)'
,
nil
],
[
'Only SSH'
,
'ssh'
],
[
'Only HTTP(S)'
,
'http'
]],
{},
class:
'form-control'
)
=
select
(
:application_setting
,
:enabled_git_access_protocol
,
[[
'Both SSH and HTTP(S)'
,
nil
],
[
'Only SSH'
,
'ssh'
],
[
'Only HTTP(S)'
,
'http'
]],
{},
class:
'form-control'
)
%span
.help-block
#clone-protocol-help
Allow only the selected protocols to be used for Git access.
.form-group
...
...
db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
浏览文件 @
fbaabb39
...
...
@@ -6,6 +6,6 @@ class AddEnabledGitAccessProtocolsToApplicationSettings < ActiveRecord::Migratio
include
Gitlab
::
Database
::
MigrationHelpers
def
change
add_column
:application_settings
,
:enabled_git_access_protocol
s
,
:string
add_column
:application_settings
,
:enabled_git_access_protocol
,
:string
end
end
lib/gitlab/protocol_access.rb
浏览文件 @
fbaabb39
...
...
@@ -3,10 +3,10 @@ module Gitlab
def
self
.
allowed?
(
protocol
)
if
protocol
.
to_s
==
'web'
true
elsif
current_application_settings
.
enabled_git_access_protocol
s
.
blank?
elsif
current_application_settings
.
enabled_git_access_protocol
.
blank?
true
else
protocol
.
to_s
==
current_application_settings
.
enabled_git_access_protocol
s
protocol
.
to_s
==
current_application_settings
.
enabled_git_access_protocol
end
end
end
...
...
spec/features/admin/admin_disables_git_access_protocol_spec.rb
浏览文件 @
fbaabb39
...
...
@@ -54,13 +54,13 @@ feature 'Admin disables Git access protocol', feature: true do
def
disable_http_protocol
visit
admin_application_settings_path
find
(
'#application_setting_enabled_git_access_protocol
s
'
).
find
(
:xpath
,
'option[2]'
).
select_option
find
(
'#application_setting_enabled_git_access_protocol'
).
find
(
:xpath
,
'option[2]'
).
select_option
click_on
'Save'
end
def
disable_ssh_protocol
visit
admin_application_settings_path
find
(
'#application_setting_enabled_git_access_protocol
s
'
).
find
(
:xpath
,
'option[3]'
).
select_option
find
(
'#application_setting_enabled_git_access_protocol'
).
find
(
:xpath
,
'option[3]'
).
select_option
click_on
'Save'
end
end
spec/lib/gitlab/git_access_spec.rb
浏览文件 @
fbaabb39
...
...
@@ -70,7 +70,7 @@ describe Gitlab::GitAccess, lib: true do
describe
'#check with single protocols allowed'
do
def
disable_protocol
(
protocol
)
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
.
update_attribute
(
:enabled_git_access_protocol
s
,
protocol
)
settings
.
update_attribute
(
:enabled_git_access_protocol
,
protocol
)
end
context
'ssh disabled'
do
...
...
spec/requests/api/internal_spec.rb
浏览文件 @
fbaabb39
...
...
@@ -211,7 +211,7 @@ describe API::API, api: true do
context
'ssh access has been disabled'
do
before
do
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
.
update_attribute
(
:enabled_git_access_protocol
s
,
'http'
)
settings
.
update_attribute
(
:enabled_git_access_protocol
,
'http'
)
end
it
'rejects the SSH push'
do
...
...
@@ -234,7 +234,7 @@ describe API::API, api: true do
context
'http access has been disabled'
do
before
do
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
.
update_attribute
(
:enabled_git_access_protocol
s
,
'ssh'
)
settings
.
update_attribute
(
:enabled_git_access_protocol
,
'ssh'
)
end
it
'rejects the HTTP push'
do
...
...
@@ -257,7 +257,7 @@ describe API::API, api: true do
context
'web actions are always allowed'
do
it
'allows WEB push'
do
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
.
update_attribute
(
:enabled_git_access_protocol
s
,
'ssh'
)
settings
.
update_attribute
(
:enabled_git_access_protocol
,
'ssh'
)
project
.
team
<<
[
user
,
:developer
]
push
(
key
,
project
,
'web'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录