diff --git a/pkg/services/object/acl/v2/service.go b/pkg/services/object/acl/v2/service.go index 3ebac22a5..add2830f4 100644 --- a/pkg/services/object/acl/v2/service.go +++ b/pkg/services/object/acl/v2/service.go @@ -108,21 +108,21 @@ func New(next object.ServiceServer, type wrappedGetObjectStream struct { object.GetObjectStream - requestInfo RequestInfo + requestContext *object.RequestContext } func (w *wrappedGetObjectStream) Context() context.Context { - return object.NewRequestContext(w.GetObjectStream.Context(), &object.RequestContext{ - Namespace: w.requestInfo.ContainerNamespace(), - SenderKey: w.requestInfo.SenderKey(), - Role: w.requestInfo.RequestRole(), - }) + return object.NewRequestContext(w.GetObjectStream.Context(), w.requestContext) } func newWrappedGetObjectStreamStream(getObjectStream object.GetObjectStream, reqInfo RequestInfo) object.GetObjectStream { return &wrappedGetObjectStream{ GetObjectStream: getObjectStream, - requestInfo: reqInfo, + requestContext: &object.RequestContext{ + Namespace: reqInfo.ContainerNamespace(), + SenderKey: reqInfo.SenderKey(), + Role: reqInfo.RequestRole(), + }, } } @@ -131,21 +131,21 @@ func newWrappedGetObjectStreamStream(getObjectStream object.GetObjectStream, req type wrappedRangeStream struct { object.GetObjectRangeStream - requestInfo RequestInfo + requestContext *object.RequestContext } func (w *wrappedRangeStream) Context() context.Context { - return object.NewRequestContext(w.GetObjectRangeStream.Context(), &object.RequestContext{ - Namespace: w.requestInfo.ContainerNamespace(), - SenderKey: w.requestInfo.SenderKey(), - Role: w.requestInfo.RequestRole(), - }) + return object.NewRequestContext(w.GetObjectRangeStream.Context(), w.requestContext) } func newWrappedRangeStream(rangeStream object.GetObjectRangeStream, reqInfo RequestInfo) object.GetObjectRangeStream { return &wrappedRangeStream{ GetObjectRangeStream: rangeStream, - requestInfo: reqInfo, + requestContext: &object.RequestContext{ + Namespace: reqInfo.ContainerNamespace(), + SenderKey: reqInfo.SenderKey(), + Role: reqInfo.RequestRole(), + }, } } @@ -154,21 +154,21 @@ func newWrappedRangeStream(rangeStream object.GetObjectRangeStream, reqInfo Requ type wrappedSearchStream struct { object.SearchStream - requestInfo RequestInfo + requestContext *object.RequestContext } func (w *wrappedSearchStream) Context() context.Context { - return object.NewRequestContext(w.SearchStream.Context(), &object.RequestContext{ - Namespace: w.requestInfo.ContainerNamespace(), - SenderKey: w.requestInfo.SenderKey(), - Role: w.requestInfo.RequestRole(), - }) + return object.NewRequestContext(w.SearchStream.Context(), w.requestContext) } func newWrappedSearchStream(searchStream object.SearchStream, reqInfo RequestInfo) object.SearchStream { return &wrappedSearchStream{ SearchStream: searchStream, - requestInfo: reqInfo, + requestContext: &object.RequestContext{ + Namespace: reqInfo.ContainerNamespace(), + SenderKey: reqInfo.SenderKey(), + Role: reqInfo.RequestRole(), + }, } }