Giter Site home page Giter Site logo

Comments (13)

Murderlon avatar Murderlon commented on June 22, 2024 1

Contributing or forking is the only workaround for now.

from uppy.

Murderlon avatar Murderlon commented on June 22, 2024

Hi, unfortunately this has nothing to do with Uppy. Apparently you've setup some kind of authentication on your tus server and this is not the place for help with tus servers. There is also not enough information to help you. Companion doesn't expect the tus server to have auth so I recommend removing it and seeing if it works.

I know for a fact that things will work with tus-node-server and tusd

from uppy.

SamuraiT avatar SamuraiT commented on June 22, 2024

Apparently you've setup some kind of authentication on your tus server and this is not the place for help with tus servers.

@Murderlon
thanks for replay. I'm utilizing a Supabase endpoint for data transmission and need to include an access token in the headers, similar to how one can configure S3 in Companion. Therefore, I believe this issue is related to Uppy itself, as Companion is also provided with Uppy.

from uppy.

Murderlon avatar Murderlon commented on June 22, 2024

As far as I know it's not possible to send extra headers to the upload destination from Companion, only to Companion. But I can see the value in that, with Supabase, but also for anyone who wants to send auth headers to their destination.

from uppy.

SamuraiT avatar SamuraiT commented on June 22, 2024

Thank you, I appreciate it !
Yes, it's worth addressing, as I believe many Supabase users might encounter a similar issue.

from uppy.

ikupenov avatar ikupenov commented on June 22, 2024

Just ran into this myself 😕. I utilize RLS in Supabase so I need to be able to pass the JWT token. Are there any workarounds for this?

from uppy.

SamuraiT avatar SamuraiT commented on June 22, 2024

@Murderlon
Firstly, thank you for addressing this issue! You have been assigned, along with other team members, to address the issue. When do you estimate the feature solution for this problem will be completed?

from uppy.

Murderlon avatar Murderlon commented on June 22, 2024

We're very light on hours from core contributors lately. Currently Google Photos support is being developed and a massive TS migration, in preparation for #4764.

However since this is a small feature, I can probably take a look in the next two weeks.

The quikfix would be to allow a Record<string, string> to be send. But the proper fix would be some async function to generate a token and also support to refresh the token on 401. Both cases would only work when you integrate Companion manually into Express, not in standalone.

Thoughts @mifi? Here is a client-side example from Supabase.

from uppy.

mifi avatar mifi commented on June 22, 2024

Looking at the code I dont understand why the supabase client side example wouldn’t work. As far as i can see, when a Tus upload happens in companion, the Uppy Tus plugin headers option does get passed in the request body (json) to companion. Companion will then take these headers and pass them to tus-js-client. So I’m not sure what is the exact problem here

from uppy.

SamuraiT avatar SamuraiT commented on June 22, 2024

However since this is a small feature, I can probably take a look in the next two weeks.

Awesome, thank you! I'll definitely give it a try once it's implemented

Companion will then take these headers and pass them to tus-js-client. So I’m not sure what is the exact problem here

I understand, but it seems it didn't work out for both @ikupenov and me

from uppy.

ikupenov avatar ikupenov commented on June 22, 2024

I was using standalone companion in Docker if that matters.

from uppy.

mifi avatar mifi commented on June 22, 2024

I just tested locally with yarn dev:with-companion:

uppyDashboard.use(Tus, { endpoint: 'http://127.0.0.1:8001', limit: 6, headers: { 'X-MyHeader': 'hello' } })

I then ran a fake Tus TCP server:

nc -v -l 8001

and I uploaded a single file from google drive, and I got this on my fake Tus TCP

POST / HTTP/1.1
Tus-Resumable: 1.0.0
X-MyHeader: hello
X-Request-ID: 3d4f91c7-5829-4199-a521-80f0b6fb3e78
Upload-Defer-Length: 1
Upload-Metadata: filename ...
Host: 127.0.0.1:8001
Connection: close
Content-Length: 0

as you can see the header is included, so it seems to be working. Need some reproducible code or more detailed steps to reproduce if you think it's still an issue.

from uppy.

mifi avatar mifi commented on June 22, 2024

Closing this because it's seemingly already implemented

from uppy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.