Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: tus-endpoint now only needs upload-token and moved to Metadata #14

Merged
merged 1 commit into from Apr 18, 2020

Conversation

TrueBrain
Copy link
Member

When using web-frontends around this API, two problems had to be
solved when uploading to tus:

  1. tus needed the api-token, but the web-frontend normally doesn't
    show this (as it is between the web-frontend server and the API;
    the client has nothing to do with this). So switching to upload-token
    only solves this problem. This is also security-wise safe, as the
    upload-token is a secret generated on-demand. And it only lives for
    roughly 15 minutes.

  2. CORS is implemented, correctly, rather strict in tusd. This means
    that we cannot use additional headers outside the ones in the CORS
    header. This means that the upload-token has to move from headers
    to Metadata. This also means that we have to trust the information
    on disk about the upload. This too is security-wise safe, as this
    file-uuid is a secret generated on-demand.

This commit combines these two findings and solves them both.

When using web-frontends around this API, two problems had to be
solved when uploading to tus:

1) tus needed the api-token, but the web-frontend normally doesn't
show this (as it is between the web-frontend server and the API;
the client has nothing to do with this). So switching to upload-token
only solves this problem. This is also security-wise safe, as the
upload-token is a secret generated on-demand. And it only lives for
roughly 15 minutes.

2) CORS is implemented, correctly, rather strict in tusd. This means
that we cannot use additional headers outside the ones in the CORS
header. This means that the upload-token has to move from headers
to Metadata. This also means that we have to trust the information
on disk about the upload. This too is security-wise safe, as this
file-uuid is a secret generated on-demand.

This commit combines these two findings and solves them both.
@TrueBrain TrueBrain merged commit 1bccf28 into OpenTTD:master Apr 18, 2020
@TrueBrain TrueBrain deleted the change_tus branch April 18, 2020 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants