Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
fbaabb39
Commit
fbaabb39
authored
Jun 29, 2016
by
Patricio Cano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `enabled_git_access_protocols` to singular.
parent
120a1189
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
14 deletions
+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
No files found.
CHANGELOG
View file @
fbaabb39
...
@@ -23,6 +23,8 @@ v 8.10.0 (unreleased)
...
@@ -23,6 +23,8 @@ v 8.10.0 (unreleased)
- Add notification settings dropdown for groups
- Add notification settings dropdown for groups
- Allow importing from Github using Personal Access Tokens. (Eric K Idema)
- Allow importing from Github using Personal Access Tokens. (Eric K Idema)
- API: Todos !3188 (Robert Schilling)
- 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)
- Fix user creation with stronger minimum password requirements !4054 (nathan-pmt)
- PipelinesFinder uses git cache data
- PipelinesFinder uses git cache data
- Check for conflicts with existing Project's wiki path when creating a new project.
- Check for conflicts with existing Project's wiki path when creating a new project.
...
@@ -176,7 +178,6 @@ v 8.9.0
...
@@ -176,7 +178,6 @@ v 8.9.0
- Fix horizontal scrollbar for long commit message.
- Fix horizontal scrollbar for long commit message.
- GitLab Performance Monitoring now tracks the total method execution time and call count per method
- GitLab Performance Monitoring now tracks the total method execution time and call count per method
- Add Environments and Deployments
- Add Environments and Deployments
- Add "Enabled Git access protocols" to Application Settings
- Redesign account and email confirmation emails
- Redesign account and email confirmation emails
- Don't fail builds for projects that are deleted
- Don't fail builds for projects that are deleted
- Support Docker Registry manifest v1
- Support Docker Registry manifest v1
...
...
app/helpers/application_settings_helper.rb
View file @
fbaabb39
...
@@ -32,11 +32,11 @@ module ApplicationSettingsHelper
...
@@ -32,11 +32,11 @@ module ApplicationSettingsHelper
end
end
def
allowed_protocols_present?
def
allowed_protocols_present?
current_application_settings
.
enabled_git_access_protocol
s
.
present?
current_application_settings
.
enabled_git_access_protocol
.
present?
end
end
def
enabled_protocol
def
enabled_protocol
case
current_application_settings
.
enabled_git_access_protocol
s
case
current_application_settings
.
enabled_git_access_protocol
when
'http'
when
'http'
gitlab_config
.
protocol
gitlab_config
.
protocol
when
'ssh'
when
'ssh'
...
...
app/models/application_setting.rb
View file @
fbaabb39
...
@@ -59,7 +59,7 @@ class ApplicationSetting < ActiveRecord::Base
...
@@ -59,7 +59,7 @@ class ApplicationSetting < ActiveRecord::Base
presence:
true
,
presence:
true
,
inclusion:
{
in:
->
(
_object
)
{
Gitlab
.
config
.
repositories
.
storages
.
keys
}
}
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
}
inclusion:
{
in:
%w(ssh http)
,
allow_blank:
true
,
allow_nil:
true
}
validates_each
:restricted_visibility_levels
do
|
record
,
attr
,
value
|
validates_each
:restricted_visibility_levels
do
|
record
,
attr
,
value
|
...
...
app/views/admin/application_settings/_form.html.haml
View file @
fbaabb39
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
.form-group
.form-group
%label
.control-label.col-sm-2
Enabled Git access protocols
%label
.control-label.col-sm-2
Enabled Git access protocols
.col-sm-10
.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
%span
.help-block
#clone-protocol-help
Allow only the selected protocols to be used for Git access.
Allow only the selected protocols to be used for Git access.
.form-group
.form-group
...
...
db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
View file @
fbaabb39
...
@@ -6,6 +6,6 @@ class AddEnabledGitAccessProtocolsToApplicationSettings < ActiveRecord::Migratio
...
@@ -6,6 +6,6 @@ class AddEnabledGitAccessProtocolsToApplicationSettings < ActiveRecord::Migratio
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
def
change
def
change
add_column
:application_settings
,
:enabled_git_access_protocol
s
,
:string
add_column
:application_settings
,
:enabled_git_access_protocol
,
:string
end
end
end
end
lib/gitlab/protocol_access.rb
View file @
fbaabb39
...
@@ -3,10 +3,10 @@ module Gitlab
...
@@ -3,10 +3,10 @@ module Gitlab
def
self
.
allowed?
(
protocol
)
def
self
.
allowed?
(
protocol
)
if
protocol
.
to_s
==
'web'
if
protocol
.
to_s
==
'web'
true
true
elsif
current_application_settings
.
enabled_git_access_protocol
s
.
blank?
elsif
current_application_settings
.
enabled_git_access_protocol
.
blank?
true
true
else
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
end
end
end
...
...
spec/features/admin/admin_disables_git_access_protocol_spec.rb
View file @
fbaabb39
...
@@ -54,13 +54,13 @@ feature 'Admin disables Git access protocol', feature: true do
...
@@ -54,13 +54,13 @@ feature 'Admin disables Git access protocol', feature: true do
def
disable_http_protocol
def
disable_http_protocol
visit
admin_application_settings_path
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'
click_on
'Save'
end
end
def
disable_ssh_protocol
def
disable_ssh_protocol
visit
admin_application_settings_path
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'
click_on
'Save'
end
end
end
end
spec/lib/gitlab/git_access_spec.rb
View file @
fbaabb39
...
@@ -70,7 +70,7 @@ describe Gitlab::GitAccess, lib: true do
...
@@ -70,7 +70,7 @@ describe Gitlab::GitAccess, lib: true do
describe
'#check with single protocols allowed'
do
describe
'#check with single protocols allowed'
do
def
disable_protocol
(
protocol
)
def
disable_protocol
(
protocol
)
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
.
update_attribute
(
:enabled_git_access_protocol
s
,
protocol
)
settings
.
update_attribute
(
:enabled_git_access_protocol
,
protocol
)
end
end
context
'ssh disabled'
do
context
'ssh disabled'
do
...
...
spec/requests/api/internal_spec.rb
View file @
fbaabb39
...
@@ -211,7 +211,7 @@ describe API::API, api: true do
...
@@ -211,7 +211,7 @@ describe API::API, api: true do
context
'ssh access has been disabled'
do
context
'ssh access has been disabled'
do
before
do
before
do
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
.
update_attribute
(
:enabled_git_access_protocol
s
,
'http'
)
settings
.
update_attribute
(
:enabled_git_access_protocol
,
'http'
)
end
end
it
'rejects the SSH push'
do
it
'rejects the SSH push'
do
...
@@ -234,7 +234,7 @@ describe API::API, api: true do
...
@@ -234,7 +234,7 @@ describe API::API, api: true do
context
'http access has been disabled'
do
context
'http access has been disabled'
do
before
do
before
do
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
=
::
ApplicationSetting
.
create_from_defaults
settings
.
update_attribute
(
:enabled_git_access_protocol
s
,
'ssh'
)
settings
.
update_attribute
(
:enabled_git_access_protocol
,
'ssh'
)
end
end
it
'rejects the HTTP push'
do
it
'rejects the HTTP push'
do
...
@@ -257,7 +257,7 @@ describe API::API, api: true do
...
@@ -257,7 +257,7 @@ describe API::API, api: true do
context
'web actions are always allowed'
do
context
'web actions are always allowed'
do
it
'allows WEB push'
do
it
'allows WEB push'
do
settings
=
::
ApplicationSetting
.
create_from_defaults
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
]
project
.
team
<<
[
user
,
:developer
]
push
(
key
,
project
,
'web'
)
push
(
key
,
project
,
'web'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment