From f435ab1b26c93769ec6b08daf328f8d5541bf280 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 12 Sep 2023 10:05:44 +0300 Subject: [PATCH] [#682] go.mod: Update sdk-go Signed-off-by: Evgenii Stratonikov --- cmd/frostfs-cli/internal/client/client.go | 45 ++++++++++------------ cmd/frostfs-cli/modules/session/create.go | 2 +- go.mod | 2 +- go.sum | Bin 100798 -> 100798 bytes 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/cmd/frostfs-cli/internal/client/client.go b/cmd/frostfs-cli/internal/client/client.go index ffed877c7..4cc206925 100644 --- a/cmd/frostfs-cli/internal/client/client.go +++ b/cmd/frostfs-cli/internal/client/client.go @@ -8,6 +8,7 @@ import ( "io" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" containerSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" @@ -773,39 +774,33 @@ func (x HashPayloadRangesRes) HashList() [][]byte { // Returns any error which prevented the operation from completing correctly in error return. // Returns an error if number of received hashes differs with the number of requested ranges. func HashPayloadRanges(ctx context.Context, prm HashPayloadRangesPrm) (*HashPayloadRangesRes, error) { - var cliPrm client.PrmObjectHash - cliPrm.FromContainer(prm.objAddr.Container()) - cliPrm.ByID(prm.objAddr.Object()) + rngs := make([]objectSDK.Range, len(prm.rngs)) - if prm.local { - cliPrm.MarkLocal() + for i, r := range prm.rngs { + if r != nil { + rngs[i] = *r + } } - cliPrm.UseSalt(prm.salt) - - rngs := make([]uint64, 2*len(prm.rngs)) - - for i := range prm.rngs { - rngs[2*i] = prm.rngs[i].GetOffset() - rngs[2*i+1] = prm.rngs[i].GetLength() - } - - cliPrm.SetRangeList(rngs...) - + cs := checksum.SHA256 if prm.tz { - cliPrm.TillichZemorAlgo() + cs = checksum.TZ } - if prm.sessionToken != nil { - cliPrm.WithinSession(*prm.sessionToken) + cnr := prm.objAddr.Container() + obj := prm.objAddr.Object() + cliPrm := client.PrmObjectHash{ + ContainerID: &cnr, + ObjectID: &obj, + Local: prm.local, + Salt: prm.salt, + Ranges: rngs, + ChecksumType: cs, + Session: prm.sessionToken, + BearerToken: prm.bearerToken, + XHeaders: prm.xHeaders, } - if prm.bearerToken != nil { - cliPrm.WithBearerToken(*prm.bearerToken) - } - - cliPrm.WithXHeaders(prm.xHeaders...) - res, err := prm.cli.ObjectHash(ctx, cliPrm) if err != nil { return nil, fmt.Errorf("read payload hashes via client: %w", err) diff --git a/cmd/frostfs-cli/modules/session/create.go b/cmd/frostfs-cli/modules/session/create.go index c578fc6b7..f9705c023 100644 --- a/cmd/frostfs-cli/modules/session/create.go +++ b/cmd/frostfs-cli/modules/session/create.go @@ -105,7 +105,7 @@ func CreateSession(ctx context.Context, dst *session.Object, c *client.Client, l var sessionPrm internalclient.CreateSessionPrm sessionPrm.SetClient(c) - sessionPrm.SetExp(exp) + sessionPrm.Expiration = exp sessionRes, err := internalclient.CreateSession(ctx, sessionPrm) if err != nil { diff --git a/go.mod b/go.mod index e9b00cd67..a6582d429 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230802075510-964c3edb3f44 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6 - git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230904165523-55a1f23e7170 + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230911122224-ac8fc6d4400c git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 github.com/cheggaaa/pb v1.0.29 diff --git a/go.sum b/go.sum index 1d00dcf3739ee97ca708e9e33add949da77cccd3..a054f882af56f4ef2e8f49cb29d25d0b19252483 100644 GIT binary patch delta 117 zcmdltnQh->whb17E{2ANMnGVqo0x2omTZ<{Vq##BtdL=7mF}XQl4a@{RbiQxlb7jI zY7vs-6POa@?wn%b?de|?nU$5|l49tc9G2oaxq(+>vWlRHC|1Lo&kAloE6Dh<8~{n1 BB!2(^ delta 117 zcmdltnQh->whb17E(RusW~Qb_#=54aiH2!L#;N9p<^~EGhE{q0!DfNs;THZT6)pun zW`-dVsoH){1z`~(PWov9CRLRNIYAi)sgB`ko|7ARH72VFiil!0tof|q_OpVFAIkyQ CMk1I1