From fffd1837f289d6bbd158d9078c374f7cc262b1da Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 13 Jul 2023 16:43:41 +0300 Subject: [PATCH] [#520] objectcore: Refactor format validator Remove redundant FIXME. Move error to consts. Signed-off-by: Dmitrii Stepanov --- pkg/core/object/fmt.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/core/object/fmt.go b/pkg/core/object/fmt.go index abf8f02cb..e6d8174fa 100644 --- a/pkg/core/object/fmt.go +++ b/pkg/core/object/fmt.go @@ -64,6 +64,8 @@ var errNoExpirationEpoch = errors.New("missing expiration epoch attribute") var errTombstoneExpiration = errors.New("tombstone body and header contain different expiration values") +var errMissingSignature = errors.New("missing signature") + func defaultCfg() *cfg { return new(cfg) } @@ -135,8 +137,7 @@ func (v *FormatValidator) Validate(ctx context.Context, obj *objectSDK.Object, u func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error { sig := obj.Signature() if sig == nil { - // TODO(@cthulhu-rider): #468 use "const" error - return errors.New("missing signature") + return errMissingSignature } var sigV2 refs.Signature @@ -157,8 +158,6 @@ func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error { return v.checkOwnerKey(*obj.OwnerID(), key) } - // FIXME: #1159 perform token verification - return nil }