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

@@ -10,10 +10,10 @@ import (
"net/http"
"strconv"
"github.com/sirupsen/logrus"
"golang.org/x/oauth2"
"github.com/dexidp/dex/connector"
"github.com/dexidp/dex/pkg/log"
)
const (
@@ -42,7 +42,7 @@ type gitlabUser struct {
}
// Open returns a strategy for logging in through GitLab.
func (c *Config) Open(id string, logger logrus.FieldLogger) (connector.Connector, error) {
func (c *Config) Open(id string, logger log.Logger) (connector.Connector, error) {
if c.BaseURL == "" {
c.BaseURL = "https://gitlab.com"
}
@@ -71,7 +71,7 @@ type gitlabConnector struct {
org string
clientID string
clientSecret string
logger logrus.FieldLogger
logger log.Logger
}
func (c *gitlabConnector) oauth2Config(scopes connector.Scopes) *oauth2.Config {