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

File downloads #508

Closed
joepio opened this issue Sep 27, 2022 · 1 comment
Closed

File downloads #508

joepio opened this issue Sep 27, 2022 · 1 comment

Comments

@joepio
Copy link
Member

joepio commented Sep 27, 2022

The /download endpoint is called whenever we want to retrieve a file. If you're rendering an image, the browser sends the request to that download destination with some default headers. These headers do not include the x-atomic-auth headers, of course. So what happens is: we can't download files that are protected by some form of authorization.

How should we fix this?

Signed cookies

Currently, every HTTP request is signed. That gives us stateless authentication, which is cool. But browsers work like they work, so we should probably use cookies for this.

  • The client signs one Authentication resource. Similar to this.
  • This resource has a signature, signed-at, expires-at, and some agent info (publickey, subject).
  • This cookie is included in all requests to the main server.
  • We need to make sure the cookie is never sent to other domains.

Some thoughts on signed cookies:

  • Cookie validation can be cached server side, so it only has to be validated once. After that, we only check expiration.
  • Let's make sure we use the same json-ad serialization as in the websocket system.

Add HTTP headers in a service worker proxy

@Polleps has some ideas on this.

@joepio
Copy link
Member Author

joepio commented Nov 8, 2022

#512

@joepio joepio closed this as completed Nov 8, 2022
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

No branches or pull requests

1 participant