summaryrefslogtreecommitdiff
path: root/qa/qa/vendor
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-30 09:06:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-30 09:06:31 +0000
commit94611567bd03083e0ecef7a582a174aa34844482 (patch)
tree5c720fd3bc8b244491a4c4d1303348ba2b6128f9 /qa/qa/vendor
parent42572f63eab5db8dc39279e0deeeadef86180a71 (diff)
downloadgitlab-ce-94611567bd03083e0ecef7a582a174aa34844482.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/vendor')
-rw-r--r--qa/qa/vendor/github/page/login.rb6
-rw-r--r--qa/qa/vendor/one_password/cli.rb34
-rwxr-xr-xqa/qa/vendor/one_password/darwin/opbin0 -> 10616336 bytes
-rwxr-xr-xqa/qa/vendor/one_password/linux/opbin0 -> 9003392 bytes
4 files changed, 40 insertions, 0 deletions
diff --git a/qa/qa/vendor/github/page/login.rb b/qa/qa/vendor/github/page/login.rb
index 120ba6e6c06..f6e72bb01f9 100644
--- a/qa/qa/vendor/github/page/login.rb
+++ b/qa/qa/vendor/github/page/login.rb
@@ -12,6 +12,12 @@ module QA
fill_in 'password', with: QA::Runtime::Env.github_password
click_on 'Sign in'
+ otp = OnePassword::CLI.new.otp
+
+ fill_in 'otp', with: otp
+
+ click_on 'Verify'
+
click_on 'Authorize gitlab-qa' if has_button?('Authorize gitlab-qa')
end
end
diff --git a/qa/qa/vendor/one_password/cli.rb b/qa/qa/vendor/one_password/cli.rb
new file mode 100644
index 00000000000..3cb69391783
--- /dev/null
+++ b/qa/qa/vendor/one_password/cli.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+module QA
+ module Vendor
+ module OnePassword
+ class CLI
+ def initialize
+ @email = QA::Runtime::Env.gitlab_qa_1p_email
+ @password = QA::Runtime::Env.gitlab_qa_1p_password
+ @secret = QA::Runtime::Env.gitlab_qa_1p_secret
+ @github_uuid = QA::Runtime::Env.gitlab_qa_1p_github_uuid
+ end
+
+ def otp
+ `#{op_path} get totp #{@github_uuid} --session=#{session_token}`.to_i
+ end
+
+ private
+
+ def session_token
+ `echo '#{@password}' | #{op_path} signin gitlab.1password.com #{@email} #{@secret} --output=raw --shorthand=gitlab_qa`
+ end
+
+ def op_path
+ File.expand_path(File.join(%W[qa vendor one_password #{os} op]))
+ end
+
+ def os
+ RUBY_PLATFORM.include?("darwin") ? "darwin" : "linux"
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/vendor/one_password/darwin/op b/qa/qa/vendor/one_password/darwin/op
new file mode 100755
index 00000000000..0f646522834
--- /dev/null
+++ b/qa/qa/vendor/one_password/darwin/op
Binary files differ
diff --git a/qa/qa/vendor/one_password/linux/op b/qa/qa/vendor/one_password/linux/op
new file mode 100755
index 00000000000..47ce87731be
--- /dev/null
+++ b/qa/qa/vendor/one_password/linux/op
Binary files differ