-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate config for DB and LDAP to enable 3-backend setup. Fix Ldap u…
…ser login filter format
- Loading branch information
Rob Archibald
committed
Jan 15, 2017
1 parent
6f945a7
commit 27a190f
Showing
4 changed files
with
45 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/robarchibald/configReader" | ||
"testing" | ||
) | ||
|
||
func TestNewBackendLDAPLogin(t *testing.T) { | ||
config := &authConf{} | ||
err := configReader.ReadFile("nginxauth.conf", config) | ||
if err != nil { | ||
t.Fatal("unable to load config file", err) | ||
} | ||
|
||
l, err := NewBackendLDAPLogin(config.LdapServer, config.LdapPort, config.LdapBindDn, config.LdapPassword, config.LdapBaseDn, config.LdapUserFilter) | ||
if err != nil { | ||
t.Fatal("unable to login", err) | ||
} | ||
|
||
_, err = l.GetLogin("[email protected]", "") | ||
if err == nil { | ||
t.Fatal("Expected no results", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters