Skip to content

Commit

Permalink
*: Upgrade to the latest github.com/nspcc-dev/neofs-sdk-go revision
Browse files Browse the repository at this point in the history
It brings breaking (for good) changes which need to be adapted asap. New
SDK also includes fix of numeric access rules' processing.

Fixes #2785.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Apr 1, 2024
1 parent f4812fa commit 25b2988
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
11 changes: 9 additions & 2 deletions cmd/neofs-cli/modules/util/sign_bearer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/common"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/key"
neofsecdsa "github.com/nspcc-dev/neofs-sdk-go/crypto/ecdsa"
"github.com/nspcc-dev/neofs-sdk-go/user"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -38,7 +38,14 @@ func signBearerToken(cmd *cobra.Command, _ []string) {
btok := common.ReadBearerToken(cmd, signFromFlag)
pk := key.GetOrGenerate(cmd)

err := btok.Sign(neofsecdsa.SignerRFC6979(*pk))
signer := user.NewAutoIDSignerRFC6979(*pk)
var zeroUsr user.ID
if issuer := btok.Issuer(); !issuer.Equals(zeroUsr) {

Check warning on line 43 in cmd/neofs-cli/modules/util/sign_bearer.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/util/sign_bearer.go#L41-L43

Added lines #L41 - L43 were not covered by tests
// issuer is already set, don't corrupt it
signer = user.NewSigner(signer, issuer)

Check warning on line 45 in cmd/neofs-cli/modules/util/sign_bearer.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/util/sign_bearer.go#L45

Added line #L45 was not covered by tests
}

err := btok.Sign(signer)

Check warning on line 48 in cmd/neofs-cli/modules/util/sign_bearer.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/util/sign_bearer.go#L48

Added line #L48 was not covered by tests
common.ExitOnErr(cmd, "", err)

to := cmd.Flag(signToFlag).Value.String()
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ require (
github.com/nspcc-dev/hrw/v2 v2.0.1
github.com/nspcc-dev/locode-db v0.6.0
github.com/nspcc-dev/neo-go v0.105.1
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240228163253-cb87bbd5e4eb
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240305074711-35bc78d84dc4
github.com/nspcc-dev/neofs-contract v0.19.1
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11.0.20240320182730-5b6b37a2d338
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11.0.20240327164418-bed3d5986cab
github.com/nspcc-dev/tzhash v1.8.0
github.com/olekukonko/tablewriter v0.0.5
github.com/panjf2000/ants/v2 v2.9.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ github.com/nspcc-dev/neo-go v0.105.1 h1:r0b2yIwLBi+ARBKU94gHL9oTFEB/XMJ0YlS2HN9Q
github.com/nspcc-dev/neo-go v0.105.1/go.mod h1:GNh0cRALV/cuj+/xg2ZHDsrFbqcInqG7jjhqsLEnlNc=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240228093917-6a560b9a9559 h1:NHa8O7YldwrOXkZLe/lhs6k9Ay8AtbWk/ti1TBUZqug=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240228093917-6a560b9a9559/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240228163253-cb87bbd5e4eb h1:vvMxf818Ea2Ql+j9QX7zOlEXDrVlbAzR0DhGvrULilQ=
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240228163253-cb87bbd5e4eb/go.mod h1:7Tm1NKEoUVVIUlkVwFrPh7GG5+Lmta2m7EGr4oVpBd8=
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240305074711-35bc78d84dc4 h1:arN0Ypn+jawZpu1BND7TGRn44InAVIqKygndsx0y2no=
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240305074711-35bc78d84dc4/go.mod h1:7Tm1NKEoUVVIUlkVwFrPh7GG5+Lmta2m7EGr4oVpBd8=
github.com/nspcc-dev/neofs-contract v0.19.1 h1:U1Uh+MlzfkalO0kRJ2pADZyHrmAOroC6KLFjdWnTNR0=
github.com/nspcc-dev/neofs-contract v0.19.1/go.mod h1:ZOGouuwuHpgvYkx/LCGufGncIzEUhYEO18LL4cWEbyw=
github.com/nspcc-dev/neofs-crypto v0.4.1 h1:B6S0zXMWrVFlf/GlII6xKRGWU0VE7dHM+QkoKAO7AQA=
github.com/nspcc-dev/neofs-crypto v0.4.1/go.mod h1:0SHn+sSn+lrrIvonLR8MgbOlBhXZKhc4rw/l2htYeA0=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11.0.20240320182730-5b6b37a2d338 h1:MIOkxFQCxZCRL34hRdmwx+SyljvhXSAqBC1IujH5kdA=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11.0.20240320182730-5b6b37a2d338/go.mod h1:y4oCltutxqnAAsXPKSNarCIp2fWY9keyZW6ZqNzyrEs=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11.0.20240327164418-bed3d5986cab h1:KKWygIAtS5x59zBa8TvPX4rX+fikkVdhVxl/p4c370s=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11.0.20240327164418-bed3d5986cab/go.mod h1:2XHytVt+AFQkwr6vpcYvdm13mA2rZxB+STrxtwSrtx8=
github.com/nspcc-dev/rfc6979 v0.2.1 h1:8wWxkamHWFmO790GsewSoKUSJjVnL1fmdRpokU/RgRM=
github.com/nspcc-dev/rfc6979 v0.2.1/go.mod h1:Tk7h5kyUWkhjyO3zUgFFhy1v2vQv3BvQEntakdtqrWc=
github.com/nspcc-dev/tzhash v1.8.0 h1:pJvzME2mZzP/h5rcy/Wb6amT9FJBFeKbJ3HEnWEeUpY=
Expand Down
3 changes: 1 addition & 2 deletions pkg/services/tree/signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/nspcc-dev/neofs-sdk-go/container/acl"
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
neofsecdsa "github.com/nspcc-dev/neofs-sdk-go/crypto/ecdsa"
eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl"
netmapSDK "github.com/nspcc-dev/neofs-sdk-go/netmap"
"github.com/nspcc-dev/neofs-sdk-go/user"
Expand Down Expand Up @@ -77,7 +76,7 @@ func TestMessageSign(t *testing.T) {
cid1 := cidtest.ID()
cid2 := cidtest.ID()

signer := neofsecdsa.SignerRFC6979(privs[0].PrivateKey)
signer := user.NewAutoIDSignerRFC6979(privs[0].PrivateKey)

ownerID := user.ResolveFromECDSAPublicKey(privs[0].PrivateKey.PublicKey)

Expand Down

0 comments on commit 25b2988

Please sign in to comment.