From 24b19152c4fde9703caaf7ab173e631e0a231a5a Mon Sep 17 00:00:00 2001 From: Pavel Korotkov Date: Tue, 21 Jul 2020 12:58:53 +0300 Subject: [PATCH] Remove aliasing --- cmd/gate/app-new-auth.go | 4 ++-- cmd/gate/app-settings.go | 8 ++++---- cmd/gate/app.go | 4 ++-- neofs/layer/gateway-neofs.go | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/gate/app-new-auth.go b/cmd/gate/app-new-auth.go index 066092c..6410193 100644 --- a/cmd/gate/app-new-auth.go +++ b/cmd/gate/app-new-auth.go @@ -4,11 +4,11 @@ import ( "net/http" "github.com/gorilla/mux" - s3auth "github.com/minio/minio/auth" + "github.com/minio/minio/auth" "go.uber.org/zap" ) -func attachNewUserAuth(router *mux.Router, center *s3auth.Center, log *zap.Logger) { +func attachNewUserAuth(router *mux.Router, center *auth.Center, log *zap.Logger) { uamw := func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { _, err := center.AuthenticationPassed(r) diff --git a/cmd/gate/app-settings.go b/cmd/gate/app-settings.go index e989505..5461f51 100644 --- a/cmd/gate/app-settings.go +++ b/cmd/gate/app-settings.go @@ -12,7 +12,7 @@ import ( "strings" "time" - s3auth "github.com/minio/minio/auth" + "github.com/minio/minio/auth" "github.com/minio/minio/neofs/pool" "github.com/pkg/errors" @@ -87,7 +87,7 @@ type empty int func (empty) Read([]byte) (int, error) { return 0, io.EOF } -func fetchAuthCenter(l *zap.Logger, v *viper.Viper) (*s3auth.Center, error) { +func fetchAuthCenter(l *zap.Logger, v *viper.Viper) (*auth.Center, error) { var ( err error neofsPrivateKey *ecdsa.PrivateKey @@ -106,11 +106,11 @@ func fetchAuthCenter(l *zap.Logger, v *viper.Viper) (*s3auth.Center, error) { } } uapk := v.GetString(cfgUserAuthPrivateKey) - userAuthPrivateKey, err = s3auth.ReadRSAPrivateKeyFromPEMFile(uapk) + userAuthPrivateKey, err = auth.ReadRSAPrivateKeyFromPEMFile(uapk) if err != nil { return nil, errors.Wrap(err, "could not load UserAuth private key") } - center := s3auth.NewCenter(l) + center := auth.NewCenter(l) center.SetUserAuthKeys(userAuthPrivateKey) center.SetNeoFSKeys(neofsPrivateKey) return center, nil diff --git a/cmd/gate/app.go b/cmd/gate/app.go index 08bff02..f7c7c1c 100644 --- a/cmd/gate/app.go +++ b/cmd/gate/app.go @@ -7,7 +7,7 @@ import ( "os" "time" - s3auth "github.com/minio/minio/auth" + "github.com/minio/minio/auth" minio "github.com/minio/minio/legacy" "github.com/minio/minio/legacy/config" "github.com/minio/minio/neofs/layer" @@ -20,7 +20,7 @@ import ( type ( App struct { - center *s3auth.Center + center *auth.Center cli pool.Pool log *zap.Logger cfg *viper.Viper diff --git a/neofs/layer/gateway-neofs.go b/neofs/layer/gateway-neofs.go index 6bf45a8..498d7b3 100644 --- a/neofs/layer/gateway-neofs.go +++ b/neofs/layer/gateway-neofs.go @@ -6,7 +6,7 @@ import ( "math" "time" - s3auth "github.com/minio/minio/auth" + auth "github.com/minio/minio/auth" minio "github.com/minio/minio/legacy" "github.com/minio/minio/neofs/pool" "github.com/nspcc-dev/neofs-api-go/refs" @@ -41,7 +41,7 @@ type ( // NewGatewayLayer creates instance of neofsObject. It checks credentials // and establishes gRPC connection with node. -func NewLayer(log *zap.Logger, cli pool.Client, center *s3auth.Center) (minio.ObjectLayer, error) { +func NewLayer(log *zap.Logger, cli pool.Client, center *auth.Center) (minio.ObjectLayer, error) { // setup gRPC connection // todo: think about getting timeout parameters from cli args ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)