summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-06-29 14:30:27 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-07-05 16:54:22 -0500
commitfbaabb3911c6fec25edc25bfffad94ae2a7c0e28 (patch)
treef8ec3e24dbff92c06e651e47a48c4ed47c277897
parent120a1189bfa8b2afa7a8274c5617808f88f36101 (diff)
downloadgitlab-ce-fbaabb3911c6fec25edc25bfffad94ae2a7c0e28.tar.gz
Rename `enabled_git_access_protocols` to singular.
-rw-r--r--CHANGELOG3
-rw-r--r--app/helpers/application_settings_helper.rb4
-rw-r--r--app/models/application_setting.rb2
-rw-r--r--app/views/admin/application_settings/_form.html.haml2
-rw-r--r--db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb2
-rw-r--r--lib/gitlab/protocol_access.rb4
-rw-r--r--spec/features/admin/admin_disables_git_access_protocol_spec.rb4
-rw-r--r--spec/lib/gitlab/git_access_spec.rb2
-rw-r--r--spec/requests/api/internal_spec.rb6
9 files changed, 15 insertions, 14 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 62cfc81cc0b..11dd510d802 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index 19403388dc6..6b0dde5dfe6 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -32,11 +32,11 @@ module ApplicationSettingsHelper
end
def allowed_protocols_present?
- current_application_settings.enabled_git_access_protocols.present?
+ current_application_settings.enabled_git_access_protocol.present?
end
def enabled_protocol
- case current_application_settings.enabled_git_access_protocols
+ case current_application_settings.enabled_git_access_protocol
when 'http'
gitlab_config.protocol
when 'ssh'
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 314e69fa8b6..7bf618d60b9 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -59,7 +59,7 @@ class ApplicationSetting < ActiveRecord::Base
presence: true,
inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } }
- validates :enabled_git_access_protocols,
+ 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|
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index 99bf2701f64..eb325576e4f 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -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_protocols, [['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
diff --git a/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb b/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
index c75e20880db..013904b3f4f 100644
--- a/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
+++ b/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
@@ -6,6 +6,6 @@ class AddEnabledGitAccessProtocolsToApplicationSettings < ActiveRecord::Migratio
include Gitlab::Database::MigrationHelpers
def change
- add_column :application_settings, :enabled_git_access_protocols, :string
+ add_column :application_settings, :enabled_git_access_protocol, :string
end
end
diff --git a/lib/gitlab/protocol_access.rb b/lib/gitlab/protocol_access.rb
index 836ff8a34ba..4c90654c59c 100644
--- a/lib/gitlab/protocol_access.rb
+++ b/lib/gitlab/protocol_access.rb
@@ -3,10 +3,10 @@ module Gitlab
def self.allowed?(protocol)
if protocol.to_s == 'web'
true
- elsif current_application_settings.enabled_git_access_protocols.blank?
+ elsif current_application_settings.enabled_git_access_protocol.blank?
true
else
- protocol.to_s == current_application_settings.enabled_git_access_protocols
+ protocol.to_s == current_application_settings.enabled_git_access_protocol
end
end
end
diff --git a/spec/features/admin/admin_disables_git_access_protocol_spec.rb b/spec/features/admin/admin_disables_git_access_protocol_spec.rb
index 550dcb62453..5b1c0460274 100644
--- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb
+++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb
@@ -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_protocols').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_protocols').find(:xpath, 'option[3]').select_option
+ find('#application_setting_enabled_git_access_protocol').find(:xpath, 'option[3]').select_option
click_on 'Save'
end
end
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index ddccd2d9eb3..c79ba11f782 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -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_protocols, protocol)
+ settings.update_attribute(:enabled_git_access_protocol, protocol)
end
context 'ssh disabled' do
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index 1f49cdad044..e567d36afa8 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -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_protocols, '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_protocols, '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_protocols, 'ssh')
+ settings.update_attribute(:enabled_git_access_protocol, 'ssh')
project.team << [user, :developer]
push(key, project, 'web')