diff --git a/Dockerfile b/Dockerfile index 8f45dce9..94847f35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,12 @@ RUN set -x \ && export GOGC=off \ && export CGO_ENABLED=0 \ && [ -d "./vendor" ] || go mod vendor \ - && go build -v -mod=vendor -trimpath -gcflags "all=-N -l" -ldflags "${LDFLAGS}" -o /go/bin/neofs-s3 ./cmd/gate \ + && go build \ + -v \ + -mod=vendor \ + -trimpath \ + -ldflags "${LDFLAGS}" \ + -o /go/bin/neofs-s3 ./cmd/gate \ && upx -3 /go/bin/neofs-s3 # Executable image @@ -28,8 +33,7 @@ FROM scratch WORKDIR / -COPY --from=builder /go/bin/neofs-s3 /usr/bin/neofs-s3 +COPY --from=builder /go/bin/neofs-s3 /bin/neofs-s3 COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -# Run delve -CMD ["/usr/bin/neofs-s3"] +ENTRYPOINT ["/bin/neofs-s3"] diff --git a/Makefile b/Makefile index bc6474f0..94597d46 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ help: # Show current version version: - @echo $(VERSION) + @echo $(BUILD_VERSION) # Reformat code format: @@ -38,6 +38,6 @@ deps: image-build: @echo "⇒ Build docker-image" @docker build \ - --build-arg VERSION=$(VERSION) \ + --build-arg VERSION=$(BUILD_VERSION) \ -f Dockerfile \ - -t nspccdev/neofs-s3-gate:$(VERSION) . \ No newline at end of file + -t nspccdev/neofs-s3-gate:$(BUILD_VERSION) . \ No newline at end of file diff --git a/README.md b/README.md index 00458113..d0170f54 100644 --- a/README.md +++ b/README.md @@ -16,45 +16,104 @@ --rebalance_timer duration set gRPC connection rebalance timer (default 15s) --max_clients_count int set max-clients count (default 100) --max_clients_deadline duration set max-clients deadline (default 30s) - -t, --con_ttl duration set gRPC connection time to live (default 5m0s) --listen_address string set address to listen (default "0.0.0.0:8080") -p, --peers stringArray set NeoFS nodes # Environments -S3_AUTH-KEY = -S3_CON_TTL = 5m0s -S3_CONNECT_TIMEOUT = 30s -S3_KEEPALIVE_PERMIT_WITHOUT_STREAM = true -S3_KEEPALIVE_TIME = 10s -S3_KEEPALIVE_TIMEOUT = 10s -S3_LISTEN_ADDRESS = 0.0.0.0:8080 -S3_LOGGER_FORMAT = console -S3_LOGGER_LEVEL = debug -S3_LOGGER_NO_DISCLAIMER = true -S3_LOGGER_SAMPLING_INITIAL = 1000 -S3_LOGGER_SAMPLING_THEREAFTER = 1000 -S3_LOGGER_TRACE_LEVEL = panic -S3_MAX_CLIENTS_COUNT = 100 -S3_MAX_CLIENTS_DEADLINE = 30s -S3_METRICS = false -S3_NEOFS-KEY = generated -S3_PPROF = false -S3_REBALANCE_TIMER = 15s -S3_REQUEST_TIMEOUT = 15s -S3_VERBOSE = false +S3_GW_AUTH-KEY = +S3_GW_NEOFS-KEY = +S3_GW_CONNECT_TIMEOUT = 30s +S3_GW_REBALANCE_TIMER = 15s +S3_GW_REQUEST_TIMEOUT = 15s +S3_GW_KEEPALIVE_PERMIT_WITHOUT_STREAM = true +S3_GW_KEEPALIVE_TIME = 10s +S3_GW_KEEPALIVE_TIMEOUT = 10s +S3_GW_LISTEN_ADDRESS = 0.0.0.0:8080 +S3_GW_LOGGER_FORMAT = console +S3_GW_LOGGER_LEVEL = debug +S3_GW_LOGGER_NO_DISCLAIMER = true +S3_GW_LOGGER_SAMPLING_INITIAL = 1000 +S3_GW_LOGGER_SAMPLING_THEREAFTER = 1000 +S3_GW_LOGGER_TRACE_LEVEL = panic +S3_GW_MAX_CLIENTS_COUNT = 100 +S3_GW_MAX_CLIENTS_DEADLINE = 30s +S3_GW_METRICS = false +S3_GW_PPROF = false +S3_GW_VERBOSE = false # Peers preset -S3_PEERS_[N]_ADDRESS = string -S3_PEERS_[N]_WEIGHT = 0..1 (float) -``` +S3_GW_PEERS_[N]_ADDRESS = string +S3_GW_PEERS_[N]_WEIGHT = 0..1 (float) +``` ---- - +### Bucket/Object-Level Actions + +| # | Method Name | Status | +|:---:| ------------------------- | ----------------------- | +| 1 | AbortMultipartUpload | Unsupported | +| 2 | CompleteMultipartUpload | Unsupported | +| 3 | CopyObject | Supported | +| 4 | CopyObjectPart | Unsupported | +| 5 | DeleteBucket | Unsupported | +| 6 | DeleteBucketEncryption | Unsupported | +| 7 | DeleteBucketLifecycle | Unsupported | +| 8 | DeleteBucketPolicy | Unsupported | +| 9 | DeleteBucketTagging | Unsupported | +| 10 | DeleteBucketWebsite | Unsupported | +| 11 | DeleteMultipleObjects | Supported | +| 12 | DeleteObject | Supported | +| 13 | DeleteObjectTagging | Unsupported | +| 14 | GetBucketACL | Unsupported | +| 15 | GetBucketAccelerate | Supported | +| 16 | GetBucketCors | Unsupported | +| 17 | GetBucketEncryption | Unsupported | +| 18 | GetBucketLifecycle | Unsupported | +| 19 | GetBucketLocation | Unsupported | +| 20 | GetBucketLogging | Unsupported | +| 21 | GetBucketNotification | Unsupported | +| 22 | GetBucketObjectLockConfig | Unsupported | +| 23 | GetBucketPolicy | Unsupported | +| 24 | GetBucketReplication | Unsupported | +| 25 | GetBucketRequestPayment | Unsupported | +| 26 | GetBucketTagging | Unsupported | +| 27 | GetBucketVersioning | Unsupported | +| 28 | GetBucketWebsite | Unsupported | +| 29 | GetObject | Supported | +| 30 | GetObjectACL | Unsupported | +| 31 | GetObjectLegalHold | Unsupported | +| 32 | GetObjectRetention | Unsupported | +| 33 | HeadBucket | Supported | +| 34 | HeadObject | Supported | +| 35 | ListBucketObjectVersions | Unsupported | +| 36 | ListBuckets | Supported | +| 37 | ListMultipartUploads | Unsupported | +| 38 | ListObjectParts | Unsupported | +| 39 | ListObjectsV1 | Supported | +| 40 | ListObjectsV2 | Supported | +| 41 | ListenBucketNotification | Unsupported | +| 42 | NewMultipartUpload | Unsupported | +| 43 | PostPolicyBucket | Unsupported | +| 44 | PutBucket | Unsupported | +| 45 | PutBucketACL | Unsupported | +| 46 | PutBucketEncryption | Unsupported | +| 47 | PutBucketLifecycle | Unsupported | +| 48 | PutBucketNotification | Unsupported | +| 49 | PutBucketObjectLockConfig | Unsupported | +| 50 | PutBucketPolicy | Unsupported | +| 51 | PutBucketTagging | Unsupported | +| 52 | PutBucketVersioning | Unsupported | +| 53 | PutObject | Supported | +| 54 | PutObjectACL | Unsupported | +| 55 | PutObjectLegalHold | Unsupported | +| 56 | PutObjectPart | Unsupported | +| 57 | PutObjectRetention | Unsupported | +| 58 | PutObjectTagging | Unsupported | +| 59 | SelectObjectContent | Unsupported | + diff --git a/api/auth/center.go b/api/auth/center.go new file mode 100644 index 00000000..449eaf3b --- /dev/null +++ b/api/auth/center.go @@ -0,0 +1,161 @@ +package auth + +import ( + "context" + "fmt" + "io" + "net/http" + "regexp" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws/credentials" + v4 "github.com/aws/aws-sdk-go/aws/signer/v4" + sdk "github.com/nspcc-dev/cdn-neofs-sdk" + "github.com/nspcc-dev/cdn-neofs-sdk/creds/bearer" + "github.com/nspcc-dev/cdn-neofs-sdk/creds/hcs" + "github.com/nspcc-dev/cdn-neofs-sdk/creds/s3" + "github.com/nspcc-dev/neofs-api-go/pkg/object" + "github.com/nspcc-dev/neofs-api-go/pkg/token" + "github.com/pkg/errors" + "go.uber.org/zap" +) + +var authorizationFieldRegexp = regexp.MustCompile(`AWS4-HMAC-SHA256 Credential=(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]*)/(?P[^/]+)/aws4_request,\s*SignedHeaders=(?P.+),\s*Signature=(?P.+)`) + +type ( + Center interface { + Authenticate(request *http.Request) (*token.BearerToken, error) + } + + center struct { + reg *regexpSubmatcher + cli bearer.Credentials + } + + Params struct { + Client sdk.Client + Logger *zap.Logger + Credential hcs.Credentials + } + + prs int +) + +func (p prs) Read(_ []byte) (n int, err error) { + panic("implement me") +} + +func (p prs) Seek(_ int64, _ int) (int64, error) { + panic("implement me") +} + +var _ io.ReadSeeker = prs(0) + +// New creates an instance of AuthCenter. +func New(obj sdk.ObjectClient, key hcs.PrivateKey) Center { + return ¢er{ + cli: bearer.New(obj, key), + reg: ®expSubmatcher{re: authorizationFieldRegexp}, + } +} + +func (c *center) Authenticate(r *http.Request) (*token.BearerToken, error) { + queryValues := r.URL.Query() + if queryValues.Get("X-Amz-Algorithm") == "AWS4-HMAC-SHA256" { + return nil, errors.New("pre-signed form of request is not supported") + } + + authHeaderField := r.Header["Authorization"] + if len(authHeaderField) != 1 { + return nil, errors.New("unsupported request: wrong length of Authorization header field") + } + + // { // to debug request + // data, _ := httputil.DumpRequest(r, false) + // fmt.Println(string(data)) + // } + + sms1 := c.reg.getSubmatches(authHeaderField[0]) + if len(sms1) != 7 { + return nil, errors.New("bad Authorization header field") + } + + signedHeaderFieldsNames := strings.Split(sms1["signed_header_fields"], ";") + if len(signedHeaderFieldsNames) == 0 { + return nil, errors.New("wrong format of signed headers part") + } + + signatureDateTime, err := time.Parse("20060102T150405Z", r.Header.Get("X-Amz-Date")) + if err != nil { + return nil, errors.Wrap(err, "failed to parse x-amz-date header field") + } + + accessKeyID := fmt.Sprintf("%s/%s", sms1["access_key_id_cid"], sms1["access_key_id_oid"]) + + address := object.NewAddress() + if err = address.Parse(accessKeyID); err != nil { + return nil, errors.Wrapf(err, "could not parse AccessBox address: %s", accessKeyID) + } + + tkn, err := c.cli.Get(r.Context(), address) + if err != nil { + return nil, err + } + + secret, err := s3.SecretAccessKey(tkn) + if err != nil { + return nil, err + } + + otherRequest := r.Clone(context.TODO()) + otherRequest.Header = map[string][]string{} + + for hfn, hfvs := range r.Header { + for _, shfn := range signedHeaderFieldsNames { + if strings.EqualFold(hfn, shfn) { + otherRequest.Header[hfn] = hfvs + } + } + } + + awsCreds := credentials.NewStaticCredentials(accessKeyID, secret, "") + signer := v4.NewSigner(awsCreds) + + // body, err := readAndKeepBody(r) + // if err != nil { + // return nil, errors.Wrap(err, "failed to read out request body") + // } + // + // _ = body + + // body not required + if _, err := signer.Sign(otherRequest, nil, sms1["service"], sms1["region"], signatureDateTime); err != nil { + return nil, errors.Wrap(err, "failed to sign temporary HTTP request") + } + + sms2 := c.reg.getSubmatches(otherRequest.Header.Get("Authorization")) + if sms1["v4_signature"] != sms2["v4_signature"] { + return nil, errors.New("failed to pass authentication procedure") + } + + return tkn, nil +} + +// for debug reasons +// func panicSeeker() io.ReadSeeker { return prs(0) } + +// TODO: Make this write into a smart buffer backed by a file on a fast drive. +// func readAndKeepBody(request *http.Request) (*bytes.Reader, error) { +// if request.Body == nil { +// return new(bytes.Reader), nil +// } +// +// payload, err := ioutil.ReadAll(request.Body) +// if err != nil { +// return nil, err +// } +// +// request.Body = ioutil.NopCloser(bytes.NewReader(payload)) +// return bytes.NewReader(payload), nil +// } diff --git a/api/auth/regexp-utils.go b/api/auth/regexp-utils.go new file mode 100644 index 00000000..1e9b2dde --- /dev/null +++ b/api/auth/regexp-utils.go @@ -0,0 +1,20 @@ +package auth + +import "regexp" + +type regexpSubmatcher struct { + re *regexp.Regexp +} + +func (r *regexpSubmatcher) getSubmatches(target string) map[string]string { + matches := r.re.FindStringSubmatch(target) + l := len(matches) + + sub := make(map[string]string, l) + for i, name := range r.re.SubexpNames() { + if i > 0 && i <= l { + sub[name] = matches[i] + } + } + return sub +} diff --git a/api/handler/get.go b/api/handler/get.go index b2adadaa..9bce8ac3 100644 --- a/api/handler/get.go +++ b/api/handler/get.go @@ -1,8 +1,10 @@ package handler import ( + "io" "net/http" "strconv" + "sync" "github.com/gorilla/mux" "github.com/nspcc-dev/neofs-s3-gate/api" @@ -10,6 +12,31 @@ import ( "go.uber.org/zap" ) +type ( + detector struct { + io.Writer + sync.Once + + contentType string + } +) + +func newDetector(w io.Writer) *detector { + return &detector{Writer: w} +} + +func (d *detector) Write(data []byte) (int, error) { + d.Once.Do(func() { + if rw, ok := d.Writer.(http.ResponseWriter); ok { + rw.WriteHeader(http.StatusOK) + } + + d.contentType = http.DetectContentType(data) + }) + + return d.Writer.Write(data) +} + func (h *handler) GetObjectHandler(w http.ResponseWriter, r *http.Request) { var ( err error @@ -37,10 +64,12 @@ func (h *handler) GetObjectHandler(w http.ResponseWriter, r *http.Request) { return } + writer := newDetector(w) + params := &layer.GetObjectParams{ Bucket: inf.Bucket, Object: inf.Name, - Writer: w, + Writer: writer, } // params.Length = inf.Size @@ -61,9 +90,7 @@ func (h *handler) GetObjectHandler(w http.ResponseWriter, r *http.Request) { return } - w.Header().Set("Content-Type", inf.ContentType) + w.Header().Set("Content-Type", writer.contentType) w.Header().Set("Last-Modified", inf.Created.Format(http.TimeFormat)) w.Header().Set("Content-Length", strconv.FormatInt(inf.Size, 10)) - - w.WriteHeader(http.StatusOK) } diff --git a/api/handler/list.go b/api/handler/list.go index de0e5ec7..5fd6247a 100644 --- a/api/handler/list.go +++ b/api/handler/list.go @@ -6,10 +6,8 @@ import ( "time" "github.com/nspcc-dev/neofs-api-go/pkg/owner" - "github.com/nspcc-dev/neofs-api-go/pkg/token" "github.com/nspcc-dev/neofs-s3-gate/api" "github.com/nspcc-dev/neofs-s3-gate/api/layer" - "github.com/nspcc-dev/neofs-s3-gate/auth" "go.uber.org/zap" ) @@ -29,37 +27,10 @@ func (h *handler) ListBucketsHandler(w http.ResponseWriter, r *http.Request) { var ( err error own = owner.NewID() - tkn *token.BearerToken res *ListBucketsResponse rid = api.GetRequestID(r.Context()) ) - if tkn, err = auth.GetBearerToken(r.Context()); err != nil { - h.log.Error("something went wrong", - zap.String("request_id", rid), - zap.Error(err)) - - api.WriteErrorResponse(r.Context(), w, api.Error{ - Code: api.GetAPIError(api.ErrInternalError).Code, - Description: err.Error(), - HTTPStatusCode: http.StatusInternalServerError, - }, r.URL) - - return - } else if own, err = layer.GetOwnerID(tkn); err != nil { - h.log.Error("something went wrong", - zap.String("request_id", rid), - zap.Error(err)) - - api.WriteErrorResponse(r.Context(), w, api.Error{ - Code: api.GetAPIError(api.ErrBadRequest).Code, - Description: err.Error(), - HTTPStatusCode: http.StatusBadRequest, - }, r.URL) - - return - } - list, err := h.obj.ListBuckets(r.Context()) if err != nil { h.log.Error("something went wrong", diff --git a/api/handler/put.go b/api/handler/put.go index 835aa28d..c65dcee4 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -30,20 +30,6 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) { HTTPStatusCode: http.StatusBadRequest, }, r.URL) - return - } else if _, err = h.obj.GetObjectInfo(r.Context(), bkt, obj); err == nil { - h.log.Error("object exists", - zap.String("request_id", rid), - zap.String("bucket_name", bkt), - zap.String("object_name", obj), - zap.Error(err)) - - api.WriteErrorResponse(r.Context(), w, api.Error{ - Code: api.GetAPIError(api.ErrMethodNotAllowed).Code, - Description: "Object: " + bkt + "#" + obj + " already exists", - HTTPStatusCode: http.StatusBadRequest, - }, r.URL) - return } diff --git a/api/layer/container.go b/api/layer/container.go index 3c0041ee..bdfe3e1b 100644 --- a/api/layer/container.go +++ b/api/layer/container.go @@ -5,11 +5,9 @@ import ( "strconv" "time" - "github.com/nspcc-dev/neofs-api-go/pkg/client" "github.com/nspcc-dev/neofs-api-go/pkg/container" "github.com/nspcc-dev/neofs-api-go/pkg/owner" "github.com/nspcc-dev/neofs-s3-gate/api" - "github.com/nspcc-dev/neofs-s3-gate/auth" "go.uber.org/zap" ) @@ -32,6 +30,8 @@ type ( func (n *layer) containerInfo(ctx context.Context, cid *container.ID) (*BucketInfo, error) { var ( + err error + res *container.Container rid = api.GetRequestID(ctx) info = &BucketInfo{ @@ -40,29 +40,7 @@ func (n *layer) containerInfo(ctx context.Context, cid *container.ID) (*BucketIn } ) - bearer, err := auth.GetBearerToken(ctx) - if err != nil { - n.log.Error("could not receive bearer token", - zap.Stringer("cid", cid), - zap.String("request_id", rid), - zap.Error(err)) - return nil, err - } - - _ = bearer - - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - n.log.Error("could not prepare client", - zap.Stringer("cid", cid), - zap.String("request_id", rid), - zap.Error(err)) - - return nil, err - } - - res, err := cli.GetContainer(ctx, cid, client.WithSession(tkn)) - if err != nil { + if res, err = n.cli.Container().Get(ctx, cid); err != nil { n.log.Error("could not fetch container", zap.Stringer("cid", cid), zap.String("request_id", rid), @@ -71,14 +49,14 @@ func (n *layer) containerInfo(ctx context.Context, cid *container.ID) (*BucketIn return nil, err } - info.Owner = owner.NewIDFromV2(res.GetOwnerID()) + info.Owner = res.OwnerID() - for _, attr := range res.GetAttributes() { - switch key, val := attr.GetKey(), attr.GetValue(); key { + for _, attr := range res.Attributes() { + switch key, val := attr.Key(), attr.Value(); key { case container.AttributeName: info.Name = val case container.AttributeTimestamp: - unix, err := strconv.ParseInt(attr.GetValue(), 10, 64) + unix, err := strconv.ParseInt(attr.Value(), 10, 64) if err != nil { n.log.Error("could not parse container creation time", zap.Stringer("cid", cid), @@ -97,35 +75,14 @@ func (n *layer) containerInfo(ctx context.Context, cid *container.ID) (*BucketIn } func (n *layer) containerList(ctx context.Context) ([]*BucketInfo, error) { - rid := api.GetRequestID(ctx) - bearer, err := auth.GetBearerToken(ctx) - if err != nil { - n.log.Error("could not receive bearer token", - zap.String("request_id", rid), - zap.Error(err)) - return nil, err - } + var ( + err error + own = n.Owner(ctx) + res []*container.ID + rid = api.GetRequestID(ctx) + ) - _ = bearer - - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - n.log.Error("could not prepare client", - zap.String("request_id", rid), - zap.Error(err)) - return nil, err - } - - // own, err := GetOwnerID(bearer) - // if err != nil { - // n.log.Error("could not fetch owner id", - // zap.String("request_id", rid), - // zap.Error(err)) - // return nil, err - // } - - res, err := cli.ListContainers(ctx, tkn.OwnerID(), client.WithSession(tkn)) - if err != nil { + if res, err = n.cli.Container().List(ctx, own); err != nil { n.log.Error("could not fetch container", zap.String("request_id", rid), zap.Error(err)) diff --git a/api/layer/detector.go b/api/layer/detector.go new file mode 100644 index 00000000..3a9b7d85 --- /dev/null +++ b/api/layer/detector.go @@ -0,0 +1,26 @@ +package layer + +import ( + "io" + "net/http" + "sync" +) + +type detector struct { + io.Reader + sync.Once + + contentType string +} + +func newDetector(r io.Reader) *detector { + return &detector{Reader: r} +} + +func (d *detector) Read(data []byte) (int, error) { + d.Do(func() { + d.contentType = http.DetectContentType(data) + }) + + return d.Reader.Read(data) +} diff --git a/api/layer/layer.go b/api/layer/layer.go index a2cd0f81..a1d04561 100644 --- a/api/layer/layer.go +++ b/api/layer/layer.go @@ -2,19 +2,18 @@ package layer import ( "context" - "crypto/ecdsa" "io" "net/url" "strings" "time" - "github.com/nspcc-dev/neofs-api-go/pkg" - "github.com/nspcc-dev/neofs-api-go/pkg/client" + sdk "github.com/nspcc-dev/cdn-neofs-sdk" + "github.com/nspcc-dev/cdn-neofs-sdk/creds/neofs" + "github.com/nspcc-dev/cdn-neofs-sdk/pool" + "github.com/nspcc-dev/neofs-api-go/pkg/container" "github.com/nspcc-dev/neofs-api-go/pkg/object" "github.com/nspcc-dev/neofs-api-go/pkg/owner" - "github.com/nspcc-dev/neofs-api-go/pkg/token" "github.com/nspcc-dev/neofs-s3-gate/api" - "github.com/nspcc-dev/neofs-s3-gate/api/pool" "github.com/pkg/errors" "go.uber.org/zap" "google.golang.org/grpc/codes" @@ -23,19 +22,15 @@ import ( type ( layer struct { - uid *owner.ID + cli sdk.Client log *zap.Logger - cli pool.Client - key *ecdsa.PrivateKey - - reqTimeout time.Duration } Params struct { - Pool pool.Client - Logger *zap.Logger - Timeout time.Duration - NFKey *ecdsa.PrivateKey + Pool pool.Client + Logger *zap.Logger + Timeout time.Duration + Credential neofs.Credentials } GetObjectParams struct { @@ -86,38 +81,32 @@ type ( } ) +var ( + ErrObjectExists = errors.New("object exists") + ErrObjectNotExists = errors.New("object not exists") +) + // NewGatewayLayer creates instance of layer. It checks credentials // and establishes gRPC connection with node. -func NewLayer(p *Params) (Client, error) { - wallet, err := owner.NEO3WalletFromPublicKey(&p.NFKey.PublicKey) - if err != nil { - return nil, err +func NewLayer(log *zap.Logger, cli sdk.Client) Client { + return &layer{ + cli: cli, + log: log, + } +} + +// Owner returns owner id from BearerToken (context) or from client owner. +func (n *layer) Owner(ctx context.Context) *owner.ID { + if tkn, err := sdk.BearerToken(ctx); err != nil && tkn != nil { + return tkn.Issuer() } - uid := owner.NewID() - uid.SetNeo3Wallet(wallet) - - return &layer{ - uid: uid, - cli: p.Pool, - key: p.NFKey, - log: p.Logger, - - reqTimeout: p.Timeout, - }, nil + return n.cli.Owner() } // Get NeoFS Object by refs.Address (should be used by auth.Center) func (n *layer) Get(ctx context.Context, address *object.Address) (*object.Object, error) { - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - return nil, err - } - - gop := new(client.GetObjectParams) - gop.WithAddress(address) - - return cli.GetObject(ctx, gop, client.WithSession(tkn)) + return n.cli.Object().Get(ctx, address) } // GetBucketInfo returns bucket name. @@ -221,9 +210,9 @@ func (n *layer) ListObjects(ctx context.Context, p *ListObjectsParams) (*ListObj oi = objectInfoFromMeta(bkt, meta) } else { // if there are sub-entities in tail - dir oi = &ObjectInfo{ - id: meta.GetID(), + id: meta.ID(), - Owner: meta.GetOwnerID(), + Owner: meta.OwnerID(), Bucket: bkt.Name, Name: tail[:ind+1], // dir MUST have slash symbol in the end // IsDir: true, @@ -263,7 +252,7 @@ func (n *layer) GetObject(ctx context.Context, p *GetObjectParams) error { _, err = n.objectGet(ctx, &getParams{ Writer: p.Writer, - addr: addr, + address: addr, offset: p.Offset, length: p.Length, @@ -272,6 +261,20 @@ func (n *layer) GetObject(ctx context.Context, p *GetObjectParams) error { return err } +func (n *layer) checkObject(ctx context.Context, cid *container.ID, filename string) error { + var err error + + if _, err = n.objectFindID(ctx, &findParams{cid: cid, val: filename}); err == nil { + return ErrObjectExists + } else if state, ok := status.FromError(err); !ok || state == nil { + return err + } else if state.Code() == codes.NotFound { + return ErrObjectNotExists + } + + return err +} + // GetObjectInfo returns meta information about the object. func (n *layer) GetObjectInfo(ctx context.Context, bucketName, filename string) (*ObjectInfo, error) { var ( @@ -282,8 +285,10 @@ func (n *layer) GetObjectInfo(ctx context.Context, bucketName, filename string) ) if bkt, err = n.GetBucketInfo(ctx, bucketName); err != nil { + n.log.Error("could not fetch bucket info", zap.Error(err)) return nil, err } else if oid, err = n.objectFindID(ctx, &findParams{cid: bkt.CID, val: filename}); err != nil { + n.log.Error("could not find object id", zap.Error(err)) return nil, err } @@ -292,23 +297,13 @@ func (n *layer) GetObjectInfo(ctx context.Context, bucketName, filename string) addr.SetContainerID(bkt.CID) if meta, err = n.objectHead(ctx, addr); err != nil { + n.log.Error("could not fetch object head", zap.Error(err)) return nil, err } return objectInfoFromMeta(bkt, meta), nil } -func GetOwnerID(tkn *token.BearerToken) (*owner.ID, error) { - - switch pkg.SDKVersion().GetMajor() { - case 2: - id := tkn.ToV2().GetBody().GetOwnerID() - return owner.NewIDFromV2(id), nil - default: - return nil, errors.New("unknown version") - } -} - // PutObject into storage. func (n *layer) PutObject(ctx context.Context, p *PutObjectParams) (*ObjectInfo, error) { return n.objectPut(ctx, p) diff --git a/api/layer/object.go b/api/layer/object.go index 4f2cdd43..7cf0cc4a 100644 --- a/api/layer/object.go +++ b/api/layer/object.go @@ -1,20 +1,15 @@ package layer import ( - "bufio" - "bytes" "context" "io" - "net/http" "net/url" "strconv" "time" - "github.com/nspcc-dev/neofs-api-go/pkg/client" + sdk "github.com/nspcc-dev/cdn-neofs-sdk" "github.com/nspcc-dev/neofs-api-go/pkg/container" "github.com/nspcc-dev/neofs-api-go/pkg/object" - "github.com/nspcc-dev/neofs-api-go/pkg/owner" - "github.com/nspcc-dev/neofs-api-go/pkg/token" "github.com/nspcc-dev/neofs-s3-gate/api" "github.com/pkg/errors" "google.golang.org/grpc/codes" @@ -30,57 +25,24 @@ type ( getParams struct { io.Writer - addr *object.Address - - offset int64 - length int64 + offset int64 + length int64 + address *object.Address } ) -func (n *layer) prepareClient(ctx context.Context) (*client.Client, *token.SessionToken, error) { - conn, err := n.cli.Connection(ctx) - if err != nil { - return nil, nil, err - } - - tkn, err := n.cli.Token(ctx, conn) - if err != nil { - return nil, nil, err - } - - cli, err := client.New(n.key, client.WithGRPCConnection(conn)) - if err != nil { - return nil, nil, err - } - - return cli, tkn, nil -} - // objectSearch returns all available objects by search params. func (n *layer) objectSearch(ctx context.Context, p *findParams) ([]*object.ID, error) { - filename, err := url.QueryUnescape(p.val) - if err != nil { + opts := []sdk.ObjectSearchOption{ + sdk.SearchRootObjects(), + } + + if filename, err := url.QueryUnescape(p.val); err != nil { return nil, err + } else if filename != "" { + opts = append(opts, sdk.SearchByFilename(filename)) } - - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - return nil, err - } - - filter := object.NewSearchFilters() - filter.AddRootFilter() - - sop := new(client.SearchObjectParams) - sop.WithContainerID(p.cid) - - if p.val != "" { - filter.AddFilter(object.AttributeFileName, filename, object.MatchStringEqual) - } - - sop.WithSearchFilters(filter) - - return cli.SearchObject(ctx, sop, client.WithSession(tkn)) + return n.cli.Object().Search(ctx, p.cid, opts...) } // objectFindID returns object id (uuid) based on it's nice name in s3. If @@ -98,36 +60,15 @@ func (n *layer) objectFindID(ctx context.Context, p *findParams) (*object.ID, er } // objectHead returns all object's headers. -func (n *layer) objectHead(ctx context.Context, addr *object.Address) (*object.Object, error) { - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - return nil, err - } - - ohp := new(client.ObjectHeaderParams) - ohp.WithAddress(addr) - ohp.WithAllFields() - - return cli.GetObjectHeader(ctx, ohp, client.WithSession(tkn)) +func (n *layer) objectHead(ctx context.Context, address *object.Address) (*object.Object, error) { + return n.cli.Object().Head(ctx, address, sdk.WithFullHeaders()) } // objectGet and write it into provided io.Reader. func (n *layer) objectGet(ctx context.Context, p *getParams) (*object.Object, error) { - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - return nil, err - } - // prepare length/offset writer - b := bufio.NewWriter(p.Writer) - w := newWriter(b, p.offset, p.length) - writer := newWriter(w, p.offset, p.length) - - gop := new(client.GetObjectParams) - gop.WithAddress(p.addr) - gop.WithPayloadWriter(writer) - - return cli.GetObject(ctx, gop, client.WithSession(tkn)) + w := newWriter(p.Writer, p.offset, p.length) + return n.cli.Object().Get(ctx, p.address, sdk.WithGetWriter(w)) } // objectPut into NeoFS, took payload from io.Reader. @@ -135,38 +76,25 @@ func (n *layer) objectPut(ctx context.Context, p *PutObjectParams) (*ObjectInfo, var ( err error obj string - own *owner.ID - oid *object.ID bkt *BucketInfo - // brt *token.BearerToken + own = n.Owner(ctx) + + address *object.Address ) - // if brt, err = auth.GetBearerToken(ctx); err != nil { - // return nil, err - // } - - // else if own, err = GetOwnerID(brt); err != nil { - // return nil, err - // } - - _ = own - if obj, err = url.QueryUnescape(p.Object); err != nil { return nil, err } else if bkt, err = n.GetBucketInfo(ctx, p.Bucket); err != nil { return nil, err - } else if _, err = n.objectFindID(ctx, &findParams{cid: bkt.CID, val: p.Object}); err == nil { + } else if err = n.checkObject(ctx, bkt.CID, p.Object); err != nil && err != ErrObjectNotExists { + return nil, err + } else if err == ErrObjectExists { return nil, &api.ObjectAlreadyExists{ Bucket: p.Bucket, Object: p.Object, } } - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - return nil, err - } - attributes := make([]*object.Attribute, 0, len(p.Header)+1) unix := strconv.FormatInt(time.Now().UTC().Unix(), 10) @@ -189,44 +117,30 @@ func (n *layer) objectPut(ctx context.Context, p *PutObjectParams) (*ObjectInfo, attributes = append(attributes, ua) } - b := new(bytes.Buffer) - r := io.TeeReader(p.Reader, b) - raw := object.NewRaw() - raw.SetOwnerID(tkn.OwnerID()) // should be replaced with BearerToken.Issuer() + raw.SetOwnerID(own) raw.SetContainerID(bkt.CID) raw.SetAttributes(attributes...) - pop := new(client.PutObjectParams) - pop.WithPayloadReader(r) - pop.WithObject(raw.Object()) - - if oid, err = cli.PutObject(ctx, pop, client.WithSession(tkn)); err != nil { - return nil, errors.Wrapf(err, "owner_id = %s", tkn.OwnerID()) + r := newDetector(p.Reader) + if address, err = n.cli.Object().Put(ctx, raw.Object(), sdk.WithPutReader(r)); err != nil { + return nil, err } return &ObjectInfo{ - id: oid, + id: address.ObjectID(), + Owner: own, Bucket: p.Bucket, Name: p.Object, Size: p.Size, Created: time.Now(), - ContentType: http.DetectContentType(b.Bytes()), - Owner: own, Headers: p.Header, + ContentType: r.contentType, }, nil } // objectDelete puts tombstone object into neofs. func (n *layer) objectDelete(ctx context.Context, address *object.Address) error { - cli, tkn, err := n.prepareClient(ctx) - if err != nil { - return err - } - - dob := new(client.DeleteObjectParams) - dob.WithAddress(address) - - return cli.DeleteObject(ctx, dob, client.WithSession(tkn)) + return n.cli.Object().Delete(ctx, address) } diff --git a/api/layer/util.go b/api/layer/util.go index 30901e8f..3d8e8dbe 100644 --- a/api/layer/util.go +++ b/api/layer/util.go @@ -55,7 +55,7 @@ func userHeaders(attrs []*object.Attribute) map[string]string { result := make(map[string]string, len(attrs)) for _, attr := range attrs { - result[attr.GetKey()] = attr.GetValue() + result[attr.Key()] = attr.Value() } return result @@ -64,10 +64,10 @@ func userHeaders(attrs []*object.Attribute) map[string]string { func objectInfoFromMeta(bkt *BucketInfo, meta *object.Object) *ObjectInfo { var ( creation time.Time - filename = meta.GetID().String() + filename = meta.ID().String() ) - userHeaders := userHeaders(meta.GetAttributes()) + userHeaders := userHeaders(meta.Attributes()) if val, ok := userHeaders[object.AttributeFileName]; ok { filename = val delete(userHeaders, object.AttributeFileName) @@ -80,26 +80,26 @@ func objectInfoFromMeta(bkt *BucketInfo, meta *object.Object) *ObjectInfo { delete(userHeaders, object.AttributeTimestamp) } - mimeType := http.DetectContentType(meta.GetPayload()) + mimeType := http.DetectContentType(meta.Payload()) return &ObjectInfo{ - id: meta.GetID(), + id: meta.ID(), Bucket: bkt.Name, Name: filename, Created: creation, ContentType: mimeType, Headers: userHeaders, - Size: int64(meta.GetPayloadSize()), + Size: int64(meta.PayloadSize()), } } func nameFromObject(o *object.Object) (string, string) { - var name = o.GetID().String() + var name = o.ID().String() - for _, attr := range o.GetAttributes() { - if attr.GetKey() == object.AttributeFileName { - name = attr.GetValue() + for _, attr := range o.Attributes() { + if attr.Key() == object.AttributeFileName { + name = attr.Value() break } diff --git a/api/layer/writer.go b/api/layer/writer.go index 833a794e..2290e391 100644 --- a/api/layer/writer.go +++ b/api/layer/writer.go @@ -12,7 +12,7 @@ type offsetWriter struct { length int64 } -func newWriter(w io.Writer, offset, length int64) io.Writer { +func newWriter(w io.Writer, offset, length int64) *offsetWriter { return &offsetWriter{ Writer: w, offset: offset, diff --git a/api/layer/writer_test.go b/api/layer/writer_test.go index 1a242f64..762f1dd6 100644 --- a/api/layer/writer_test.go +++ b/api/layer/writer_test.go @@ -33,10 +33,8 @@ func TestOffsetWriter(t *testing.T) { require.NoError(t, err) } - wo := wt.(*offsetWriter) - - require.Equal(t, o, wo.skipped) - require.Equal(t, l, wo.written) + require.Equal(t, o, wt.skipped) + require.Equal(t, l, wt.written) require.Equal(t, b[o:o+l], w.Bytes()) }) @@ -51,10 +49,8 @@ func TestOffsetWriter(t *testing.T) { require.NoError(t, err) } - wo := wt.(*offsetWriter) - - require.Equal(t, o, wo.skipped) - require.Equal(t, l, wo.written) + require.Equal(t, o, wt.skipped) + require.Equal(t, l, wt.written) require.Equal(t, b[o:o+l], w.Bytes()) }) @@ -69,10 +65,8 @@ func TestOffsetWriter(t *testing.T) { require.NoError(t, err) } - wo := wt.(*offsetWriter) - - require.Equal(t, o, wo.skipped) - require.Equal(t, l, wo.written) + require.Equal(t, o, wt.skipped) + require.Equal(t, l, wt.written) require.Equal(t, b[o:o+l], w.Bytes()) }) @@ -87,10 +81,8 @@ func TestOffsetWriter(t *testing.T) { require.NoError(t, err) } - wo := wt.(*offsetWriter) - - require.Equal(t, o, wo.skipped) - require.Equal(t, s, wo.written) + require.Equal(t, o, wt.skipped) + require.Equal(t, s, wt.written) require.Equal(t, b, w.Bytes()) }) @@ -105,10 +97,8 @@ func TestOffsetWriter(t *testing.T) { require.NoError(t, err) } - wo := wt.(*offsetWriter) - - require.Equal(t, o, wo.skipped) - require.Equal(t, s, wo.written) + require.Equal(t, o, wt.skipped) + require.Equal(t, s, wt.written) require.Equal(t, b, w.Bytes()) }) } diff --git a/api/metrics/api.go b/api/metrics/api.go index 8a29f37c..d72297a6 100644 --- a/api/metrics/api.go +++ b/api/metrics/api.go @@ -41,11 +41,11 @@ type ( } responseWrapper struct { + sync.Once http.ResponseWriter - statusCode int - headWritten bool - startTime time.Time + statusCode int + startTime time.Time } ) @@ -202,12 +202,10 @@ func (st *HTTPStats) updateStats(api string, w http.ResponseWriter, r *http.Requ // WriteHeader - writes http status code func (w *responseWrapper) WriteHeader(code int) { - if !w.headWritten { + w.Do(func() { w.statusCode = code - w.headWritten = true - w.ResponseWriter.WriteHeader(code) - } + }) } // Flush - Calls the underlying Flush. diff --git a/api/pool/pool.go b/api/pool/pool.go deleted file mode 100644 index e5132da5..00000000 --- a/api/pool/pool.go +++ /dev/null @@ -1,384 +0,0 @@ -package pool - -import ( - "context" - "crypto/ecdsa" - "math/rand" - "sort" - "sync" - "time" - - "github.com/nspcc-dev/neofs-api-go/pkg/owner" - "github.com/nspcc-dev/neofs-api-go/pkg/token" - "github.com/pkg/errors" - "go.uber.org/atomic" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/keepalive" -) - -type ( - node struct { - index int32 - address string - weight uint32 - usedAt time.Time - conn *grpc.ClientConn - } - - Client interface { - Status() error - Connection(context.Context) (*grpc.ClientConn, error) - Token(context.Context, *grpc.ClientConn) (*token.SessionToken, error) - } - - Pool interface { - Client - - Close() - ReBalance(ctx context.Context) - } - - Peer struct { - Address string - Weight float64 - } - - Config struct { - keepalive.ClientParameters - - ConnectionTTL time.Duration - ConnectTimeout time.Duration - RequestTimeout time.Duration - - Peers []Peer - - GRPCVerbose bool - GRPCLogger grpclog.LoggerV2 - - Logger *zap.Logger - PrivateKey *ecdsa.PrivateKey - } - - pool struct { - log *zap.Logger - - ttl time.Duration - - conTimeout time.Duration - reqTimeout time.Duration - opts keepalive.ClientParameters - - currentIdx *atomic.Int32 - currentConn *grpc.ClientConn - - ping Pinger - - *sync.Mutex - nodes []*node - keys []uint32 - conns map[uint32][]*node - tokens map[string]*token.SessionToken - - oid *owner.ID - key *ecdsa.PrivateKey - - unhealthy *atomic.Error - } - - Pinger interface { - Call(context.Context, *grpc.ClientConn) error - } -) - -var ( - errNoConnections = errors.New("no connections") - errBootstrapping = errors.New("bootstrapping") - errEmptyConnection = errors.New("empty connection") - errNoHealthyConnections = errors.New("no active connections") -) - -func New(cfg *Config) (Pool, error) { - p := &pool{ - log: cfg.Logger, - key: cfg.PrivateKey, - Mutex: new(sync.Mutex), - keys: make([]uint32, 0), - nodes: make([]*node, 0), - conns: make(map[uint32][]*node), - tokens: make(map[string]*token.SessionToken), - - currentIdx: atomic.NewInt32(-1), - - ttl: cfg.ConnectionTTL, - - conTimeout: cfg.ConnectTimeout, - reqTimeout: cfg.RequestTimeout, - opts: cfg.ClientParameters, - - unhealthy: atomic.NewError(errBootstrapping), - } - - p.oid = owner.NewID() - wallet, err := owner.NEO3WalletFromPublicKey(&p.key.PublicKey) - if err != nil { - return nil, err - } - - p.oid.SetNeo3Wallet(wallet) - - if cfg.GRPCVerbose { - grpclog.SetLoggerV2(cfg.GRPCLogger) - } - - seed := time.Now().UnixNano() - - rand.Seed(seed) - cfg.Logger.Info("used random seed", zap.Int64("seed", seed)) - - if p.ping, err = newV2Ping(cfg.PrivateKey); err != nil { - return nil, err - } - - for i := range cfg.Peers { - if cfg.Peers[i].Address == "" { - cfg.Logger.Warn("skip, empty address") - break - } - - p.nodes = append(p.nodes, &node{ - index: int32(i), - address: cfg.Peers[i].Address, - weight: uint32(cfg.Peers[i].Weight * 100), - }) - - cfg.Logger.Info("add new peer", - zap.String("address", p.nodes[i].address), - zap.Uint32("weight", p.nodes[i].weight)) - } - - if len(p.nodes) == 0 { - return nil, errNoConnections - } - - return p, nil -} - -func (p *pool) Status() error { - return p.unhealthy.Load() -} - -func (p *pool) Close() { - p.Lock() - defer p.Unlock() - - for i := range p.nodes { - if p.nodes[i] == nil || p.nodes[i].conn == nil { - continue - } - - p.log.Warn("close connection", - zap.String("address", p.nodes[i].address), - zap.Error(p.nodes[i].conn.Close())) - } -} - -func (p *pool) ReBalance(ctx context.Context) { - p.Lock() - defer func() { - p.Unlock() - - _, err := p.Connection(ctx) - p.unhealthy.Store(err) - }() - - keys := make(map[uint32]struct{}) - tokens := make(map[string]*token.SessionToken) - - for i := range p.nodes { - var ( - idx = -1 - exists bool - err error - start = time.Now() - tkn *token.SessionToken - conn = p.nodes[i].conn - weight = p.nodes[i].weight - ) - - if err = ctx.Err(); err != nil { - p.log.Warn("something went wrong", zap.Error(err)) - p.unhealthy.Store(err) - - return - } - - if conn == nil { - p.log.Debug("empty connection, try to connect", - zap.String("address", p.nodes[i].address)) - - { // try to connect - ctx, cancel := context.WithTimeout(ctx, p.conTimeout) - conn, err = grpc.DialContext(ctx, p.nodes[i].address, - grpc.WithBlock(), - grpc.WithInsecure(), - grpc.WithKeepaliveParams(p.opts)) - cancel() - } - - if err != nil || conn == nil { - p.log.Warn("skip, could not connect to node", - zap.String("address", p.nodes[i].address), - zap.Stringer("elapsed", time.Since(start)), - zap.Error(err)) - continue - } - - { // try to prepare token - ctx, cancel := context.WithTimeout(ctx, p.reqTimeout) - tkn, err = p.prepareToken(ctx, conn) - cancel() - } - - if err != nil { - p.log.Debug("could not prepare session token", - zap.String("address", p.nodes[i].address), - zap.Error(err)) - continue - } - - tokens[conn.Target()] = tkn - - p.nodes[i].conn = conn - p.nodes[i].usedAt = time.Now() - p.log.Debug("connected to node", zap.String("address", p.nodes[i].address)) - } else if tkn, exists = p.tokens[conn.Target()]; exists { - // token exists, ignore - } else if tkn, err = p.prepareToken(ctx, conn); err != nil { - p.log.Error("could not prepare session token", - zap.String("address", p.nodes[i].address), - zap.Error(err)) - continue - } - - for j := range p.conns[weight] { - if p.conns[weight][j] != nil && p.conns[weight][j].conn == conn { - idx = j - exists = true - break - } - } - - usedAt := time.Since(p.nodes[i].usedAt) - - // if something wrong with connection (bad state, unhealthy or not used a long time), try to close it and remove - if err = p.isAlive(ctx, conn); err != nil || usedAt > p.ttl { - p.log.Warn("connection not alive", - zap.String("address", p.nodes[i].address), - zap.Stringer("since", usedAt), - zap.Error(err)) - - if exists { - // remove from connections - p.conns[weight] = append(p.conns[weight][:idx], p.conns[weight][idx+1:]...) - } - - // remove token - delete(tokens, conn.Target()) - - if err = conn.Close(); err != nil { - p.log.Warn("could not close bad connection", - zap.String("address", p.nodes[i].address), - zap.Stringer("since", usedAt), - zap.Error(err)) - } - - if p.nodes[i].conn != nil { - p.nodes[i].conn = nil - } - continue - } - - keys[weight] = struct{}{} - - p.log.Debug("connection alive", - zap.String("address", p.nodes[i].address), - zap.Stringer("since", usedAt)) - - if !exists { - p.conns[weight] = append(p.conns[weight], p.nodes[i]) - } - - if tkn != nil { - tokens[conn.Target()] = tkn - } - } - - p.tokens = tokens - p.keys = p.keys[:0] - for w := range keys { - p.keys = append(p.keys, w) - } - - sort.Slice(p.keys, func(i, j int) bool { - return p.keys[i] > p.keys[j] - }) -} - -func (p *pool) Connection(ctx context.Context) (*grpc.ClientConn, error) { - p.Lock() - defer p.Unlock() - - if err := p.isAlive(ctx, p.currentConn); err == nil { - if id := p.currentIdx.Load(); id != -1 && p.nodes[id] != nil { - p.nodes[id].usedAt = time.Now() - } - - return p.currentConn, nil - } - - for _, w := range p.keys { - switch ln := len(p.conns[w]); ln { - case 0: - continue - case 1: - p.currentConn = p.conns[w][0].conn - p.conns[w][0].usedAt = time.Now() - p.currentIdx.Store(p.conns[w][0].index) - return p.currentConn, nil - default: // > 1 - i := rand.Intn(ln) - p.currentConn = p.conns[w][i].conn - p.conns[w][i].usedAt = time.Now() - p.currentIdx.Store(p.conns[w][i].index) - return p.currentConn, nil - } - } - - p.currentConn = nil - p.currentIdx.Store(-1) - - if ctx.Err() != nil { - return nil, ctx.Err() - } - - return nil, errNoHealthyConnections -} - -func (p *pool) isAlive(ctx context.Context, cur *grpc.ClientConn) error { - if cur == nil { - return errEmptyConnection - } - - switch st := cur.GetState(); st { - case connectivity.Idle, connectivity.Ready, connectivity.Connecting: - ctx, cancel := context.WithTimeout(ctx, p.reqTimeout) - defer cancel() - - return p.ping.Call(ctx, cur) - default: - return errors.New(st.String()) - } -} diff --git a/api/pool/session.go b/api/pool/session.go deleted file mode 100644 index 20333a4a..00000000 --- a/api/pool/session.go +++ /dev/null @@ -1,52 +0,0 @@ -package pool - -import ( - "context" - "math" - - "go.uber.org/zap" - - "github.com/nspcc-dev/neofs-api-go/pkg/client" - "github.com/nspcc-dev/neofs-api-go/pkg/token" - "google.golang.org/grpc" -) - -// SessionToken returns session token for connection -func (p *pool) Token(ctx context.Context, conn *grpc.ClientConn) (*token.SessionToken, error) { - p.Lock() - defer p.Unlock() - - if tkn, ok := p.tokens[conn.Target()]; ok && tkn != nil { - return tkn, nil - } - - // prepare session token - tkn, err := p.prepareToken(ctx, conn) - if err != nil { - return nil, err - } - - // save token for current connection - p.tokens[conn.Target()] = tkn - - return tkn, nil -} - -// creates token using -func (p *pool) prepareToken(ctx context.Context, conn *grpc.ClientConn) (*token.SessionToken, error) { - cli, err := client.New(p.key, client.WithGRPCConnection(conn)) - if err != nil { - return nil, err - } - - tkn, err := cli.CreateSession(ctx, math.MaxUint64) - if err != nil { - return nil, err - } - - p.log.Info("token created for connection", - zap.String("address", conn.Target()), - zap.Stringer("owner", tkn.OwnerID())) - - return tkn, err -} diff --git a/api/pool/v2.go b/api/pool/v2.go deleted file mode 100644 index 8610bd46..00000000 --- a/api/pool/v2.go +++ /dev/null @@ -1,36 +0,0 @@ -package pool - -import ( - "context" - "crypto/ecdsa" - - "github.com/nspcc-dev/neofs-api-go/v2/client" - "github.com/nspcc-dev/neofs-api-go/v2/netmap" - "github.com/nspcc-dev/neofs-api-go/v2/signature" - "github.com/pkg/errors" - "google.golang.org/grpc" -) - -type v2Ping struct { - req *netmap.LocalNodeInfoRequest -} - -func newV2Ping(key *ecdsa.PrivateKey) (Pinger, error) { - req := new(netmap.LocalNodeInfoRequest) - - if err := signature.SignServiceMessage(key, req); err != nil { - return nil, errors.Wrap(err, "could not sign `PingRequest`") - } - - return &v2Ping{req: req}, nil -} - -func (v *v2Ping) Call(ctx context.Context, conn *grpc.ClientConn) error { - if cli, err := netmap.NewClient(netmap.WithGlobalOpts(client.WithGRPCConn(conn))); err != nil { - return err - } else if _, err := cli.LocalNodeInfo(ctx, v.req); err != nil { - return err - } - - return nil -} diff --git a/api/router.go b/api/router.go index 9699a381..f4abfb9c 100644 --- a/api/router.go +++ b/api/router.go @@ -3,11 +3,12 @@ package api import ( "context" "net/http" + "sync" "github.com/google/uuid" "github.com/gorilla/mux" + "github.com/nspcc-dev/neofs-s3-gate/api/auth" "github.com/nspcc-dev/neofs-s3-gate/api/metrics" - "github.com/nspcc-dev/neofs-s3-gate/auth" "go.uber.org/zap" "google.golang.org/grpc/metadata" ) @@ -81,7 +82,9 @@ type ( mimeType string logResponseWriter struct { + sync.Once http.ResponseWriter + statusCode int } ) @@ -100,8 +103,10 @@ const ( var _ = logErrorResponse func (lrw *logResponseWriter) WriteHeader(code int) { - lrw.statusCode = code - lrw.ResponseWriter.WriteHeader(code) + lrw.Do(func() { + lrw.statusCode = code + lrw.ResponseWriter.WriteHeader(code) + }) } func setRequestID(h http.Handler) http.Handler { @@ -139,12 +144,14 @@ func logErrorResponse(l *zap.Logger) mux.MiddlewareFunc { zap.Int("status", lw.statusCode), zap.String("method", mux.CurrentRoute(r).GetName()), zap.String("description", http.StatusText(lw.statusCode))) - } else { - l.Info("call method", - zap.Int("status", lw.statusCode), - zap.String("method", mux.CurrentRoute(r).GetName()), - zap.String("description", http.StatusText(lw.statusCode))) + + return } + + l.Info("call method", + zap.Int("status", lw.statusCode), + zap.String("method", mux.CurrentRoute(r).GetName()), + zap.String("description", http.StatusText(lw.statusCode))) }) } } @@ -160,7 +167,7 @@ func GetRequestID(v interface{}) string { } } -func Attach(r *mux.Router, m MaxClients, h Handler, center *auth.Center, log *zap.Logger) { +func Attach(r *mux.Router, domains []string, m MaxClients, h Handler, center auth.Center, log *zap.Logger) { api := r.PathPrefix(SlashSeparator).Subrouter() api.Use( @@ -174,258 +181,264 @@ func Attach(r *mux.Router, m MaxClients, h Handler, center *auth.Center, log *za // Attach user authentication for all S3 routes. AttachUserAuth(api, center, log) - bucket := api.PathPrefix("/{bucket}").Subrouter() + buckets := make([]*mux.Router, 0, len(domains)+1) + buckets = append(buckets, api.PathPrefix("/{bucket}").Subrouter()) - // Object operations - // HeadObject - bucket.Methods(http.MethodHead).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("headobject", h.HeadObjectHandler))).Name("HeadObject") - // CopyObjectPart - bucket.Methods(http.MethodPut).Path("/{object:.+}").HeadersRegexp(hdrAmzCopySource, ".*?(\\/|%2F).*?").HandlerFunc(m.Handle(metrics.APIStats("copyobjectpart", h.CopyObjectPartHandler))).Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}"). - Name("CopyObjectPart") - // PutObjectPart - bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("putobjectpart", h.PutObjectPartHandler))).Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}"). - Name("PutObjectObject") - // ListObjectParts - bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("listobjectparts", h.ListObjectPartsHandler))).Queries("uploadId", "{uploadId:.*}"). - Name("ListObjectParts") - // CompleteMultipartUpload - bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("completemutipartupload", h.CompleteMultipartUploadHandler))).Queries("uploadId", "{uploadId:.*}"). - Name("CompleteMultipartUpload") - // NewMultipartUpload - bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("newmultipartupload", h.NewMultipartUploadHandler))).Queries("uploads", ""). - Name("NewMultipartUpload") - // AbortMultipartUpload - bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("abortmultipartupload", h.AbortMultipartUploadHandler))).Queries("uploadId", "{uploadId:.*}"). - Name("AbortMultipartUpload") - // GetObjectACL - this is a dummy call. - bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("getobjectacl", h.GetObjectACLHandler))).Queries("acl", ""). - Name("GetObjectACL") - // PutObjectACL - this is a dummy call. - bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("putobjectacl", h.PutObjectACLHandler))).Queries("acl", ""). - Name("PutObjectACL") - // GetObjectTagging - bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("getobjecttagging", h.GetObjectTaggingHandler))).Queries("tagging", ""). - Name("GetObjectTagging") - // PutObjectTagging - bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("putobjecttagging", h.PutObjectTaggingHandler))).Queries("tagging", ""). - Name("PutObjectTagging") - // DeleteObjectTagging - bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("deleteobjecttagging", h.DeleteObjectTaggingHandler))).Queries("tagging", ""). - Name("DeleteObjectTagging") - // SelectObjectContent - bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("selectobjectcontent", h.SelectObjectContentHandler))).Queries("select", "").Queries("select-type", "2"). - Name("SelectObjectContent") - // GetObjectRetention - bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("getobjectretention", h.GetObjectRetentionHandler))).Queries("retention", ""). - Name("GetObjectRetention") - // GetObjectLegalHold - bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("getobjectlegalhold", h.GetObjectLegalHoldHandler))).Queries("legal-hold", ""). - Name("GetObjectLegalHold") - // GetObject - bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("getobject", h.GetObjectHandler))). - Name("GetObject") - // CopyObject - bucket.Methods(http.MethodPut).Path("/{object:.+}").HeadersRegexp(hdrAmzCopySource, ".*?(\\/|%2F).*?").HandlerFunc(m.Handle(metrics.APIStats("copyobject", h.CopyObjectHandler))). - Name("CopyObject") - // PutObjectRetention - bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("putobjectretention", h.PutObjectRetentionHandler))).Queries("retention", ""). - Name("PutObjectRetention") - // PutObjectLegalHold - bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("putobjectlegalhold", h.PutObjectLegalHoldHandler))).Queries("legal-hold", ""). - Name("PutObjectLegalHold") + for _, domain := range domains { + buckets = append(buckets, api.Host("{bucket:.+}."+domain).Subrouter()) + } - // PutObject - bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("putobject", h.PutObjectHandler))). - Name("PutObject") - // DeleteObject - bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( - m.Handle(metrics.APIStats("deleteobject", h.DeleteObjectHandler))). - Name("DeleteObject") + for _, bucket := range buckets { + // Object operations + // HeadObject + bucket.Methods(http.MethodHead).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("headobject", h.HeadObjectHandler))).Name("HeadObject") + // CopyObjectPart + bucket.Methods(http.MethodPut).Path("/{object:.+}").HeadersRegexp(hdrAmzCopySource, ".*?(\\/|%2F).*?").HandlerFunc(m.Handle(metrics.APIStats("copyobjectpart", h.CopyObjectPartHandler))).Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}"). + Name("CopyObjectPart") + // PutObjectPart + bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("putobjectpart", h.PutObjectPartHandler))).Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}"). + Name("PutObjectObject") + // ListObjectParts + bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("listobjectparts", h.ListObjectPartsHandler))).Queries("uploadId", "{uploadId:.*}"). + Name("ListObjectParts") + // CompleteMultipartUpload + bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("completemutipartupload", h.CompleteMultipartUploadHandler))).Queries("uploadId", "{uploadId:.*}"). + Name("CompleteMultipartUpload") + // NewMultipartUpload + bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("newmultipartupload", h.NewMultipartUploadHandler))).Queries("uploads", ""). + Name("NewMultipartUpload") + // AbortMultipartUpload + bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("abortmultipartupload", h.AbortMultipartUploadHandler))).Queries("uploadId", "{uploadId:.*}"). + Name("AbortMultipartUpload") + // GetObjectACL - this is a dummy call. + bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("getobjectacl", h.GetObjectACLHandler))).Queries("acl", ""). + Name("GetObjectACL") + // PutObjectACL - this is a dummy call. + bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("putobjectacl", h.PutObjectACLHandler))).Queries("acl", ""). + Name("PutObjectACL") + // GetObjectTagging + bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("getobjecttagging", h.GetObjectTaggingHandler))).Queries("tagging", ""). + Name("GetObjectTagging") + // PutObjectTagging + bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("putobjecttagging", h.PutObjectTaggingHandler))).Queries("tagging", ""). + Name("PutObjectTagging") + // DeleteObjectTagging + bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("deleteobjecttagging", h.DeleteObjectTaggingHandler))).Queries("tagging", ""). + Name("DeleteObjectTagging") + // SelectObjectContent + bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("selectobjectcontent", h.SelectObjectContentHandler))).Queries("select", "").Queries("select-type", "2"). + Name("SelectObjectContent") + // GetObjectRetention + bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("getobjectretention", h.GetObjectRetentionHandler))).Queries("retention", ""). + Name("GetObjectRetention") + // GetObjectLegalHold + bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("getobjectlegalhold", h.GetObjectLegalHoldHandler))).Queries("legal-hold", ""). + Name("GetObjectLegalHold") + // GetObject + bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("getobject", h.GetObjectHandler))). + Name("GetObject") + // CopyObject + bucket.Methods(http.MethodPut).Path("/{object:.+}").HeadersRegexp(hdrAmzCopySource, ".*?(\\/|%2F).*?").HandlerFunc(m.Handle(metrics.APIStats("copyobject", h.CopyObjectHandler))). + Name("CopyObject") + // PutObjectRetention + bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("putobjectretention", h.PutObjectRetentionHandler))).Queries("retention", ""). + Name("PutObjectRetention") + // PutObjectLegalHold + bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("putobjectlegalhold", h.PutObjectLegalHoldHandler))).Queries("legal-hold", ""). + Name("PutObjectLegalHold") - // Bucket operations - // GetBucketLocation - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketlocation", h.GetBucketLocationHandler))).Queries("location", ""). - Name("GetBucketLocation") - // GetBucketPolicy - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketpolicy", h.GetBucketPolicyHandler))).Queries("policy", ""). - Name("GetBucketPolicy") - // GetBucketLifecycle - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketlifecycle", h.GetBucketLifecycleHandler))).Queries("lifecycle", ""). - Name("GetBucketLifecycle") - // GetBucketEncryption - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketencryption", h.GetBucketEncryptionHandler))).Queries("encryption", ""). - Name("GetBucketEncryption") + // PutObject + bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("putobject", h.PutObjectHandler))). + Name("PutObject") + // DeleteObject + bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( + m.Handle(metrics.APIStats("deleteobject", h.DeleteObjectHandler))). + Name("DeleteObject") - // Dummy Bucket Calls - // GetBucketACL -- this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketacl", h.GetBucketACLHandler))).Queries("acl", ""). - Name("GetBucketACL") - // PutBucketACL -- this is a dummy call. - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucketacl", h.PutBucketACLHandler))).Queries("acl", ""). - Name("PutBucketACL") - // GetBucketCors - this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketcors", h.GetBucketCorsHandler))).Queries("cors", ""). - Name("GetBucketCors") - // GetBucketWebsiteHandler - this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketwebsite", h.GetBucketWebsiteHandler))).Queries("website", ""). - Name("GetBucketWebsite") - // GetBucketAccelerateHandler - this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketaccelerate", h.GetBucketAccelerateHandler))).Queries("accelerate", ""). - Name("GetBucketAccelerate") - // GetBucketRequestPaymentHandler - this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketrequestpayment", h.GetBucketRequestPaymentHandler))).Queries("requestPayment", ""). - Name("GetBucketRequestPayment") - // GetBucketLoggingHandler - this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketlogging", h.GetBucketLoggingHandler))).Queries("logging", ""). - Name("GetBucketLogging") - // GetBucketLifecycleHandler - this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketlifecycle", h.GetBucketLifecycleHandler))).Queries("lifecycle", ""). - Name("GetBucketLifecycle") - // GetBucketReplicationHandler - this is a dummy call. - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketreplication", h.GetBucketReplicationHandler))).Queries("replication", ""). - Name("GetBucketReplication") - // GetBucketTaggingHandler - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbuckettagging", h.GetBucketTaggingHandler))).Queries("tagging", ""). - Name("GetBucketTagging") - // DeleteBucketWebsiteHandler - bucket.Methods(http.MethodDelete).HandlerFunc( - m.Handle(metrics.APIStats("deletebucketwebsite", h.DeleteBucketWebsiteHandler))).Queries("website", ""). - Name("DeleteBucketWebsite") - // DeleteBucketTaggingHandler - bucket.Methods(http.MethodDelete).HandlerFunc( - m.Handle(metrics.APIStats("deletebuckettagging", h.DeleteBucketTaggingHandler))).Queries("tagging", ""). - Name("DeleteBucketTagging") + // Bucket operations + // GetBucketLocation + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketlocation", h.GetBucketLocationHandler))).Queries("location", ""). + Name("GetBucketLocation") + // GetBucketPolicy + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketpolicy", h.GetBucketPolicyHandler))).Queries("policy", ""). + Name("GetBucketPolicy") + // GetBucketLifecycle + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketlifecycle", h.GetBucketLifecycleHandler))).Queries("lifecycle", ""). + Name("GetBucketLifecycle") + // GetBucketEncryption + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketencryption", h.GetBucketEncryptionHandler))).Queries("encryption", ""). + Name("GetBucketEncryption") - // GetBucketObjectLockConfig - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketobjectlockconfiguration", h.GetBucketObjectLockConfigHandler))).Queries("object-lock", ""). - Name("GetBucketObjectLockConfig") - // GetBucketVersioning - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketversioning", h.GetBucketVersioningHandler))).Queries("versioning", ""). - Name("GetBucketVersioning") - // GetBucketNotification - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("getbucketnotification", h.GetBucketNotificationHandler))).Queries("notification", ""). - Name("GetBucketNotification") - // ListenBucketNotification - bucket.Methods(http.MethodGet).HandlerFunc(metrics.APIStats("listenbucketnotification", h.ListenBucketNotificationHandler)).Queries("events", "{events:.*}"). - Name("ListenBucketNotification") - // ListMultipartUploads - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("listmultipartuploads", h.ListMultipartUploadsHandler))).Queries("uploads", ""). - Name("ListMultipartUploads") - // ListObjectsV2M - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("listobjectsv2M", h.ListObjectsV2MHandler))).Queries("list-type", "2", "metadata", "true"). - Name("ListObjectsV2M") - // ListObjectsV2 - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("listobjectsv2", h.ListObjectsV2Handler))).Queries("list-type", "2"). - Name("ListObjectsV2") - // ListBucketVersions - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("listbucketversions", h.ListBucketObjectVersionsHandler))).Queries("versions", ""). - Name("ListBucketVersions") - // ListObjectsV1 (Legacy) - bucket.Methods(http.MethodGet).HandlerFunc( - m.Handle(metrics.APIStats("listobjectsv1", h.ListObjectsV1Handler))). - Name("ListObjectsV1") - // PutBucketLifecycle - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucketlifecycle", h.PutBucketLifecycleHandler))).Queries("lifecycle", ""). - Name("PutBucketLifecycle") - // PutBucketEncryption - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucketencryption", h.PutBucketEncryptionHandler))).Queries("encryption", ""). - Name("PutBucketEncryption") + // Dummy Bucket Calls + // GetBucketACL -- this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketacl", h.GetBucketACLHandler))).Queries("acl", ""). + Name("GetBucketACL") + // PutBucketACL -- this is a dummy call. + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucketacl", h.PutBucketACLHandler))).Queries("acl", ""). + Name("PutBucketACL") + // GetBucketCors - this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketcors", h.GetBucketCorsHandler))).Queries("cors", ""). + Name("GetBucketCors") + // GetBucketWebsiteHandler - this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketwebsite", h.GetBucketWebsiteHandler))).Queries("website", ""). + Name("GetBucketWebsite") + // GetBucketAccelerateHandler - this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketaccelerate", h.GetBucketAccelerateHandler))).Queries("accelerate", ""). + Name("GetBucketAccelerate") + // GetBucketRequestPaymentHandler - this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketrequestpayment", h.GetBucketRequestPaymentHandler))).Queries("requestPayment", ""). + Name("GetBucketRequestPayment") + // GetBucketLoggingHandler - this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketlogging", h.GetBucketLoggingHandler))).Queries("logging", ""). + Name("GetBucketLogging") + // GetBucketLifecycleHandler - this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketlifecycle", h.GetBucketLifecycleHandler))).Queries("lifecycle", ""). + Name("GetBucketLifecycle") + // GetBucketReplicationHandler - this is a dummy call. + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketreplication", h.GetBucketReplicationHandler))).Queries("replication", ""). + Name("GetBucketReplication") + // GetBucketTaggingHandler + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbuckettagging", h.GetBucketTaggingHandler))).Queries("tagging", ""). + Name("GetBucketTagging") + // DeleteBucketWebsiteHandler + bucket.Methods(http.MethodDelete).HandlerFunc( + m.Handle(metrics.APIStats("deletebucketwebsite", h.DeleteBucketWebsiteHandler))).Queries("website", ""). + Name("DeleteBucketWebsite") + // DeleteBucketTaggingHandler + bucket.Methods(http.MethodDelete).HandlerFunc( + m.Handle(metrics.APIStats("deletebuckettagging", h.DeleteBucketTaggingHandler))).Queries("tagging", ""). + Name("DeleteBucketTagging") - // PutBucketPolicy - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucketpolicy", h.PutBucketPolicyHandler))).Queries("policy", ""). - Name("PutBucketPolicy") + // GetBucketObjectLockConfig + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketobjectlockconfiguration", h.GetBucketObjectLockConfigHandler))).Queries("object-lock", ""). + Name("GetBucketObjectLockConfig") + // GetBucketVersioning + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketversioning", h.GetBucketVersioningHandler))).Queries("versioning", ""). + Name("GetBucketVersioning") + // GetBucketNotification + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("getbucketnotification", h.GetBucketNotificationHandler))).Queries("notification", ""). + Name("GetBucketNotification") + // ListenBucketNotification + bucket.Methods(http.MethodGet).HandlerFunc(metrics.APIStats("listenbucketnotification", h.ListenBucketNotificationHandler)).Queries("events", "{events:.*}"). + Name("ListenBucketNotification") + // ListMultipartUploads + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("listmultipartuploads", h.ListMultipartUploadsHandler))).Queries("uploads", ""). + Name("ListMultipartUploads") + // ListObjectsV2M + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("listobjectsv2M", h.ListObjectsV2MHandler))).Queries("list-type", "2", "metadata", "true"). + Name("ListObjectsV2M") + // ListObjectsV2 + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("listobjectsv2", h.ListObjectsV2Handler))).Queries("list-type", "2"). + Name("ListObjectsV2") + // ListBucketVersions + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("listbucketversions", h.ListBucketObjectVersionsHandler))).Queries("versions", ""). + Name("ListBucketVersions") + // ListObjectsV1 (Legacy) + bucket.Methods(http.MethodGet).HandlerFunc( + m.Handle(metrics.APIStats("listobjectsv1", h.ListObjectsV1Handler))). + Name("ListObjectsV1") + // PutBucketLifecycle + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucketlifecycle", h.PutBucketLifecycleHandler))).Queries("lifecycle", ""). + Name("PutBucketLifecycle") + // PutBucketEncryption + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucketencryption", h.PutBucketEncryptionHandler))).Queries("encryption", ""). + Name("PutBucketEncryption") - // PutBucketObjectLockConfig - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucketobjectlockconfig", h.PutBucketObjectLockConfigHandler))).Queries("object-lock", ""). - Name("PutBucketObjectLockConfig") - // PutBucketTaggingHandler - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbuckettagging", h.PutBucketTaggingHandler))).Queries("tagging", ""). - Name("PutBucketTagging") - // PutBucketVersioning - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucketversioning", h.PutBucketVersioningHandler))).Queries("versioning", ""). - Name("PutBucketVersioning") - // PutBucketNotification - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucketnotification", h.PutBucketNotificationHandler))).Queries("notification", ""). - Name("PutBucketNotification") - // PutBucket - bucket.Methods(http.MethodPut).HandlerFunc( - m.Handle(metrics.APIStats("putbucket", h.PutBucketHandler))). - Name("PutBucket") - // HeadBucket - bucket.Methods(http.MethodHead).HandlerFunc( - m.Handle(metrics.APIStats("headbucket", h.HeadBucketHandler))). - Name("HeadBucket") - // PostPolicy - bucket.Methods(http.MethodPost).HeadersRegexp(hdrContentType, "multipart/form-data*").HandlerFunc( - m.Handle(metrics.APIStats("postpolicybucket", h.PostPolicyBucketHandler))). - Name("PostPolicyBucket") - // DeleteMultipleObjects - bucket.Methods(http.MethodPost).HandlerFunc( - m.Handle(metrics.APIStats("deletemultipleobjects", h.DeleteMultipleObjectsHandler))).Queries("delete", ""). - Name("DeleteMultipleObjects") - // DeleteBucketPolicy - bucket.Methods(http.MethodDelete).HandlerFunc( - m.Handle(metrics.APIStats("deletebucketpolicy", h.DeleteBucketPolicyHandler))).Queries("policy", ""). - Name("DeleteBucketPolicy") - // DeleteBucketLifecycle - bucket.Methods(http.MethodDelete).HandlerFunc( - m.Handle(metrics.APIStats("deletebucketlifecycle", h.DeleteBucketLifecycleHandler))).Queries("lifecycle", ""). - Name("DeleteBucketLifecycle") - // DeleteBucketEncryption - bucket.Methods(http.MethodDelete).HandlerFunc( - m.Handle(metrics.APIStats("deletebucketencryption", h.DeleteBucketEncryptionHandler))).Queries("encryption", ""). - Name("DeleteBucketEncryption") - // DeleteBucket - bucket.Methods(http.MethodDelete).HandlerFunc( - m.Handle(metrics.APIStats("deletebucket", h.DeleteBucketHandler))). - Name("DeleteBucket") + // PutBucketPolicy + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucketpolicy", h.PutBucketPolicyHandler))).Queries("policy", ""). + Name("PutBucketPolicy") + // PutBucketObjectLockConfig + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucketobjectlockconfig", h.PutBucketObjectLockConfigHandler))).Queries("object-lock", ""). + Name("PutBucketObjectLockConfig") + // PutBucketTaggingHandler + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbuckettagging", h.PutBucketTaggingHandler))).Queries("tagging", ""). + Name("PutBucketTagging") + // PutBucketVersioning + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucketversioning", h.PutBucketVersioningHandler))).Queries("versioning", ""). + Name("PutBucketVersioning") + // PutBucketNotification + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucketnotification", h.PutBucketNotificationHandler))).Queries("notification", ""). + Name("PutBucketNotification") + // PutBucket + bucket.Methods(http.MethodPut).HandlerFunc( + m.Handle(metrics.APIStats("putbucket", h.PutBucketHandler))). + Name("PutBucket") + // HeadBucket + bucket.Methods(http.MethodHead).HandlerFunc( + m.Handle(metrics.APIStats("headbucket", h.HeadBucketHandler))). + Name("HeadBucket") + // PostPolicy + bucket.Methods(http.MethodPost).HeadersRegexp(hdrContentType, "multipart/form-data*").HandlerFunc( + m.Handle(metrics.APIStats("postpolicybucket", h.PostPolicyBucketHandler))). + Name("PostPolicyBucket") + // DeleteMultipleObjects + bucket.Methods(http.MethodPost).HandlerFunc( + m.Handle(metrics.APIStats("deletemultipleobjects", h.DeleteMultipleObjectsHandler))).Queries("delete", ""). + Name("DeleteMultipleObjects") + // DeleteBucketPolicy + bucket.Methods(http.MethodDelete).HandlerFunc( + m.Handle(metrics.APIStats("deletebucketpolicy", h.DeleteBucketPolicyHandler))).Queries("policy", ""). + Name("DeleteBucketPolicy") + // DeleteBucketLifecycle + bucket.Methods(http.MethodDelete).HandlerFunc( + m.Handle(metrics.APIStats("deletebucketlifecycle", h.DeleteBucketLifecycleHandler))).Queries("lifecycle", ""). + Name("DeleteBucketLifecycle") + // DeleteBucketEncryption + bucket.Methods(http.MethodDelete).HandlerFunc( + m.Handle(metrics.APIStats("deletebucketencryption", h.DeleteBucketEncryptionHandler))).Queries("encryption", ""). + Name("DeleteBucketEncryption") + // DeleteBucket + bucket.Methods(http.MethodDelete).HandlerFunc( + m.Handle(metrics.APIStats("deletebucket", h.DeleteBucketHandler))). + Name("DeleteBucket") + } // Root operation // ListBuckets diff --git a/api/user-auth.go b/api/user-auth.go index 396d1cb3..a97810bf 100644 --- a/api/user-auth.go +++ b/api/user-auth.go @@ -4,22 +4,24 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/nspcc-dev/neofs-s3-gate/auth" + sdk "github.com/nspcc-dev/cdn-neofs-sdk" + "github.com/nspcc-dev/neofs-s3-gate/api/auth" "go.uber.org/zap" ) -func AttachUserAuth(router *mux.Router, center *auth.Center, log *zap.Logger) { - uamw := func(h http.Handler) http.Handler { +func AttachUserAuth(router *mux.Router, center auth.Center, log *zap.Logger) { + router.Use(func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - bearerToken, err := center.AuthenticationPassed(r) + token, err := center.Authenticate(r) if err != nil { log.Error("failed to pass authentication", zap.Error(err)) WriteErrorResponse(r.Context(), w, GetAPIError(ErrAccessDenied), r.URL) return } - h.ServeHTTP(w, r.WithContext(auth.SetBearerToken(r.Context(), bearerToken))) + + h.ServeHTTP(w, r.WithContext( + sdk.SetBearerToken(r.Context(), token))) }) - } - router.Use(uamw) + }) } diff --git a/auth/bearer-token.go b/auth/bearer-token.go deleted file mode 100644 index a7ef9865..00000000 --- a/auth/bearer-token.go +++ /dev/null @@ -1,30 +0,0 @@ -package auth - -import ( - "context" - - "github.com/nspcc-dev/neofs-api-go/pkg/token" - "github.com/pkg/errors" -) - -type contextKey string - -const bearerTokenContextKey contextKey = "bearer-token" - -// GetBearerToken returns a bearer token embedded into a context or error, if any. -func GetBearerToken(ctx context.Context) (*token.BearerToken, error) { - bt := ctx.Value(bearerTokenContextKey) - if bt == nil { - return nil, errors.New("got nil bearer token") - } - v, ok := bt.(*token.BearerToken) - if !ok { - return nil, errors.Errorf("extracted unexpected type other than bearer token's: %T", v) - } - return v, nil -} - -// SetBearerToken return a context with embedded bearer token. -func SetBearerToken(ctx context.Context, bearerToken *token.BearerToken) context.Context { - return context.WithValue(ctx, bearerTokenContextKey, bearerToken) -} diff --git a/auth/center.go b/auth/center.go deleted file mode 100644 index de14d1aa..00000000 --- a/auth/center.go +++ /dev/null @@ -1,127 +0,0 @@ -package auth - -import ( - "bytes" - "context" - "crypto/ecdsa" - "fmt" - "io/ioutil" - "net/http" - "regexp" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws/credentials" - v4 "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/nspcc-dev/neofs-api-go/pkg/token" - "github.com/nspcc-dev/neofs-authmate/accessbox/hcs" - "github.com/nspcc-dev/neofs-authmate/agents/s3" - manager "github.com/nspcc-dev/neofs-authmate/manager/neofs" - "github.com/pkg/errors" - "go.uber.org/zap" -) - -var authorizationFieldRegexp = regexp.MustCompile(`AWS4-HMAC-SHA256 Credential=(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]*)/(?P[^/]+)/aws4_request,\s*SignedHeaders=(?P.+),\s*Signature=(?P.+)`) - -type ( - Center struct { - man *manager.Manager - reg *regexpSubmatcher - - keys *hcs.X25519Keys - } - - Params struct { - Timeout time.Duration - - Log *zap.Logger - Con manager.Connector - - GAKey *hcs.X25519Keys - NFKey *ecdsa.PrivateKey - } -) - -// New creates an instance of AuthCenter. -func New(ctx context.Context, p *Params) (*Center, error) { - m, err := manager.New(ctx, - manager.WithKey(p.NFKey), - manager.WithLogger(p.Log), - manager.WithConnector(p.Con)) - - if err != nil { - return nil, err - } - return &Center{ - man: m, - reg: ®expSubmatcher{re: authorizationFieldRegexp}, - - keys: p.GAKey, - }, nil -} - -func (center *Center) AuthenticationPassed(request *http.Request) (*token.BearerToken, error) { - queryValues := request.URL.Query() - if queryValues.Get("X-Amz-Algorithm") == "AWS4-HMAC-SHA256" { - return nil, errors.New("pre-signed form of request is not supported") - } - authHeaderField := request.Header["Authorization"] - if len(authHeaderField) != 1 { - return nil, errors.New("unsupported request: wrong length of Authorization header field") - } - sms1 := center.reg.getSubmatches(authHeaderField[0]) - if len(sms1) != 7 { - return nil, errors.New("bad Authorization header field") - } - signedHeaderFieldsNames := strings.Split(sms1["signed_header_fields"], ";") - if len(signedHeaderFieldsNames) == 0 { - return nil, errors.New("wrong format of signed headers part") - } - signatureDateTime, err := time.Parse("20060102T150405Z", request.Header.Get("X-Amz-Date")) - if err != nil { - return nil, errors.Wrap(err, "failed to parse x-amz-date header field") - } - accessKeyID := fmt.Sprintf("%s/%s", sms1["access_key_id_cid"], sms1["access_key_id_oid"]) - res, err := s3.NewAgent(center.man).ObtainSecret(request.Context(), center.keys, accessKeyID) - if err != nil { - return nil, errors.Wrap(err, "failed to fetch bearer token") - } - otherRequest := request.Clone(context.TODO()) - otherRequest.Header = map[string][]string{} - for hfn, hfvs := range request.Header { - for _, shfn := range signedHeaderFieldsNames { - if strings.EqualFold(hfn, shfn) { - otherRequest.Header[hfn] = hfvs - } - } - } - awsCreds := credentials.NewStaticCredentials(accessKeyID, res.SecretAccessKey, "") - signer := v4.NewSigner(awsCreds) - body, err := readAndKeepBody(request) - if err != nil { - return nil, errors.Wrap(err, "failed to read out request body") - } - _, err = signer.Sign(otherRequest, body, sms1["service"], sms1["region"], signatureDateTime) - if err != nil { - return nil, errors.Wrap(err, "failed to sign temporary HTTP request") - } - sms2 := center.reg.getSubmatches(otherRequest.Header.Get("Authorization")) - if sms1["v4_signature"] != sms2["v4_signature"] { - return nil, errors.Wrap(err, "failed to pass authentication procedure") - } - return res.BearerToken, nil -} - -// TODO: Make this write into a smart buffer backed by a file on a fast drive. -func readAndKeepBody(request *http.Request) (*bytes.Reader, error) { - if request.Body == nil { - var r bytes.Reader - return &r, nil - } - payload, err := ioutil.ReadAll(request.Body) - if err != nil { - return nil, err - } - request.Body = ioutil.NopCloser(bytes.NewReader(payload)) - return bytes.NewReader(payload), nil -} diff --git a/auth/regexp-utils.go b/auth/regexp-utils.go deleted file mode 100644 index 94ba85d1..00000000 --- a/auth/regexp-utils.go +++ /dev/null @@ -1,19 +0,0 @@ -package auth - -import "regexp" - -type regexpSubmatcher struct { - re *regexp.Regexp -} - -func (resm *regexpSubmatcher) getSubmatches(target string) map[string]string { - matches := resm.re.FindStringSubmatch(target) - l := len(matches) - submatches := make(map[string]string, l) - for i, name := range resm.re.SubexpNames() { - if i > 0 && i <= l { - submatches[name] = matches[i] - } - } - return submatches -} diff --git a/cmd/gate/app-graceful.go b/cmd/gate/app-graceful.go deleted file mode 100644 index 8469d628..00000000 --- a/cmd/gate/app-graceful.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "context" - "os" - "os/signal" - "syscall" - - "go.uber.org/zap" -) - -// newGracefulContext returns graceful context -func newGracefulContext(l *zap.Logger) context.Context { - ctx, cancel := context.WithCancel(context.Background()) - go func() { - ch := make(chan os.Signal, 1) - signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP) - sig := <-ch - l.Info("received signal", - zap.String("signal", sig.String())) - cancel() - }() - return ctx -} diff --git a/cmd/gate/app-logger.go b/cmd/gate/app-logger.go deleted file mode 100644 index fe772c2d..00000000 --- a/cmd/gate/app-logger.go +++ /dev/null @@ -1,142 +0,0 @@ -package main - -import ( - "strings" - - "github.com/spf13/viper" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "google.golang.org/grpc/grpclog" -) - -type ( - zapLogger struct { - zapcore.Core - log *zap.SugaredLogger - } - - logger interface { - grpclog.LoggerV2 - Println(v ...interface{}) - } -) - -const ( - formatJSON = "json" - formatConsole = "console" - - defaultSamplingInitial = 100 - defaultSamplingThereafter = 100 -) - -func gRPCLogger(l *zap.Logger) logger { - log := l.WithOptions( - // skip gRPCLog + zapLogger in caller - zap.AddCallerSkip(2)) - return &zapLogger{ - Core: log.Core(), - log: log.Sugar(), - } -} - -func safeLevel(lvl string) zap.AtomicLevel { - switch strings.ToLower(lvl) { - case "debug": - return zap.NewAtomicLevelAt(zap.DebugLevel) - case "warn": - return zap.NewAtomicLevelAt(zap.WarnLevel) - case "error": - return zap.NewAtomicLevelAt(zap.ErrorLevel) - case "fatal": - return zap.NewAtomicLevelAt(zap.FatalLevel) - case "panic": - return zap.NewAtomicLevelAt(zap.PanicLevel) - default: - return zap.NewAtomicLevelAt(zap.InfoLevel) - } -} - -func newLogger(v *viper.Viper) *zap.Logger { - c := zap.NewProductionConfig() - - c.OutputPaths = []string{"stdout"} - c.ErrorOutputPaths = []string{"stdout"} - - if v.IsSet("logger.sampling") { - c.Sampling = &zap.SamplingConfig{ - Initial: defaultSamplingInitial, - Thereafter: defaultSamplingThereafter, - } - - if val := v.GetInt(cfgLoggerSamplingInitial); val > 0 { - c.Sampling.Initial = val - } - - if val := v.GetInt(cfgLoggerSamplingThereafter); val > 0 { - c.Sampling.Thereafter = val - } - } - - // logger level - c.Level = safeLevel(v.GetString(cfgLoggerLevel)) - traceLvl := safeLevel(v.GetString(cfgLoggerTraceLevel)) - - // logger format - switch f := v.GetString(cfgLoggerFormat); strings.ToLower(f) { - case formatConsole: - c.Encoding = formatConsole - default: - c.Encoding = formatJSON - } - - // logger time - c.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder - - l, err := c.Build( - // enable trace only for current log-level - zap.AddStacktrace(traceLvl)) - if err != nil { - panic(err) - } - - if v.GetBool(cfgLoggerNoDisclaimer) { - return l - } - - name := v.GetString(cfgApplicationName) - version := v.GetString(cfgApplicationVersion) - - return l.With( - zap.String("app_name", name), - zap.String("app_version", version)) -} - -func (z *zapLogger) Info(args ...interface{}) { z.log.Info(args...) } - -func (z *zapLogger) Infoln(args ...interface{}) { z.log.Info(args...) } - -func (z *zapLogger) Infof(format string, args ...interface{}) { z.log.Infof(format, args...) } - -func (z *zapLogger) Println(args ...interface{}) { z.log.Info(args...) } - -func (z *zapLogger) Printf(format string, args ...interface{}) { z.log.Infof(format, args...) } - -func (z *zapLogger) Warning(args ...interface{}) { z.log.Warn(args...) } - -func (z *zapLogger) Warningln(args ...interface{}) { z.log.Warn(args...) } - -func (z *zapLogger) Warningf(format string, args ...interface{}) { z.log.Warnf(format, args...) } - -func (z *zapLogger) Error(args ...interface{}) { z.log.Error(args...) } - -func (z *zapLogger) Errorln(args ...interface{}) { z.log.Error(args...) } - -func (z *zapLogger) Errorf(format string, args ...interface{}) { z.log.Errorf(format, args...) } - -func (z *zapLogger) Fatal(args ...interface{}) { z.log.Fatal(args...) } - -func (z *zapLogger) Fatalln(args ...interface{}) { z.log.Fatal(args...) } - -func (z *zapLogger) Fatalf(format string, args ...interface{}) { z.Fatalf(format, args...) } - -func (z *zapLogger) V(int) bool { return z.Enabled(zapcore.DebugLevel) } diff --git a/cmd/gate/app-settings.go b/cmd/gate/app-settings.go index 5880ad2e..a504758e 100644 --- a/cmd/gate/app-settings.go +++ b/cmd/gate/app-settings.go @@ -1,25 +1,15 @@ package main import ( - "context" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" "fmt" "io" - "io/ioutil" "os" "sort" "strconv" "strings" "time" - "github.com/nspcc-dev/neofs-authmate/accessbox/hcs" - crypto "github.com/nspcc-dev/neofs-crypto" - "github.com/nspcc-dev/neofs-s3-gate/api/pool" - "github.com/nspcc-dev/neofs-s3-gate/auth" "github.com/nspcc-dev/neofs-s3-gate/misc" - "github.com/pkg/errors" "github.com/spf13/pflag" "github.com/spf13/viper" "go.uber.org/zap" @@ -50,6 +40,7 @@ const ( // settings cfgLoggerLevel = "logger.level" cfgLoggerFormat = "logger.format" cfgLoggerTraceLevel = "logger.trace_level" + cfgLoggerNoCaller = "logger.no_caller" cfgLoggerNoDisclaimer = "logger.no_disclaimer" cfgLoggerSamplingInitial = "logger.sampling.initial" cfgLoggerSamplingThereafter = "logger.sampling.thereafter" @@ -84,6 +75,7 @@ const ( // settings cfgEnableMetrics = "metrics" cfgEnableProfiler = "pprof" cfgListenAddress = "listen_address" + cfgListenDomains = "listen_domains" // Peers cfgPeers = "peers" @@ -113,51 +105,8 @@ var ignore = map[string]struct{}{ func (empty) Read([]byte) (int, error) { return 0, io.EOF } -func fetchGateAuthKeys(v *viper.Viper) (*hcs.X25519Keys, error) { - path := v.GetString(cfgGateAuthPrivateKey) - - data, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - - return hcs.NewKeys(data) -} - -func fetchNeoFSKey(v *viper.Viper) (*ecdsa.PrivateKey, error) { - var ( - err error - key *ecdsa.PrivateKey - ) - - switch val := v.GetString(cfgNeoFSPrivateKey); val { - case generated: - key, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if err != nil { - return nil, errors.Wrap(err, "could not generate NeoFS private key") - } - default: - key, err = crypto.LoadPrivateKey(val) - if err != nil { - return nil, errors.Wrap(err, "could not load NeoFS private key") - } - } - - return key, nil -} - -func fetchAuthCenter(ctx context.Context, p *authCenterParams) (*auth.Center, error) { - return auth.New(ctx, &auth.Params{ - Con: p.Pool, - Log: p.Logger, - Timeout: p.Timeout, - GAKey: p.GateAuthKeys, - NFKey: p.NeoFSPrivateKey, - }) -} - -func fetchPeers(l *zap.Logger, v *viper.Viper) []pool.Peer { - peers := make([]pool.Peer, 0) +func fetchPeers(l *zap.Logger, v *viper.Viper) map[string]float64 { + peers := make(map[string]float64, 0) for i := 0; ; i++ { @@ -170,15 +119,30 @@ func fetchPeers(l *zap.Logger, v *viper.Viper) []pool.Peer { break } - peers = append(peers, pool.Peer{ - Address: address, - Weight: weight, - }) + peers[address] = weight + l.Info("add connection peer", + zap.String("address", address), + zap.Float64("weight", weight)) } return peers } +func fetchDomains(v *viper.Viper) []string { + cnt := v.GetInt(cfgListenDomains + ".count") + res := make([]string, 0, cnt) + for i := 0; ; i++ { + domain := v.GetString(cfgListenDomains + "." + strconv.Itoa(i)) + if domain == "" { + break + } + + res = append(res, domain) + } + + return res +} + func newSettings() *viper.Viper { v := viper.New() @@ -189,6 +153,7 @@ func newSettings() *viper.Viper { // flags setup: flags := pflag.NewFlagSet("commandline", pflag.ExitOnError) + flags.SetOutput(os.Stdout) flags.SortFlags = false flags.Bool(cfgEnableProfiler, false, "enable pprof") @@ -213,6 +178,8 @@ func newSettings() *viper.Viper { flags.String(cfgListenAddress, "0.0.0.0:8080", "set address to listen") peers := flags.StringArrayP(cfgPeers, "p", nil, "set NeoFS nodes") + domains := flags.StringArrayP(cfgListenDomains, "d", nil, "set domains to be listened") + // set prefers: v.Set(cfgApplicationName, misc.ApplicationName) v.Set(cfgApplicationVersion, misc.Version) @@ -224,6 +191,7 @@ func newSettings() *viper.Viper { v.SetDefault(cfgLoggerLevel, "debug") v.SetDefault(cfgLoggerFormat, "console") v.SetDefault(cfgLoggerTraceLevel, "panic") + v.SetDefault(cfgLoggerNoCaller, false) v.SetDefault(cfgLoggerNoDisclaimer, true) v.SetDefault(cfgLoggerSamplingInitial, 1000) v.SetDefault(cfgLoggerSamplingThereafter, 1000) @@ -253,6 +221,14 @@ func newSettings() *viper.Viper { } } + if domains != nil && len(*domains) > 0 { + for i := range *domains { + v.SetDefault(cfgListenDomains+"."+strconv.Itoa(i), (*domains)[i]) + } + + v.SetDefault(cfgListenDomains+".count", len(*domains)) + } + switch { case help != nil && *help: fmt.Printf("NeoFS S3 Gateway %s (%s)\n", misc.Version, misc.Build) diff --git a/cmd/gate/app.go b/cmd/gate/app.go index 27d31cc5..d13d782b 100644 --- a/cmd/gate/app.go +++ b/cmd/gate/app.go @@ -2,39 +2,35 @@ package main import ( "context" - "crypto/ecdsa" "errors" "net" "net/http" "os" - "time" - "github.com/nspcc-dev/neofs-authmate/accessbox/hcs" + sdk "github.com/nspcc-dev/cdn-neofs-sdk" + "github.com/nspcc-dev/cdn-neofs-sdk/creds/hcs" + "github.com/nspcc-dev/cdn-neofs-sdk/creds/neofs" + "github.com/nspcc-dev/cdn-neofs-sdk/pool" "github.com/nspcc-dev/neofs-s3-gate/api" + "github.com/nspcc-dev/neofs-s3-gate/api/auth" "github.com/nspcc-dev/neofs-s3-gate/api/handler" "github.com/nspcc-dev/neofs-s3-gate/api/layer" - "github.com/nspcc-dev/neofs-s3-gate/api/pool" - "github.com/nspcc-dev/neofs-s3-gate/auth" "github.com/spf13/viper" "go.uber.org/zap" + "google.golang.org/grpc" "google.golang.org/grpc/keepalive" ) type ( App struct { - cli pool.Pool - ctr *auth.Center + cli pool.Client + ctr auth.Center log *zap.Logger cfg *viper.Viper tls *tlsConfig obj layer.Client api api.Handler - conTimeout time.Duration - reqTimeout time.Duration - - reBalance time.Duration - maxClients api.MaxClients webDone chan struct{} @@ -50,14 +46,17 @@ type ( func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { var ( err error - cli pool.Pool tls *tlsConfig + cli sdk.Client + con pool.Client caller api.Handler - ctr *auth.Center + ctr auth.Center obj layer.Client - gaKey *hcs.X25519Keys - nfKey *ecdsa.PrivateKey + hcsCred hcs.Credentials + nfsCred neofs.Credentials + + peers = fetchPeers(l, v) reBalance = defaultRebalanceTimer conTimeout = defaultConnectTimeout @@ -65,6 +64,9 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { maxClientsCount = defaultMaxClientsCount maxClientsDeadline = defaultMaxClientsDeadline + + hcsCredential = v.GetString(cfgGateAuthPrivateKey) + nfsCredential = v.GetString(cfgNeoFSPrivateKey) ) if v := v.GetDuration(cfgConnectTimeout); v > 0 { @@ -87,11 +89,11 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { reBalance = v } - if nfKey, err = fetchNeoFSKey(v); err != nil { + if nfsCred, err = neofs.New(nfsCredential); err != nil { l.Fatal("could not load NeoFS private key") } - if gaKey, err = fetchGateAuthKeys(v); err != nil { + if hcsCred, err = hcs.NewCredentials(hcsCredential); err != nil { l.Fatal("could not load gate auth key") } @@ -102,54 +104,36 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { } } - peers := fetchPeers(l, v) + l.Info("using credentials", + zap.String("HCS", hcsCredential), + zap.String("NeoFS", nfsCredential)) - poolConfig := &pool.Config{ - ConnectTimeout: conTimeout, - RequestTimeout: reqTimeout, - ConnectionTTL: v.GetDuration(cfgConnectionTTL), + poolOptions := []pool.Option{ + pool.WithLogger(l), + pool.WithWeightPool(peers), + pool.WithCredentials(nfsCred), + pool.WithTickerTimeout(reBalance), + pool.WithConnectTimeout(conTimeout), + pool.WithRequestTimeout(reqTimeout), + pool.WithAPIPreparer(sdk.APIPreparer), + pool.WithGRPCOptions( + grpc.WithBlock(), + grpc.WithInsecure(), + grpc.WithKeepaliveParams(keepalive.ClientParameters{ + Time: v.GetDuration(cfgKeepaliveTime), + Timeout: v.GetDuration(cfgKeepaliveTimeout), + PermitWithoutStream: v.GetBool(cfgKeepalivePermitWithoutStream), + }))} - Peers: peers, - - Logger: l, - PrivateKey: nfKey, - - GRPCLogger: gRPCLogger(l), - GRPCVerbose: v.GetBool(cfgGRPCVerbose), - - ClientParameters: keepalive.ClientParameters{}, - } - - if cli, err = pool.New(poolConfig); err != nil { + if con, err = pool.New(ctx, poolOptions...); err != nil { l.Fatal("could not prepare pool connections", zap.Error(err)) } - { // prepare auth center - ctx, cancel := context.WithTimeout(ctx, conTimeout) - defer cancel() - - params := &authCenterParams{ - Logger: l, - Pool: cli, - - Timeout: conTimeout, - - GateAuthKeys: gaKey, - NeoFSPrivateKey: nfKey, - } - - if ctr, err = fetchAuthCenter(ctx, params); err != nil { - l.Fatal("failed to initialize auth center", zap.Error(err)) - } - } - { // should establish connection with NeoFS Storage Nodes ctx, cancel := context.WithTimeout(ctx, conTimeout) defer cancel() - cli.ReBalance(ctx) - - if _, err = cli.Connection(ctx); err != nil { + if _, err = con.Connection(ctx); err != nil { if errors.Is(err, context.Canceled) { l.Info("connection canceled") os.Exit(0) @@ -160,16 +144,20 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { } } - layerParams := &layer.Params{ - Pool: cli, - Logger: l, - Timeout: reqTimeout, - NFKey: nfKey, + if cli, err = sdk.New(ctx, + sdk.WithLogger(l), + sdk.WithConnectionPool(con), + sdk.WithCredentials(nfsCred), + sdk.WithAPIPreparer(sdk.APIPreparer)); err != nil { + l.Fatal("could not prepare sdk client", + zap.Error(err)) } - if obj, err = layer.NewLayer(layerParams); err != nil { - l.Fatal("could not prepare ObjectLayer", zap.Error(err)) - } + // prepare object layer + obj = layer.NewLayer(l, cli) + + // prepare auth center + ctr = auth.New(cli.Object(), hcsCred.PrivateKey()) if caller, err = handler.New(l, obj); err != nil { l.Fatal("could not initialize API handler", zap.Error(err)) @@ -177,7 +165,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { return &App{ ctr: ctr, - cli: cli, + cli: con, log: l, cfg: v, obj: obj, @@ -187,12 +175,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { webDone: make(chan struct{}, 1), wrkDone: make(chan struct{}, 1), - reBalance: reBalance, - maxClients: api.NewMaxClientsMiddleware(maxClientsCount, maxClientsDeadline), - - conTimeout: conTimeout, - reqTimeout: reqTimeout, } } @@ -231,7 +214,10 @@ func (a *App) Server(ctx context.Context) { attachProfiler(router, a.cfg, a.log) // Attach S3 API: - api.Attach(router, a.maxClients, a.api, a.ctr, a.log) + domains := fetchDomains(a.cfg) + a.log.Info("fetch domains, prepare to use API", + zap.Strings("domains", domains)) + api.Attach(router, domains, a.maxClients, a.api, a.ctr, a.log) // Use mux.Router as http.Handler srv.Handler = router @@ -271,24 +257,7 @@ func (a *App) Server(ctx context.Context) { } func (a *App) Worker(ctx context.Context) { - tick := time.NewTimer(a.reBalance) - -loop: - for { - select { - case <-ctx.Done(): - break loop - case <-tick.C: - ctx, cancel := context.WithTimeout(ctx, a.conTimeout) - a.cli.ReBalance(ctx) - cancel() - - tick.Reset(a.reBalance) - } - } - - tick.Stop() - a.cli.Close() + a.cli.Worker(ctx) a.log.Info("stopping worker") close(a.wrkDone) } diff --git a/cmd/gate/app_option.go b/cmd/gate/app_option.go deleted file mode 100644 index 188a228f..00000000 --- a/cmd/gate/app_option.go +++ /dev/null @@ -1,21 +0,0 @@ -package main - -import ( - "crypto/ecdsa" - "time" - - "github.com/nspcc-dev/neofs-authmate/accessbox/hcs" - "github.com/nspcc-dev/neofs-s3-gate/api/pool" - "go.uber.org/zap" -) - -type ( - authCenterParams struct { - Pool pool.Client - Logger *zap.Logger - Timeout time.Duration - - GateAuthKeys *hcs.X25519Keys - NeoFSPrivateKey *ecdsa.PrivateKey - } -) diff --git a/cmd/gate/main.go b/cmd/gate/main.go index e49f090b..7048af35 100644 --- a/cmd/gate/main.go +++ b/cmd/gate/main.go @@ -1,10 +1,47 @@ package main +import ( + "github.com/nspcc-dev/cdn-neofs-sdk/grace" + "github.com/nspcc-dev/cdn-neofs-sdk/logger" + "github.com/spf13/viper" + "go.uber.org/zap" +) + +func newLogger(v *viper.Viper) *zap.Logger { + options := []logger.Option{ + logger.WithLevel(v.GetString(cfgLoggerLevel)), + logger.WithTraceLevel(v.GetString(cfgLoggerTraceLevel)), + + logger.WithFormat(v.GetString(cfgLoggerFormat)), + + logger.WithSamplingInitial(v.GetInt(cfgLoggerSamplingInitial)), + logger.WithSamplingThereafter(v.GetInt(cfgLoggerSamplingThereafter)), + + logger.WithAppName(v.GetString(cfgApplicationName)), + logger.WithAppVersion(v.GetString(cfgApplicationVersion)), + } + + if v.GetBool(cfgLoggerNoCaller) { + options = append(options, logger.WithoutCaller()) + } + + if v.GetBool(cfgLoggerNoDisclaimer) { + options = append(options, logger.WithoutDisclaimer()) + } + + l, err := logger.New(options...) + if err != nil { + panic(err) + } + + return l +} + func main() { var ( v = newSettings() l = newLogger(v) - g = newGracefulContext(l) + g = grace.Context(l) a = newApp(g, l, v) ) diff --git a/docs/aws-s3-compatibility-list.md b/docs/aws-s3-compatibility-list.md deleted file mode 100644 index 29f698a3..00000000 --- a/docs/aws-s3-compatibility-list.md +++ /dev/null @@ -1,75 +0,0 @@ -## Intro - -NeoFS S3 Gate is largely based on [MinIO]("https://min.io") codebase and therefore inherits its basic API, except cases where NeoFS functionality fails to be mapped reasonably. - -## Reference Resources - -* [MinIO SDK Client Reference]("https://docs.min.io/docs/golang-client-api-reference.html") - -* [AWS S3 API Reference]("https://docs.aws.amazon.com/AmazonS3/latest/API/s3-api.pdf") - - -### Bucket/Object-Level Actions - -| # | Method Name | Status | -|:---:| ------------------------- | ----------------------- | -| 1 | AbortMultipartUpload | Unsupported | -| 2 | CompleteMultipartUpload | Unsupported | -| 3 | CopyObject | Supported | -| 4 | CopyObjectPart | Unsupported | -| 5 | DeleteBucket | Unsupported | -| 6 | DeleteBucketEncryption | Unsupported | -| 7 | DeleteBucketLifecycle | Unsupported | -| 8 | DeleteBucketPolicy | Unsupported | -| 9 | DeleteBucketTagging | Unsupported | -| 10 | DeleteBucketWebsite | Unsupported | -| 11 | DeleteMultipleObjects | Unsupported (issue #26) | -| 12 | DeleteObject | Supported | -| 13 | DeleteObjectTagging | Unsupported | -| 14 | GetBucketACL | Unsupported | -| 15 | GetBucketAccelerate | Supported | -| 16 | GetBucketCors | Unsupported | -| 17 | GetBucketEncryption | Unsupported | -| 18 | GetBucketLifecycle | Unsupported | -| 19 | GetBucketLocation | Unsupported | -| 20 | GetBucketLogging | Unsupported | -| 21 | GetBucketNotification | Unsupported | -| 22 | GetBucketObjectLockConfig | Unsupported | -| 23 | GetBucketPolicy | Unsupported | -| 24 | GetBucketReplication | Unsupported | -| 25 | GetBucketRequestPayment | Unsupported | -| 26 | GetBucketTagging | Unsupported | -| 27 | GetBucketVersioning | Unsupported | -| 28 | GetBucketWebsite | Unsupported | -| 29 | GetObject | Supported | -| 30 | GetObjectACL | Unsupported | -| 31 | GetObjectLegalHold | Unsupported | -| 32 | GetObjectRetention | Unsupported | -| 33 | HeadBucket | Unsupported (isuue #XX) | -| 34 | HeadObject | Supported | -| 35 | ListBucketObjectVersions | Unsupported | -| 36 | ListBuckets | Supported | -| 37 | ListMultipartUploads | Unsupported | -| 38 | ListObjectParts | Unsupported | -| 39 | ListObjectsV1 | Supported | -| 40 | ListObjectsV2 | Supported | -| 41 | ListenBucketNotification | Unsupported | -| 42 | NewMultipartUpload | Unsupported | -| 43 | PostPolicyBucket | Unsupported | -| 44 | PutBucket | Unsupported | -| 45 | PutBucketACL | Unsupported | -| 46 | PutBucketEncryption | Unsupported | -| 47 | PutBucketLifecycle | Unsupported | -| 48 | PutBucketNotification | Unsupported | -| 49 | PutBucketObjectLockConfig | Unsupported | -| 50 | PutBucketPolicy | Unsupported | -| 51 | PutBucketTagging | Unsupported | -| 52 | PutBucketVersioning | Unsupported | -| 53 | PutObject | Supported | -| 54 | PutObjectACL | Unsupported | -| 55 | PutObjectLegalHold | Unsupported | -| 56 | PutObjectPart | Unsupported | -| 57 | PutObjectRetention | Unsupported | -| 58 | PutObjectTagging | Unsupported | -| 59 | SelectObjectContent | Unsupported | - diff --git a/go.mod b/go.mod index df29c9ed..e50e3c9a 100644 --- a/go.mod +++ b/go.mod @@ -3,34 +3,16 @@ module github.com/nspcc-dev/neofs-s3-gate go 1.14 require ( - github.com/aws/aws-sdk-go v1.27.0 - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/aws/aws-sdk-go v1.35.34 github.com/google/uuid v1.1.2 github.com/gorilla/mux v1.7.4 - github.com/mitchellh/mapstructure v1.3.3 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/nspcc-dev/neofs-api-go v0.0.0-20201029071528-352e99d9b91a - github.com/nspcc-dev/neofs-authmate v0.0.0-20201024131449-35d634118c0d - github.com/nspcc-dev/neofs-crypto v0.3.0 - github.com/pelletier/go-toml v1.8.0 // indirect + github.com/nspcc-dev/cdn-neofs-sdk v0.1.0 + github.com/nspcc-dev/neofs-api-go v1.20.3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.7.1 - github.com/prometheus/common v0.11.1 // indirect - github.com/spf13/afero v1.3.3 // indirect - github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.6.1 - go.uber.org/atomic v1.6.0 go.uber.org/zap v1.16.0 - golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect - golang.org/x/sys v0.0.0-20200806125547-5acd03effb82 // indirect - golang.org/x/text v0.3.3 // indirect - golang.org/x/tools v0.0.0-20200925191224-5d1fdd8fa346 // indirect - google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98 // indirect - google.golang.org/grpc v1.33.0 - google.golang.org/protobuf v1.25.0 // indirect - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/ini.v1 v1.57.0 // indirect + google.golang.org/grpc v1.33.1 ) diff --git a/go.sum b/go.sum index 610e6e99..6a86a25c 100644 --- a/go.sum +++ b/go.sum @@ -20,35 +20,24 @@ github.com/CityOfZion/neo-go v0.70.1-pre.0.20191212173117-32ac01130d4c/go.mod h1 github.com/CityOfZion/neo-go v0.71.1-pre.0.20200129171427-f773ec69fb84/go.mod h1:FLI526IrRWHmcsO+mHsCbj64pJZhwQFTLJZu+A4PGOA= github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.50 h1:slDmfW6KCHcC7U+LP3DDBbm4fqTwZGn1beOFPfGaLvo= github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/abiosoft/ishell v2.0.0+incompatible/go.mod h1:HQR9AqF2R3P4XXpMpI0NAzgHf/aS6+zVXRj14cVk9qg= github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db/go.mod h1:rB3B4rKii8V21ydCbIzH5hZiCQE7f5E9SzUb/ZZx530= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0 h1:0xphMHGMLBrPMfxR2AmVjZKcMEESEgWF8Kru94BNByk= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go v1.35.34 h1:PfsnVvEq7FgsgIOsW8YeParB9ZknW4NXPXcsgqt4srE= +github.com/aws/aws-sdk-go v1.35.34/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -64,8 +53,6 @@ github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVa github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= @@ -76,11 +63,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= @@ -89,17 +73,12 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -113,52 +92,34 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:rZfgFAXFS/z/lEd6LJmf9HVZ1LkgYiHx5pHhV5DR16M= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-redis/redis v6.10.2+incompatible h1:SLbqrO/Ik1nhXA5/cbEs1P5MUBo1Qq4ihlNfGnnipPw= github.com/go-redis/redis v6.10.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -171,13 +132,11 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -189,14 +148,11 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= @@ -205,25 +161,17 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= @@ -239,7 +187,6 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= @@ -252,32 +199,27 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -286,9 +228,6 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -296,11 +235,9 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -314,28 +251,17 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mr-tron/base58 v1.1.2 h1:ZEw4I2EgPKDJ2iEw0cNmLB3ROrEmkOtXIkaG7wZg+78= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nspcc-dev/cdn-neofs-sdk v0.1.0 h1:nexBQL32WeQC2mvVMiWlOqI2enKcIJlFyxejU1FeBNo= +github.com/nspcc-dev/cdn-neofs-sdk v0.1.0/go.mod h1:ujzmbHoxhuyY4SgHUDSwtfZQNHu06izC4xOkPj+YziY= github.com/nspcc-dev/dbft v0.0.0-20191205084618-dacb1a30c254/go.mod h1:w1Ln2aT+dBlPhLnuZhBV+DfPEdS2CHWWLp5JTScY3bw= github.com/nspcc-dev/dbft v0.0.0-20191209120240-0d6b7568d9ae/go.mod h1:3FjXOoHmA51EGfb5GS/HOv7VdmngNRTssSeQ729dvGY= github.com/nspcc-dev/dbft v0.0.0-20200117124306-478e5cfbf03a/go.mod h1:/YFK+XOxxg0Bfm6P92lY5eDSLYfp06XOdL8KAVgXjVk= @@ -346,11 +272,8 @@ github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkP github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg= github.com/nspcc-dev/neo-go v0.91.0 h1:KKOPMKs0fm8JIau1SuwxiLdrZ+1kDPBiVRlWwzfebWE= github.com/nspcc-dev/neo-go v0.91.0/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5hTjFRUDcc= -github.com/nspcc-dev/neofs-api-go v0.0.0-20201022161545-ad0b01e892dd/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8= -github.com/nspcc-dev/neofs-api-go v0.0.0-20201029071528-352e99d9b91a h1:A/8D9A9Fbp4tw1xGgfZB0vtPKEQ/LYq0l7DFuM4KeS4= -github.com/nspcc-dev/neofs-api-go v0.0.0-20201029071528-352e99d9b91a/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8= -github.com/nspcc-dev/neofs-authmate v0.0.0-20201024131449-35d634118c0d h1:X/hrFKVSu42PPmRiaITk9okspO9oSNmg71TZ6YIAQUw= -github.com/nspcc-dev/neofs-authmate v0.0.0-20201024131449-35d634118c0d/go.mod h1:GmnOjaC1aIb2umz3q1dvU0Y5kk+FFhEsps0j6/QJf30= +github.com/nspcc-dev/neofs-api-go v1.20.3 h1:V8iqyAaX1WJFiAO79enjETveZfwForBoti6MwdY/Bf8= +github.com/nspcc-dev/neofs-api-go v1.20.3/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM= @@ -358,10 +281,7 @@ github.com/nspcc-dev/neofs-crypto v0.3.0/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BE github.com/nspcc-dev/rfc6979 v0.1.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= github.com/nspcc-dev/rfc6979 v0.2.0 h1:3e1WNxrN60/6N0DW7+UYisLeZJyfqZTNOjeV/toYvOE= github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= @@ -370,108 +290,65 @@ github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= -github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.11.1 h1:0ZISXCMRuCZcxF77aT1BXY5m74mX2vrGYl1dSwBI0Jo= -github.com/prometheus/common v0.11.1/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.3.3 h1:p5gZEKLYoL7wh8VrJesMaYeNxdEd1v3cb4irOk9zB54= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -479,9 +356,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -493,19 +367,14 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v0.0.0-20180307113352-169b1b37be73 h1:I2drr5K0tykBofr74ZEGliE/Hf6fNkEbcPyFvsy7wZk= github.com/syndtr/goleveldb v0.0.0-20180307113352-169b1b37be73/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= -github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/gopher-lua v0.0.0-20190514113301-1cd887cd7036/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191128022950-c6266f4fe8d7/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= @@ -513,26 +382,18 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -543,9 +404,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -564,15 +423,11 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -581,7 +436,6 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -590,10 +444,10 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -604,7 +458,6 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -612,7 +465,6 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -625,36 +477,28 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200806125547-5acd03effb82 h1:6cBnXxYO+CiRVrChvCosSv7magqTPbyAgz1M8iOv5wM= -golang.org/x/sys v0.0.0-20200806125547-5acd03effb82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180318012157-96caea41033d/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -675,19 +519,12 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc h1:NCy3Ohtk6Iny5V/reW2Ktypo4zIpWBdRJ1uFMjBxdg8= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200925191224-5d1fdd8fa346 h1:hzJjkvxUIF3bSt+v8N5tBQNx/605vszZJ+3XsIamzZo= -golang.org/x/tools v0.0.0-20200925191224-5d1fdd8fa346/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20200123022218-593de606220b h1:ztSlcncMErSAUzXwnVO1iTPxHwtvOHBB26SGiyYXIEE= +golang.org/x/tools v0.0.0-20200123022218-593de606220b/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -695,7 +532,6 @@ google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -704,73 +540,51 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98 h1:LCO0fg4kb6WwkXQXRQQgUYsFeFb5taTX5WAx5O/Vt28= -google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg= -google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.1 h1:DGeFlSan2f+WEtCERJ4J9GJWk15TxUi8QGagfI87Xyc= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/abiosoft/ishell.v2 v2.0.0/go.mod h1:sFp+cGtH6o4s1FtpVPTMcHq2yue+c4DGOVohJCPUzwY= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= -gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -778,5 +592,3 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/misc/build.go b/misc/build.go index cb05cdae..c014aaca 100644 --- a/misc/build.go +++ b/misc/build.go @@ -1,9 +1,9 @@ package misc const ( - Prefix = "S3" - ApplicationName = "neofs-s3-gate" + + Prefix = "S3_GW" ) var (