satellite/metainfo: fix inconsistency with auth check error
This fixes an inconsistency with error returned on copy and move endpoints to match other endpoints. validateAuth() is already wrapping the RPC status around the error, so this shouldn't be doing it again. This also ensures that rate limit errors for FinishCopyObject and FinishMoveObject are correctly returned as rpcstatus.ResourceExhausted so uplink can correctly map these to uplink.ErrTooManyRequests. Change-Id: I6bf6185b456d6774b99d56cf3d7d8f8aa2afa0e8
This commit is contained in:
parent
b3d12a2436
commit
31d42bb136
@ -2000,7 +2000,7 @@ func (endpoint *Endpoint) FinishMoveObject(ctx context.Context, req *pb.ObjectFi
|
||||
EncryptedPath: req.NewEncryptedObjectKey,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, rpcstatus.Error(rpcstatus.Unauthenticated, err.Error())
|
||||
return nil, err
|
||||
}
|
||||
endpoint.usageTracking(keyInfo, req.Header, fmt.Sprintf("%T", req))
|
||||
|
||||
@ -2191,7 +2191,7 @@ func (endpoint *Endpoint) FinishCopyObject(ctx context.Context, req *pb.ObjectFi
|
||||
EncryptedPath: req.NewEncryptedMetadataKey,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, rpcstatus.Error(rpcstatus.Unauthenticated, err.Error())
|
||||
return nil, err
|
||||
}
|
||||
endpoint.usageTracking(keyInfo, req.Header, fmt.Sprintf("%T", req))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user