From c55f17ea64115779159a6efd24c1d71f6f172890 Mon Sep 17 00:00:00 2001 From: Maik Brauer Date: Tue, 5 Jan 2021 17:10:57 +0100 Subject: [PATCH] Adapted recommendation from Maintainer for PR #1888 Signed-off-by: Maik Brauer --- connector/microsoft/microsoft.go | 8 ++++---- go.mod | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/connector/microsoft/microsoft.go b/connector/microsoft/microsoft.go index 0d823270..f88c5dab 100644 --- a/connector/microsoft/microsoft.go +++ b/connector/microsoft/microsoft.go @@ -52,7 +52,7 @@ type Config struct { Groups []string `json:"groups"` GroupNameFormat GroupNameFormat `json:"groupNameFormat"` UseGroupsAsWhitelist bool `json:"useGroupsAsWhitelist"` - UpnToLowercase bool `json:"upnToLowercase"` + emailToLowercase bool `json:"emailToLowercase"` } // Open returns a strategy for logging in through Microsoft. @@ -69,7 +69,7 @@ func (c *Config) Open(id string, logger log.Logger) (connector.Connector, error) groupNameFormat: c.GroupNameFormat, useGroupsAsWhitelist: c.UseGroupsAsWhitelist, logger: logger, - upnToLowercase: c.UpnToLowercase, + emailToLowercase: c.EmailToLowercase, } // By default allow logins from both personal and business/school // accounts. @@ -112,7 +112,7 @@ type microsoftConnector struct { groups []string useGroupsAsWhitelist bool logger log.Logger - upnToLowercase bool + emailToLowercase bool } func (c *microsoftConnector) isOrgTenant() bool { @@ -175,7 +175,7 @@ func (c *microsoftConnector) HandleCallback(s connector.Scopes, r *http.Request) return identity, fmt.Errorf("microsoft: get user: %v", err) } - if c.upnToLowercase { + if c.emailToLowercase { user.Email = strings.ToLower(user.Email) } diff --git a/go.mod b/go.mod index 69457b3b..86a1e9c8 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,6 @@ require ( github.com/lib/pq v1.3.0 github.com/mattermost/xml-roundtrip-validator v0.0.0-20201204154048-1a8688af4cf1 github.com/mattn/go-sqlite3 v1.11.0 - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/pkg/errors v0.9.1 github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect github.com/prometheus/client_golang v1.4.0 @@ -47,7 +46,6 @@ require ( gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect gopkg.in/ldap.v2 v2.5.1 gopkg.in/square/go-jose.v2 v2.4.1 - honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc // indirect sigs.k8s.io/testing_frameworks v0.1.2 )