Passing also context.Context to PreUpload and PreFinish callbacks
Is your feature request related to a problem? Please describe.
We are using v2 as a library integrated into a go-chi application. Within that application every handler is mounted after an authentication handler, which authenticates the request and enriches the context with necessary information. We are using the PreFinishResponseCallback for processing the uploaded file when the last PATCH request is made. Within that logic we have to access information from that context to decide how to further process the file but only the HookEvent information are passed into the callback method.
Describe the solution you'd like
We would ask you if it would be possible to also pass the original context.Context into these callbacks.
Adding to that: having the hooks be called with the context.Context of the incoming request (or a child of it) makes sense, since the hooks might make outgoing calls themselves that should be cancelled if the incoming request is cancelled and/or that should have access to enriched information like the opentracing span.
Good idea, it makes sense to expose contexts to these callbacks. Feel free to open a PR to add this to the v2 branch.
Thanks you for your contribution! In tusd v2, the request context will be accessible in the hooks and stores. Please see #986 for more details and #672 for the development of v2.