tusd icon indicating copy to clipboard operation
tusd copied to clipboard

Retains HTTP Context values

Open bastien-seqone opened this issue 5 years ago • 1 comments

As discussed in #443, revival of the pull request #342 , to which I have added a unit test as requested in the comments.

The unit test ensure that value in request context is accessible in datastore. The original PR is a Copypasta of @Acconut solution to #315 by @innovate-invent

I rebase previous PR onto master.

It could solve issues #443, and related to #361 and #309.

bastien-seqone avatar Jan 19 '21 14:01 bastien-seqone

Any plans this PR to be accepted?

iamralch avatar Jan 26 '21 22:01 iamralch

Ive just ran into this issue as well. Im delegating to tusd Handler from the iris framework which has to do auth via a jwt middleware, and need to ensure the tus store is aware of the auth state data via context to save to the database properly.

Given the current situation, will likely have to fork.

pcfreak30 avatar Jun 29 '23 08:06 pcfreak30

I somehow forgot this PR, but I will revisit it soon. Thanks for reminding me.

Acconut avatar Jul 03 '23 15:07 Acconut

ping

This seems to be the "go" way to do things. Is there a reason to not use the request context when doing things?

NickNeedsAName avatar Aug 10 '23 22:08 NickNeedsAName

Is there a reason to not use the request context when doing things?

The request context is cancelled if the request is aborted. But we want to continue performing tasks after the request is aborted, such as saving the last received bytes to S3. This cannot be done if we use the request context.

Acconut avatar Aug 11 '23 06:08 Acconut

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.

Acconut avatar Aug 23 '23 11:08 Acconut