mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Add UI to LDAP login.
This commit is contained in:
parent
01339b089e
commit
9119dcca63
15 changed files with 291 additions and 14 deletions
23
lib/cli.js
23
lib/cli.js
|
@ -194,6 +194,9 @@ program
|
|||
, 'session SSID (or $SSID)'
|
||||
, String
|
||||
, process.env.SSID || 'ssid')
|
||||
.option('-a, --app-url <url>'
|
||||
, 'URL to app'
|
||||
, String)
|
||||
.option('-u, --ldap-url <url>'
|
||||
, 'LDAP server URL (or $LDAP_URL)'
|
||||
, String
|
||||
|
@ -202,6 +205,10 @@ program
|
|||
, 'LDAP timeout (or $LDAP_TIMEOUT)'
|
||||
, Number
|
||||
, process.env.LDAP_TIMEOUT || 1000)
|
||||
.option('--ldap-bind-enable <dn>'
|
||||
, 'LDAP bind DN (or $LDAP_BIND_DN)'
|
||||
, String
|
||||
, process.env.LDAP_BIND_DN)
|
||||
.option('--ldap-bind-dn <dn>'
|
||||
, 'LDAP bind DN (or $LDAP_BIND_DN)'
|
||||
, String
|
||||
|
@ -221,12 +228,24 @@ program
|
|||
.option('--ldap-search-class <class>'
|
||||
, 'LDAP search objectClass (or $LDAP_SEARCH_CLASS)'
|
||||
, String
|
||||
, process.env.LDAP_SEARCH_CLASS || 'user')
|
||||
, process.env.LDAP_SEARCH_CLASS || 'top')
|
||||
.option('--ldap-search-field <name>'
|
||||
, 'LDAP search field (or $LDAP_SEARCH_FIELD)'
|
||||
, String
|
||||
, process.env.LDAP_SEARCH_FIELD)
|
||||
.action(function(options) {
|
||||
if (!options.secret) {
|
||||
this.missingArgument('--secret')
|
||||
}
|
||||
if (!options.appUrl) {
|
||||
this.missingArgument('--app-url')
|
||||
}
|
||||
|
||||
require('./roles/auth/ldap')({
|
||||
port: options.port
|
||||
, secret: options.secret
|
||||
, ssid: options.ssid
|
||||
, appUrl: options.appUrl
|
||||
, ldap: {
|
||||
url: options.ldapUrl
|
||||
, timeout: options.ldapTimeout
|
||||
|
@ -238,7 +257,7 @@ program
|
|||
dn: options.ldapSearchDn
|
||||
, scope: options.ldapSearchScope
|
||||
, objectClass: options.ldapSearchClass
|
||||
, loginField: options.ldapSearchLoginField
|
||||
, field: options.ldapSearchField
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue