diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-06 06:12:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-06 06:12:45 +0300 |
commit | 81e0e55a182eb01ad174fb2b50913eec48c52ca7 (patch) | |
tree | 65a76a5049d5ebc6b785e8664d995dcb4c21724f | |
parent | 85c68f14bf3ec5fa77cf12633d33abfd2b9fd9e6 (diff) |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | app/services/import/validate_remote_git_endpoint_service.rb | 2 | ||||
-rw-r--r-- | doc/security/reset_user_password.md | 2 | ||||
-rw-r--r-- | doc/security/ssh_keys_restrictions.md | 2 | ||||
-rw-r--r-- | doc/security/token_overview.md | 2 | ||||
-rw-r--r-- | doc/security/two_factor_authentication.md | 2 | ||||
-rw-r--r-- | doc/security/user_email_confirmation.md | 2 | ||||
-rw-r--r-- | doc/security/user_file_uploads.md | 2 | ||||
-rw-r--r-- | doc/system_hooks/system_hooks.md | 2 | ||||
-rw-r--r-- | spec/features/projects/settings/monitor_settings_spec.rb | 23 | ||||
-rw-r--r-- | spec/services/import/validate_remote_git_endpoint_service_spec.rb | 8 |
10 files changed, 28 insertions, 19 deletions
diff --git a/app/services/import/validate_remote_git_endpoint_service.rb b/app/services/import/validate_remote_git_endpoint_service.rb index 47324e20348..afccb5373a9 100644 --- a/app/services/import/validate_remote_git_endpoint_service.rb +++ b/app/services/import/validate_remote_git_endpoint_service.rb @@ -21,7 +21,7 @@ module Import def execute uri = Gitlab::Utils.parse_url(@params[:url]) - return error("Invalid URL") unless uri + return ServiceResponse.error(message: "#{@params[:url]} is not a valid URL") unless uri uri.fragment = nil url = Gitlab::Utils.append_path(uri.to_s, "/info/refs?service=#{GIT_SERVICE_NAME}") diff --git a/doc/security/reset_user_password.md b/doc/security/reset_user_password.md index aee50c7d279..8b89200e1a7 100644 --- a/doc/security/reset_user_password.md +++ b/doc/security/reset_user_password.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: howto --- -# How to reset user password +# How to reset user password **(FREE SELF)** There are a few ways to reset the password of a user. diff --git a/doc/security/ssh_keys_restrictions.md b/doc/security/ssh_keys_restrictions.md index 239949b5568..1f1c7457441 100644 --- a/doc/security/ssh_keys_restrictions.md +++ b/doc/security/ssh_keys_restrictions.md @@ -27,7 +27,7 @@ the minimum key length for each technology: ![SSH keys restriction admin settings](img/ssh_keys_restrictions_settings.png) If a restriction is imposed on any key type, users cannot upload new SSH keys that don't meet the -requirement. Any existing keys that don't meet it are disabled but not removed and users cannot to +requirement. Any existing keys that don't meet it are disabled but not removed and users cannot pull or push code using them. An icon is visible to the user of a restricted key in the SSH keys section of their profile: diff --git a/doc/security/token_overview.md b/doc/security/token_overview.md index 11c04e049fa..2a971b21840 100644 --- a/doc/security/token_overview.md +++ b/doc/security/token_overview.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference --- -# GitLab Token overview +# GitLab Token overview **(FREE)** This document lists tokens used in GitLab, their purpose and, where applicable, security guidance. diff --git a/doc/security/two_factor_authentication.md b/doc/security/two_factor_authentication.md index 5e9c3df3987..61b26204599 100644 --- a/doc/security/two_factor_authentication.md +++ b/doc/security/two_factor_authentication.md @@ -44,7 +44,7 @@ Gitlab::CurrentSettings.update!('require_two_factor_authentication': false) ## Enforce 2FA for all users in a group **(FREE)** -> [Introduced in](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/24965) GitLab 12.0, 2FA settings for a group are also applied to subgroups. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/24965) in GitLab 12.0, 2FA settings for a group are also applied to subgroups. To enforce 2FA only for certain groups: diff --git a/doc/security/user_email_confirmation.md b/doc/security/user_email_confirmation.md index 09e1e09b676..48538e413b4 100644 --- a/doc/security/user_email_confirmation.md +++ b/doc/security/user_email_confirmation.md @@ -5,7 +5,7 @@ group: Access info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# User email confirmation at sign-up +# User email confirmation at sign-up **(FREE SELF)** GitLab can be configured to require confirmation of a user's email address when the user signs up. When this setting is enabled, the user is unable to sign in until diff --git a/doc/security/user_file_uploads.md b/doc/security/user_file_uploads.md index bce2aeb88b4..7a8a78cc5f8 100644 --- a/doc/security/user_file_uploads.md +++ b/doc/security/user_file_uploads.md @@ -5,7 +5,7 @@ group: Access info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# User File Uploads +# User File Uploads **(FREE)** Images that are attached to issues, merge requests, or comments do not require authentication to be viewed if they are accessed directly by URL. diff --git a/doc/system_hooks/system_hooks.md b/doc/system_hooks/system_hooks.md index 7dd0701329d..68d19365bbf 100644 --- a/doc/system_hooks/system_hooks.md +++ b/doc/system_hooks/system_hooks.md @@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w type: reference --- -# System hooks +# System hooks **(FREE SELF)** Your GitLab instance can perform HTTP POST requests on the following events: diff --git a/spec/features/projects/settings/monitor_settings_spec.rb b/spec/features/projects/settings/monitor_settings_spec.rb index a8b064c8752..3f6c4646f00 100644 --- a/spec/features/projects/settings/monitor_settings_spec.rb +++ b/spec/features/projects/settings/monitor_settings_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe 'Projects > Settings > For a forked project', :js do let_it_be(:project) { create(:project, :repository, create_templates: :issue) } - let(:user) { project.owner} + let(:user) { project.owner } before do sign_in(user) @@ -16,7 +16,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do visit project_path(project) wait_for_requests - expect(page).to have_selector('.sidebar-sub-level-items a[aria-label="Monitor"]', text: 'Monitor', visible: false) + expect(page).to have_selector('.sidebar-sub-level-items a[aria-label="Monitor"]', + text: 'Monitor', visible: :hidden) end end @@ -42,7 +43,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do expect(find_field(send_email)).to be_checked end - it 'updates form values', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/333665' do + it 'updates form values' do check(create_issue) uncheck(send_email) click_on('No template selected') @@ -52,10 +53,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do click_settings_tab expect(find_field(create_issue)).to be_checked - expect(page).to have_selector(:id, 'alert-integration-settings-issue-template', text: 'bug') - - click_settings_tab expect(find_field(send_email)).not_to be_checked + expect(page).to have_selector(:id, 'alert-integration-settings-issue-template', text: 'bug') end def click_settings_tab @@ -68,13 +67,15 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do page.within '[data-testid="alert-integration-settings"]' do click_button 'Save changes' end + + wait_for_all_requests end end - context 'error tracking settings form' do + describe 'error tracking settings form' do let(:sentry_list_projects_url) { 'http://sentry.example.com/api/0/projects/' } - context 'success path' do + context 'when project dropdown is loaded' do let(:projects_sample_response) do Gitlab::Utils.deep_indifferent_access( Gitlab::Json.parse(fixture_file('sentry/list_projects_sample_response.json')) @@ -123,7 +124,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do end end - context 'project dropdown fails to load' do + context 'when project dropdown fails to load' do before do WebMock.stub_request(:get, sentry_list_projects_url) .to_return( @@ -155,7 +156,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do end end - context 'integrated error tracking backend' do + context 'with integrated error tracking backend' do it 'successfully fills and submits the form' do visit project_settings_operations_path(project) @@ -189,7 +190,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do end end - context 'grafana integration settings form' do + describe 'grafana integration settings form' do it 'successfully fills and completes the form' do visit project_settings_operations_path(project) diff --git a/spec/services/import/validate_remote_git_endpoint_service_spec.rb b/spec/services/import/validate_remote_git_endpoint_service_spec.rb index 97c8a9f5dd4..fbd8a3cb323 100644 --- a/spec/services/import/validate_remote_git_endpoint_service_spec.rb +++ b/spec/services/import/validate_remote_git_endpoint_service_spec.rb @@ -46,6 +46,14 @@ RSpec.describe Import::ValidateRemoteGitEndpointService do expect(result.message).to eq(error_message) end + it 'reports error when invalid URL is provided' do + result = described_class.new(url: 1).execute + + expect(result).to be_a(ServiceResponse) + expect(result.error?).to be(true) + expect(result.message).to eq('1 is not a valid URL') + end + it 'reports error when required header is missing' do stub_full_request(endpoint_url, method: :get).to_return(valid_response.merge({ headers: nil })) |