forked from TrueCloudLab/frostfs-node
[#520] objectcore: Refactor format validator
Remove redundant FIXME. Move error to consts. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
11027945d8
commit
397131b0ea
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue