diff options
Diffstat (limited to 'qa/qa/vendor')
-rw-r--r-- | qa/qa/vendor/github/page/login.rb | 6 | ||||
-rw-r--r-- | qa/qa/vendor/one_password/cli.rb | 34 | ||||
-rwxr-xr-x | qa/qa/vendor/one_password/darwin/op | bin | 0 -> 10616336 bytes | |||
-rwxr-xr-x | qa/qa/vendor/one_password/linux/op | bin | 0 -> 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 Binary files differnew file mode 100755 index 00000000000..0f646522834 --- /dev/null +++ b/qa/qa/vendor/one_password/darwin/op diff --git a/qa/qa/vendor/one_password/linux/op b/qa/qa/vendor/one_password/linux/op Binary files differnew file mode 100755 index 00000000000..47ce87731be --- /dev/null +++ b/qa/qa/vendor/one_password/linux/op |