mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +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:
commit
a6e783ed1d
3 changed files with 45 additions and 0 deletions
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
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue