Refactor format validator #520

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/token-signature into master 2023-07-17 07:07:22 +00:00
Showing only changes of commit fffd1837f2 - Show all commits

View file

@ -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 errTombstoneExpiration = errors.New("tombstone body and header contain different expiration values")
var errMissingSignature = errors.New("missing signature")
func defaultCfg() *cfg { func defaultCfg() *cfg {
return new(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 { func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error {
sig := obj.Signature() sig := obj.Signature()
if sig == nil { if sig == nil {
// TODO(@cthulhu-rider): #468 use "const" error return errMissingSignature
return errors.New("missing signature")
} }
var sigV2 refs.Signature var sigV2 refs.Signature
@ -157,8 +158,6 @@ func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error {
return v.checkOwnerKey(*obj.OwnerID(), key) return v.checkOwnerKey(*obj.OwnerID(), key)
} }
// FIXME: #1159 perform token verification
return nil return nil
} }