hooks: add pre-access blocking hook
- To replace
pre-resumePR (#1074) - Add
Access.ModeandAccess.FilestoHookEventforpre-accessandpre-create(when Upload-Concat) hook.-
Filesis an array because of Concatenation extension that access many files to make a new one -
Modeis read (Get/Head) or write (Patch/Delete)
-
- Add
pre-accessbefore each http request Get/Head/Patch/Delete.- This new hook is disabled by default
- Access can be rejected by setting
RejectAccessin HookResponse. Http response status code will be 403, if not override in HttpResponse. - Useful for authentication/authorization of upload access, based on http request headers for instance
close #1074
I made the changes you suggested, except the last one to set Hook.Upload to nil !
Thank you for the updates, I will look into this in two weeks and then we should be able to get this merged.
Hi everyone. Just wanted to ask, if this this is still being worked on?
There hasn't been any work on this since, but we are still interested in adding this to tusd.
@Acconut it seems the PR is ready to merge, any reason why is postponed please?
In general, this PR looks good but I need to give it another review and probably polish a few edges. I'm not sure when I'll get to that as time is tight, but I'll try my best. Apologies for the delay!