Commit 16edda3e authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '59053-no-oauth-for-cicd-github-fe' into 'master'

Resolve "Mirroring for external CI/CD repositories should not store OAuth token"

See merge request gitlab-org/gitlab-ce!31488
parents ba67965a 56294b4e
...@@ -45,17 +45,14 @@ module ImportHelper ...@@ -45,17 +45,14 @@ module ImportHelper
end end
def import_github_authorize_message def import_github_authorize_message
_('To import GitHub repositories, you first need to authorize GitLab to access the list of your GitHub repositories:') _('To connect GitHub repositories, you first need to authorize GitLab to access the list of your GitHub repositories.')
end end
def import_github_personal_access_token_message def import_github_personal_access_token_message
personal_access_token_link = link_to _('Personal Access Token'), 'https://github.com/settings/tokens' link_url = 'https://github.com/settings/tokens'
link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: link_url }
if github_import_configured? _('Create and provide your GitHub %{link_start}Personal Access Token%{link_end}. You will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
_('Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import.').html_safe % { personal_access_token_link: personal_access_token_link }
else
_('To import GitHub repositories, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import.').html_safe % { personal_access_token_link: personal_access_token_link }
end
end end
def import_configure_github_admin_message def import_configure_github_admin_message
......
- title = has_ci_cd_only_params? ? _('Connect repositories from GitHub') : _('GitHub import') - title = _('Authenticate with GitHub')
- page_title title - page_title title
- breadcrumb_title title - breadcrumb_title title
- header_title _("Projects"), root_path - header_title _("Projects"), root_path
%h3.page-title %h2.page-title
= icon 'github', text: _('Import repositories from GitHub') = title
- if github_import_configured? %p
%p = import_github_authorize_message
= import_github_authorize_message
= link_to _('List your GitHub repositories'), status_import_github_path(ci_cd_only: params[:ci_cd_only]), class: 'btn btn-success' - if github_import_configured? && !has_ci_cd_only_params?
= link_to icon('github', text: title), status_import_github_path, class: 'btn btn-success'
%hr %hr
%p - unless github_import_configured? || has_ci_cd_only_params?
= import_github_personal_access_token_message .bs-callout.bs-callout-info
= import_configure_github_admin_message
= form_tag personal_access_token_import_github_path, method: :post, class: 'form-inline' do = form_tag personal_access_token_import_github_path, method: :post do
.form-group .form-group
= text_field_tag :personal_access_token, '', class: 'form-control append-right-8', placeholder: _('Personal Access Token'), size: 40 %label.label-bold= _('Personal Access Token')
= submit_tag _('List your GitHub repositories'), class: 'btn btn-success' = text_field_tag :personal_access_token, '', class: 'form-control', placeholder: _('e.g. %{token}') % { token: '8d3f016698e...' }
%span.form-text.text-muted
= import_github_personal_access_token_message
= render_if_exists 'import/github/ci_cd_only' = render_if_exists 'import/github/ci_cd_only'
- unless github_import_configured? .form-actions.d-flex.justify-content-end
%hr = link_to _('Cancel'), new_project_path, class: 'btn'
%p = submit_tag _('Authenticate'), class: 'btn btn-success ml-2'
= import_configure_github_admin_message
---
title: Remove oauth form from GitHub CI/CD only import authentication
merge_request: 31488
author:
type: changed
...@@ -996,9 +996,6 @@ msgstr "" ...@@ -996,9 +996,6 @@ msgstr ""
msgid "Alternate support URL for help page and help dropdown" msgid "Alternate support URL for help page and help dropdown"
msgstr "" msgstr ""
msgid "Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import."
msgstr ""
msgid "Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication" msgid "Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication"
msgstr "" msgstr ""
...@@ -1435,6 +1432,12 @@ msgstr "" ...@@ -1435,6 +1432,12 @@ msgstr ""
msgid "August" msgid "August"
msgstr "" msgstr ""
msgid "Authenticate"
msgstr ""
msgid "Authenticate with GitHub"
msgstr ""
msgid "Authentication Log" msgid "Authentication Log"
msgstr "" msgstr ""
...@@ -3431,6 +3434,9 @@ msgstr "" ...@@ -3431,6 +3434,9 @@ msgstr ""
msgid "Create a personal access token on your account to pull or push via %{protocol}." msgid "Create a personal access token on your account to pull or push via %{protocol}."
msgstr "" msgstr ""
msgid "Create and provide your GitHub %{link_start}Personal Access Token%{link_end}. You will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import."
msgstr ""
msgid "Create board" msgid "Create board"
msgstr "" msgstr ""
...@@ -6588,9 +6594,6 @@ msgstr "" ...@@ -6588,9 +6594,6 @@ msgstr ""
msgid "List your Bitbucket Server repositories" msgid "List your Bitbucket Server repositories"
msgstr "" msgstr ""
msgid "List your GitHub repositories"
msgstr ""
msgid "Live preview" msgid "Live preview"
msgstr "" msgstr ""
...@@ -11941,6 +11944,9 @@ msgstr "" ...@@ -11941,6 +11944,9 @@ msgstr ""
msgid "To add the entry manually, provide the following details to the application on your phone." msgid "To add the entry manually, provide the following details to the application on your phone."
msgstr "" msgstr ""
msgid "To connect GitHub repositories, you first need to authorize GitLab to access the list of your GitHub repositories."
msgstr ""
msgid "To define internal users, first enable new users set to external" msgid "To define internal users, first enable new users set to external"
msgstr "" msgstr ""
...@@ -11959,12 +11965,6 @@ msgstr "" ...@@ -11959,12 +11965,6 @@ msgstr ""
msgid "To help improve GitLab, we would like to periodically collect usage information. This can be changed at any time in %{settings_link_start}Settings%{link_end}. %{info_link_start}More Information%{link_end}" msgid "To help improve GitLab, we would like to periodically collect usage information. This can be changed at any time in %{settings_link_start}Settings%{link_end}. %{info_link_start}More Information%{link_end}"
msgstr "" msgstr ""
msgid "To import GitHub repositories, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import."
msgstr ""
msgid "To import GitHub repositories, you first need to authorize GitLab to access the list of your GitHub repositories:"
msgstr ""
msgid "To import an SVN repository, check out %{svn_link}." msgid "To import an SVN repository, check out %{svn_link}."
msgstr "" msgstr ""
...@@ -13496,6 +13496,9 @@ msgstr "" ...@@ -13496,6 +13496,9 @@ msgstr ""
msgid "done" msgid "done"
msgstr "" msgstr ""
msgid "e.g. %{token}"
msgstr ""
msgid "element is not a hierarchy" msgid "element is not a hierarchy"
msgstr "" msgstr ""
......
...@@ -9,7 +9,7 @@ module QA ...@@ -9,7 +9,7 @@ module QA
view 'app/views/import/github/new.html.haml' do view 'app/views/import/github/new.html.haml' do
element :personal_access_token_field, 'text_field_tag :personal_access_token' # rubocop:disable QA/ElementWithPattern element :personal_access_token_field, 'text_field_tag :personal_access_token' # rubocop:disable QA/ElementWithPattern
element :list_repos_button, "submit_tag _('List your GitHub repositories')" # rubocop:disable QA/ElementWithPattern element :authenticate_button, "submit_tag _('Authenticate')" # rubocop:disable QA/ElementWithPattern
end end
view 'app/assets/javascripts/import_projects/components/provider_repo_table_row.vue' do view 'app/assets/javascripts/import_projects/components/provider_repo_table_row.vue' do
......
...@@ -280,7 +280,7 @@ describe 'New project' do ...@@ -280,7 +280,7 @@ describe 'New project' do
end end
it 'shows import instructions' do it 'shows import instructions' do
expect(page).to have_content('Import repositories from GitHub') expect(page).to have_content('Authenticate with GitHub')
expect(current_path).to eq new_import_github_path expect(current_path).to eq new_import_github_path
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment