forked from TrueCloudLab/frostfs-node
[#1865] cli/object: Do not open remote sessions in reading ops
It does not make sense to open remote sessions with the storage node in `get`, `head`, `search`, `range` and `hash` sub-commands of `neofs-cli object` command. Do not use NeoFS API `SessionService` in mentioned commands. Decode object session from JSON file specified `--session` flag. Perform some sanity checks instantly on CLI side. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
parent
49eab6318c
commit
9a006ac14f
7 changed files with 112 additions and 9 deletions
|
@ -95,9 +95,12 @@ func getObjectHash(cmd *cobra.Command, _ []string) {
|
|||
return
|
||||
}
|
||||
|
||||
cli := internalclient.GetSDKClientByFlag(cmd, pk, commonflags.RPC)
|
||||
|
||||
var hashPrm internalclient.HashPayloadRangesPrm
|
||||
sessionCli.Prepare(cmd, cnr, &obj, pk, &hashPrm)
|
||||
hashPrm.SetClient(cli)
|
||||
Prepare(cmd, &hashPrm)
|
||||
readSession(cmd, &hashPrm, pk, cnr, obj)
|
||||
hashPrm.SetAddress(objAddr)
|
||||
hashPrm.SetSalt(salt)
|
||||
hashPrm.SetRanges(ranges)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue