forked from TrueCloudLab/frostfs-node
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
6921a89061
commit
7429553266
209 changed files with 1068 additions and 1036 deletions
|
@ -117,7 +117,7 @@ func (v *FormatValidator) Validate(ctx context.Context, obj *objectSDK.Object, u
|
|||
}
|
||||
|
||||
if !unprepared {
|
||||
if err := v.validateSignatureKey(obj); err != nil {
|
||||
if err := v.validateSignatureKey(ctx, obj); err != nil {
|
||||
return fmt.Errorf("(%T) could not validate signature key: %w", v, err)
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ func (v *FormatValidator) Validate(ctx context.Context, obj *objectSDK.Object, u
|
|||
return nil
|
||||
}
|
||||
|
||||
func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error {
|
||||
func (v *FormatValidator) validateSignatureKey(ctx context.Context, obj *objectSDK.Object) error {
|
||||
sig := obj.Signature()
|
||||
if sig == nil {
|
||||
return errMissingSignature
|
||||
|
@ -156,7 +156,7 @@ func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error {
|
|||
ownerID := obj.OwnerID()
|
||||
|
||||
if token == nil && obj.ECHeader() != nil {
|
||||
role, err := v.isIROrContainerNode(obj, binKey)
|
||||
role, err := v.isIROrContainerNode(ctx, obj, binKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error {
|
|||
}
|
||||
|
||||
if v.verifyTokenIssuer {
|
||||
role, err := v.isIROrContainerNode(obj, binKey)
|
||||
role, err := v.isIROrContainerNode(ctx, obj, binKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (v *FormatValidator) isIROrContainerNode(obj *objectSDK.Object, signerKey []byte) (acl.Role, error) {
|
||||
func (v *FormatValidator) isIROrContainerNode(ctx context.Context, obj *objectSDK.Object, signerKey []byte) (acl.Role, error) {
|
||||
cnrID, containerIDSet := obj.ContainerID()
|
||||
if !containerIDSet {
|
||||
return acl.RoleOthers, errNilCID
|
||||
|
@ -204,7 +204,7 @@ func (v *FormatValidator) isIROrContainerNode(obj *objectSDK.Object, signerKey [
|
|||
return acl.RoleOthers, fmt.Errorf("failed to get container (id=%s): %w", cnrID.EncodeToString(), err)
|
||||
}
|
||||
|
||||
res, err := v.senderClassifier.IsInnerRingOrContainerNode(signerKey, cnrID, cnr.Value)
|
||||
res, err := v.senderClassifier.IsInnerRingOrContainerNode(ctx, signerKey, cnrID, cnr.Value)
|
||||
if err != nil {
|
||||
return acl.RoleOthers, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue