Add logger interface and stop relying on Logrus directly

This commit is contained in:
Mark Sagi-Kazar
2019-02-22 13:19:23 +01:00
parent ca66289077
commit be581fa7ff
38 changed files with 203 additions and 133 deletions

View File

@@ -4,7 +4,7 @@ import (
"errors"
"strings"
"github.com/sirupsen/logrus"
"github.com/dexidp/dex/pkg/log"
)
// Tests for this code are in the "memory" package, since this package doesn't
@@ -89,11 +89,11 @@ type staticPasswordsStorage struct {
// A map of passwords that is indexed by lower-case email ids
passwordsByEmail map[string]Password
logger logrus.FieldLogger
logger log.Logger
}
// WithStaticPasswords returns a storage with a read-only set of passwords.
func WithStaticPasswords(s Storage, staticPasswords []Password, logger logrus.FieldLogger) Storage {
func WithStaticPasswords(s Storage, staticPasswords []Password, logger log.Logger) Storage {
passwordsByEmail := make(map[string]Password, len(staticPasswords))
for _, p := range staticPasswords {
//Enable case insensitive email comparison.