forked from TrueCloudLab/frostfs-rest-gw
[#53] Update SDK to fix panic on go1.19
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
c9aa772538
commit
ab2a2abbd5
5 changed files with 17 additions and 16 deletions
|
@ -914,7 +914,7 @@ func restContainerEACLPut(ctx context.Context, t *testing.T, clientPool *pool.Po
|
|||
require.NoError(t, err)
|
||||
expectedTable.SetCID(cnrID)
|
||||
|
||||
require.True(t, eacl.EqualTables(*expectedTable, *table))
|
||||
require.True(t, eacl.EqualTables(*expectedTable, table))
|
||||
}
|
||||
|
||||
func restContainerEACLGet(ctx context.Context, t *testing.T, p *pool.Pool, cnrID cid.ID) {
|
||||
|
@ -938,7 +938,7 @@ func restContainerEACLGet(ctx context.Context, t *testing.T, p *pool.Pool, cnrID
|
|||
require.NoError(t, err)
|
||||
actualTable.SetCID(cnrID)
|
||||
|
||||
require.True(t, eacl.EqualTables(*expectedTable, *actualTable))
|
||||
require.True(t, eacl.EqualTables(expectedTable, *actualTable))
|
||||
}
|
||||
|
||||
func restContainerList(ctx context.Context, t *testing.T, p *pool.Pool, owner user.ID, cnrID cid.ID) {
|
||||
|
@ -1217,7 +1217,7 @@ func createContainer(ctx context.Context, t *testing.T, clientPool *pool.Pool, o
|
|||
CID, err := clientPool.PutContainer(ctx, prm)
|
||||
require.NoError(t, err)
|
||||
|
||||
return *CID
|
||||
return CID
|
||||
}
|
||||
|
||||
func createObject(ctx context.Context, t *testing.T, p *pool.Pool, ownerID *user.ID, cnrID cid.ID, headers map[string]string, payload []byte) oid.ID {
|
||||
|
@ -1242,7 +1242,7 @@ func createObject(ctx context.Context, t *testing.T, p *pool.Pool, ownerID *user
|
|||
objID, err := p.PutObject(ctx, prm)
|
||||
require.NoError(t, err)
|
||||
|
||||
return *objID
|
||||
return objID
|
||||
}
|
||||
|
||||
func restrictByEACL(ctx context.Context, t *testing.T, clientPool *pool.Pool, cnrID cid.ID) *eacl.Table {
|
||||
|
|
6
go.mod
6
go.mod
|
@ -12,8 +12,8 @@ require (
|
|||
github.com/go-openapi/validate v0.21.0
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/nspcc-dev/neo-go v0.99.1
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.13.0
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.13.2-0.20220818094951-98db3fa28419
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220824140410-7537fa0decc5
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/testcontainers/testcontainers-go v0.13.0
|
||||
|
@ -62,7 +62,7 @@ require (
|
|||
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
|
||||
github.com/mr-tron/base58 v1.2.0 // indirect
|
||||
github.com/nspcc-dev/hrw v1.0.9 // indirect
|
||||
github.com/nspcc-dev/neofs-crypto v0.3.0 // indirect
|
||||
github.com/nspcc-dev/neofs-crypto v0.4.0 // indirect
|
||||
github.com/nspcc-dev/rfc6979 v0.2.0 // indirect
|
||||
github.com/nspcc-dev/tzhash v1.6.1 // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
|
|
11
go.sum
11
go.sum
|
@ -745,17 +745,18 @@ github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220713145417-4f184498bc42/go.mo
|
|||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220727202624-6c7a401f776a/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.13.0 h1:7BcBiSjmWqJx0SPFlGRYt9ZFbMjucRIz9+Mv8UBLeq8=
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.13.0/go.mod h1:73j09Xa7I2zQbM3HCvAHnDHPYiiWnEHa1d6Z6RDMBLU=
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.13.2-0.20220818094951-98db3fa28419 h1:NFj8D0UYfHzvC+gIhK7yIUOyEcZi21caQsuYVbJGrVU=
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.13.2-0.20220818094951-98db3fa28419/go.mod h1:NAaDfOnFWIbAFkTj7pNQ+cknVue0JbdeRT9QQaeBCEY=
|
||||
github.com/nspcc-dev/neofs-contract v0.15.3/go.mod h1:BXVZUZUJxrmmDETglXHI8+5DSgn84B9y5DoSWqEjYCs=
|
||||
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=
|
||||
github.com/nspcc-dev/neofs-crypto v0.3.0/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw=
|
||||
github.com/nspcc-dev/neofs-crypto v0.4.0 h1:5LlrUAM5O0k1+sH/sktBtrgfWtq1pgpDs09fZo+KYi4=
|
||||
github.com/nspcc-dev/neofs-crypto v0.4.0/go.mod h1:6XJ8kbXgOfevbI2WMruOtI+qUJXNwSGM/E9eClXxPHs=
|
||||
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211201182451-a5b61c4f6477/go.mod h1:dfMtQWmBHYpl9Dez23TGtIUKiFvCIxUZq/CkSIhEpz4=
|
||||
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20220113123743-7f3162110659/go.mod h1:/jay1lr3w7NQd/VDBkEhkJmDmyPNsu4W+QV2obsUV40=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6 h1:RgkytZY51qCFL7Bbo2GRAAGHukxM9CpNkkDYr15AOA0=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6/go.mod h1:lis8Maqsac+fwSGsEbqHqsA8ttQxSo3xENLmo4QhcW4=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220824140410-7537fa0decc5 h1:BkjgenUQeXnMnbvdpyn8tOoxZmaeKOsN6EEq8wF9Xnw=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220824140410-7537fa0decc5/go.mod h1:BQPxy2sOURSegZJVnrwYDagPtKI3H1Ctc7e0yS0xHvk=
|
||||
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=
|
||||
|
|
|
@ -244,7 +244,7 @@ func getContainerInfo(ctx context.Context, p *pool.Pool, cnrID cid.ID) (*models.
|
|||
|
||||
return &models.ContainerInfo{
|
||||
ContainerID: util.NewString(cnrID.String()),
|
||||
ContainerName: util.NewString(container.Name(*cnr)),
|
||||
ContainerName: util.NewString(container.Name(cnr)),
|
||||
OwnerID: util.NewString(cnr.Owner().String()),
|
||||
BasicACL: util.NewString(cnr.BasicACL().EncodeToString()),
|
||||
CannedACL: friendlyBasicACL(cnr.BasicACL()),
|
||||
|
@ -277,7 +277,7 @@ func friendlyBasicACL(basicACL acl.Basic) string {
|
|||
}
|
||||
}
|
||||
|
||||
func getContainerVersion(cnr *container.Container) version.Version {
|
||||
func getContainerVersion(cnr container.Container) version.Version {
|
||||
var v2cnr containerv2.Container
|
||||
cnr.WriteToV2(&v2cnr)
|
||||
|
||||
|
@ -400,7 +400,7 @@ func createContainer(ctx context.Context, p *pool.Pool, stoken session.Container
|
|||
return cid.ID{}, fmt.Errorf("put container: %w", err)
|
||||
}
|
||||
|
||||
return *cnrID, nil
|
||||
return cnrID, nil
|
||||
}
|
||||
|
||||
func checkNNSContainerName(name string) error {
|
||||
|
|
|
@ -178,7 +178,7 @@ func (a *API) GetObjectInfo(params operations.GetObjectInfoParams, principal *mo
|
|||
|
||||
sb := new(strings.Builder)
|
||||
encoder := base64.NewEncoder(base64.StdEncoding, sb)
|
||||
payloadSize, err := io.Copy(encoder, rangeRes)
|
||||
payloadSize, err := io.Copy(encoder, &rangeRes)
|
||||
if err != nil {
|
||||
errResp := a.logAndGetErrorResponse("encode object payload", err)
|
||||
return errorResponse.WithPayload(errResp)
|
||||
|
|
Loading…
Reference in a new issue