[#2104] cli: OID signature in output

OID signature should always be present in an object; it does not relate
to the object split.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
fyrchik/simplify-services
Pavel Karpy 2022-11-25 14:31:36 +03:00 committed by fyrchik
parent 816c74d185
commit ca3596dd05
2 changed files with 12 additions and 11 deletions

View File

@ -38,6 +38,7 @@ Changelog for NeoFS Node
- Panic in IR when performing HEAD requests (#2069)
- Write-cache flush duplication (#2074)
- Ignore error if a transaction already exists in a morph client (#2075)
- ObjectID signature output in the CLI (#2104)
### Removed
### Updated

View File

@ -160,6 +160,17 @@ func printHeader(cmd *cobra.Command, obj *object.Object) error {
cmd.Printf(" %s=%s\n", attr.Key(), attr.Value())
}
if signature := obj.Signature(); signature != nil {
cmd.Print("ID signature:\n")
// TODO(@carpawell): #1387 implement and use another approach to avoid conversion
var sigV2 refs.Signature
signature.WriteToV2(&sigV2)
cmd.Printf(" public key: %s\n", hex.EncodeToString(sigV2.GetKey()))
cmd.Printf(" signature: %s\n", hex.EncodeToString(sigV2.GetSign()))
}
return printSplitHeader(cmd, obj)
}
@ -180,17 +191,6 @@ func printSplitHeader(cmd *cobra.Command, obj *object.Object) error {
cmd.Printf("Split ChildID: %s\n", child.String())
}
if signature := obj.Signature(); signature != nil {
cmd.Print("Split Header Signature:\n")
// TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion
var sigV2 refs.Signature
signature.WriteToV2(&sigV2)
cmd.Printf(" public key: %s\n", hex.EncodeToString(sigV2.GetKey()))
cmd.Printf(" signature: %s\n", hex.EncodeToString(sigV2.GetSign()))
}
parent := obj.Parent()
if parent != nil {
cmd.Print("\nSplit Parent Header:\n")