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

🔒 feat: Authenticated Image Requests #2389

Merged
merged 2 commits into from
Apr 11, 2024
Merged

🔒 feat: Authenticated Image Requests #2389

merged 2 commits into from
Apr 11, 2024

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Apr 11, 2024

Summary

Implemented authenticated image requests, ensuring secure access to image resources.

This is a bare minimum approach for validation. It is best to use Firebase (hopefully more providers in the future) and manage a CDN policy, but this at least prevents the local images from being "public."

It remains to be seen how this may affect remote environments, as the approach simply relies on browser cookies. A toggle in this case may be necessary.

Also, this may not give the impression that images are secure when they are cached by the browser. Clearing browser cache and trying to access an image outside the app will prove otherwise.

Closes #2385

Changes

  • Added authentication middleware to verify user credentials for image requests.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules

@danny-avila danny-avila merged commit 9277e2a into main Apr 11, 2024
2 checks passed
@danny-avila danny-avila deleted the images-auth branch April 11, 2024 06:50
jinzishuai pushed a commit to aitok-ai/LibreChat that referenced this pull request May 20, 2024
* 🔒 feat: Authenticated Image Requests

* fix: reserved keyword `static`
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
* 🔒 feat: Authenticated Image Requests

* fix: reserved keyword `static`
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.

Enhancement: Add download restrictions for uploaded image files
1 participant