From 1dd3f19ee381d3a3554828a37282fd75ba3073ee Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 18 Jun 2020 17:18:44 +0800 Subject: Use google/uuid to instead satori/go.uuid (#11943) Co-authored-by: Lauris BH --- modules/auth/sso/reverseproxy.go | 4 ++-- modules/auth/sso/sspi_windows.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/auth/sso') diff --git a/modules/auth/sso/reverseproxy.go b/modules/auth/sso/reverseproxy.go index feb5364518..1b543ce104 100644 --- a/modules/auth/sso/reverseproxy.go +++ b/modules/auth/sso/reverseproxy.go @@ -14,7 +14,7 @@ import ( "gitea.com/macaron/macaron" "gitea.com/macaron/session" - gouuid "github.com/satori/go.uuid" + gouuid "github.com/google/uuid" ) // Ensure the struct implements the interface. @@ -92,7 +92,7 @@ func (r *ReverseProxy) newUser(ctx *macaron.Context) *models.User { return nil } - email := gouuid.NewV4().String() + "@localhost" + email := gouuid.New().String() + "@localhost" if setting.Service.EnableReverseProxyEmail { webAuthEmail := ctx.Req.Header.Get(setting.ReverseProxyAuthEmail) if len(webAuthEmail) > 0 { diff --git a/modules/auth/sso/sspi_windows.go b/modules/auth/sso/sspi_windows.go index 3153fc63cd..2bced4be28 100644 --- a/modules/auth/sso/sspi_windows.go +++ b/modules/auth/sso/sspi_windows.go @@ -17,8 +17,8 @@ import ( "gitea.com/macaron/macaron" "gitea.com/macaron/session" + gouuid "github.com/google/uuid" "github.com/quasoft/websspi" - gouuid "github.com/satori/go.uuid" ) const ( @@ -157,12 +157,12 @@ func (s *SSPI) shouldAuthenticate(ctx *macaron.Context) (shouldAuth bool) { // newUser creates a new user object for the purpose of automatic registration // and populates its name and email with the information present in request headers. func (s *SSPI) newUser(ctx *macaron.Context, username string, cfg *models.SSPIConfig) (*models.User, error) { - email := gouuid.NewV4().String() + "@localhost.localdomain" + email := gouuid.New().String() + "@localhost.localdomain" user := &models.User{ Name: username, Email: email, KeepEmailPrivate: true, - Passwd: gouuid.NewV4().String(), + Passwd: gouuid.New().String(), IsActive: cfg.AutoActivateUsers, Language: cfg.DefaultLanguage, UseCustomAvatar: true, -- cgit v1.2.3