Closed wizardlevel9 closed 4 years ago
currently you can use basic auth curl --user
with --cred=/path/to/cred/file
that is only the supported way - but of course it should be very possible to use any form of auth as long as it is possible to do with curl
command
pls check #10 as well
i think we could allow passing -- extra curl args
for this. eg:
tusc -H 0:1080 -f ww.mp4 -b /store/ -- -H 'Authorization: Bearer <token>'
and by design extra args is not limited to auth but anything that curl is okay with.
if you are comfortable with bash, i would appreciate a PR
for auth, you can just do
tusc.sh --cred=path/to/cred/file ...
where ... is other args as in tusc example (check readme)
the cred file should have following content:
USER="<username>"
PASS="<password>"
I will try that and let you know how I go.
Do you have any guidance on how I could set up a tusd hook for authentication to use your code?
what do you mean tusd hook?
this is tusc aka client it doesnt know anything about hook in tusd aka server
what do you mean tusd hook?
this is tusc aka client it doesnt know anything about hook in tusd aka server
Yes, the missing peice is how to configure the tusd server (with auth) to work with the client. I've raised this as a documentation issue with the tusd server team.
If you can help us understand this and provide examples it would allow us to benefit from your code and also understand the tusd server, because they haven't provided any tusd server auth hook examples.
You would be helping everyone.
Thanks again and apologies for being a pain.
ohh that would be too broader topic beyond the scope here. and there is not one hard fast rule or approach. it is up to the backend implementation for auth - maybe fixed token, SSO, basic auth, jwt or something specific to the system.
btw to ease your usage i have implemented #13 so in case the server requires auth that can be fulfilled by curl, then for sure you can use tusc.sh
in that case :)
also, are you managing a tusd server?
Yes, I'm managing the the tusd server, so I would like help in understanding how your code interacts with the tusd server.
I've asked the tusd server team to provide examples of auth hooks, because that will ensure that your code works with the tusd server code.
Any information would be greatly appreciated.
i think there is nothing like tusd auth hook.
I'm looking for an example of how to do https://github.com/tus/tusd/blob/master/docs/hooks.md with "pre-create" for authentication, but I can't find any examples.
nonetheless they have hooks https://github.com/tus/tusd/blob/master/docs/hooks.md
so you can intercept pre-create
and roll out your auth logic - it is up to you, your app, and requirement.
tusd wouldnt know how you will do auth. and tusc.sh (this repo) is far from that - really. that's all i can say.
Firstly, great job. This is awesome!
Can you please provide an example of how to use authentication (username and password) on the tusd server ( I believe this is now done using hooks) and how this would integrate with your code.
I was so happy to see that you added auth into your code.
Can you please provide some guidance as to how I can use your code with the auth and what I need to do to make it use the hooks with the tusd backend.
Thanks in advance.