From 2bc62bb6e85524555f78deb1ea3024b48708cff5 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 9 Oct 2020 22:17:07 +0200 Subject: [PATCH] Do not test bypass auth backend --- auth/auth_test.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/auth/auth_test.go b/auth/auth_test.go index 54f2e91..2a7cfdf 100644 --- a/auth/auth_test.go +++ b/auth/auth_test.go @@ -1,24 +1,28 @@ package auth import ( + "testing" + "gitlab.crans.org/nounous/ghostream/auth/basic" "gitlab.crans.org/nounous/ghostream/auth/ldap" - "testing" ) func TestLoadConfiguration(t *testing.T) { - _, err := New(&Options{Backend: "bypass"}) - if err != nil { - t.Error("Creating bypass authentication backend failed:", err) - } - - _, err = New(&Options{Backend: "basic", Basic: basic.Options{Credentials: make(map[string]string)}}) + _, err := New(&Options{ + Enabled: true, + Backend: "basic", + Basic: basic.Options{Credentials: make(map[string]string)}, + }) if err != nil { t.Error("Creating basic authentication backend failed:", err) } - _, err = New(&Options{Backend: "ldap", LDAP: ldap.Options{URI: "ldap://127.0.0.1:389", UserDn: "cn=users,dc=example,dc=com"}}) + _, err = New(&Options{ + Enabled: true, + Backend: "ldap", + LDAP: ldap.Options{URI: "ldap://127.0.0.1:389", UserDn: "cn=users,dc=example,dc=com"}, + }) // TODO Maybe start a LDAP server? if err == nil {