diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-06-18 17:18:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 17:18:44 +0800 |
commit | 1dd3f19ee381d3a3554828a37282fd75ba3073ee (patch) | |
tree | f3ef01fcc5825e28b2e57d8da8c491555ef15fe4 /modules/auth | |
parent | 03ba974481296b76f87cbd756e41ecf5be9d006b (diff) | |
download | gitea-1dd3f19ee381d3a3554828a37282fd75ba3073ee.tar.gz gitea-1dd3f19ee381d3a3554828a37282fd75ba3073ee.zip |
Use google/uuid to instead satori/go.uuid (#11943)
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/oauth2/oauth2.go | 4 | ||||
-rw-r--r-- | modules/auth/sso/reverseproxy.go | 4 | ||||
-rw-r--r-- | modules/auth/sso/sspi_windows.go | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/modules/auth/oauth2/oauth2.go b/modules/auth/oauth2/oauth2.go index a50c639885..78be3954ed 100644 --- a/modules/auth/oauth2/oauth2.go +++ b/modules/auth/oauth2/oauth2.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" + uuid "github.com/google/uuid" "github.com/lafriks/xormstore" "github.com/markbates/goth" "github.com/markbates/goth/gothic" @@ -25,7 +26,6 @@ import ( "github.com/markbates/goth/providers/openidConnect" "github.com/markbates/goth/providers/twitter" "github.com/markbates/goth/providers/yandex" - uuid "github.com/satori/go.uuid" "xorm.io/xorm" ) @@ -61,7 +61,7 @@ func Init(x *xorm.Engine) error { gothic.Store = store gothic.SetState = func(req *http.Request) string { - return uuid.NewV4().String() + return uuid.New().String() } gothic.GetProviderName = func(req *http.Request) (string, error) { 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, |