mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Merge pull request #254 from openstf/optional-basic-auth-in-auth-mock
Add optional basic authentication in auth-mock
This commit is contained in:
17
lib/cli.js
17
lib/cli.js
@@ -557,6 +557,16 @@ program
|
||||
.option('-a, --app-url <url>'
|
||||
, 'URL to app'
|
||||
, String)
|
||||
.option('--use-basic-auth'
|
||||
, 'Whether to use basic authentication for login or not')
|
||||
.option('--basic-auth-username <username>'
|
||||
, 'Basic Auth Username (or $BASIC_AUTH_USERNAME)'
|
||||
, String
|
||||
, process.env.BASIC_AUTH_USERNAME || 'username')
|
||||
.option('--basic-auth-password <password>'
|
||||
, 'Basic Auth Password (or $BASIC_AUTH_PASSWORD)'
|
||||
, String
|
||||
, process.env.BASIC_AUTH_PASSWORD || 'password')
|
||||
.action(function(options) {
|
||||
if (!options.secret) {
|
||||
this.missingArgument('--secret')
|
||||
@@ -570,6 +580,13 @@ program
|
||||
, secret: options.secret
|
||||
, ssid: options.ssid
|
||||
, appUrl: options.appUrl
|
||||
, mock: {
|
||||
useBasicAuth: options.useBasicAuth
|
||||
, basicAuth: {
|
||||
username: options.basicAuthUsername
|
||||
, password: options.basicAuthPassword
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user