Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2b49fca7
Commit
2b49fca7
authored
Sep 30, 2019
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 1p cli to pull otp for GitHub OAuth
and add the requried environment variables
parent
45811f91
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
2 deletions
+61
-2
qa/qa.rb
qa/qa.rb
+4
-0
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+16
-0
qa/qa/specs/features/browser_ui/1_manage/login/login_via_oauth_spec.rb
...eatures/browser_ui/1_manage/login/login_via_oauth_spec.rb
+1
-2
qa/qa/vendor/github/page/login.rb
qa/qa/vendor/github/page/login.rb
+6
-0
qa/qa/vendor/one_password/cli.rb
qa/qa/vendor/one_password/cli.rb
+34
-0
qa/qa/vendor/one_password/darwin/op
qa/qa/vendor/one_password/darwin/op
+0
-0
qa/qa/vendor/one_password/linux/op
qa/qa/vendor/one_password/linux/op
+0
-0
No files found.
qa/qa.rb
View file @
2b49fca7
...
...
@@ -435,6 +435,10 @@ module QA
autoload
:Login
,
'qa/vendor/github/page/login'
end
end
module
OnePassword
autoload
:CLI
,
'qa/vendor/one_password/cli'
end
end
# Classes that provide support to other parts of the framework.
...
...
qa/qa/runtime/env.rb
View file @
2b49fca7
...
...
@@ -177,6 +177,22 @@ module QA
ENV
[
'GITLAB_QA_PASSWORD_6'
]
end
def
gitlab_qa_1p_email
ENV
[
'GITLAB_QA_1P_EMAIL'
]
end
def
gitlab_qa_1p_password
ENV
[
'GITLAB_QA_1P_PASSWORD'
]
end
def
gitlab_qa_1p_secret
ENV
[
'GITLAB_QA_1P_SECRET'
]
end
def
gitlab_qa_1p_github_uuid
ENV
[
'GITLAB_QA_1P_GITHUB_UUID'
]
end
def
knapsack?
!!
(
ENV
[
'KNAPSACK_GENERATE_REPORT'
]
||
ENV
[
'KNAPSACK_REPORT_PATH'
]
||
ENV
[
'KNAPSACK_TEST_FILE_PATTERN'
])
end
...
...
qa/qa/specs/features/browser_ui/1_manage/login/login_via_oauth_spec.rb
View file @
2b49fca7
# frozen_string_literal: true
module
QA
# Failure issue: https://gitlab.com/gitlab-org/quality/nightly/issues/121
context
'Manage'
,
:orchestrated
,
:oauth
,
:quarantine
do
context
'Manage'
,
:orchestrated
,
:oauth
do
describe
'OAuth login'
do
it
'User logs in to GitLab with GitHub OAuth'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
...
...
qa/qa/vendor/github/page/login.rb
View file @
2b49fca7
...
...
@@ -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
...
...
qa/qa/vendor/one_password/cli.rb
0 → 100644
View file @
2b49fca7
# 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
qa/qa/vendor/one_password/darwin/op
0 → 100755
View file @
2b49fca7
File added
qa/qa/vendor/one_password/linux/op
0 → 100755
View file @
2b49fca7
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment