Remove aliasing
This commit is contained in:
parent
3870f59484
commit
24b19152c4
4 changed files with 10 additions and 10 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue