-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Return GCS signed URL instead of direct URL #2143
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
base: main
Are you sure you want to change the base?
Conversation
The signed URL is supposed to be short lived. That's why we store the object key and sign URLs on the fly when we get a thread for instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a lot of unrelated changes here. Also GCS has existed for a year and private access is common so I wonder how anybody has this working before?
The Chainlit codebase and LLMs in general are an area of active development. A lot of work is still needed to make Chainlit robust in production, as demonstrated by the lack of comprehensive test coverage. Since there were only a couple of active maintainers on the repo, many features have been neglected due to prioritization and capacity. Now that we have additional maintainers, we can hopefully speed up the development cycle for the package that we collectively value. From what I can tell, the Chainlit data layer was released 6 months ago, and there haven’t been many major contributions since then. My intuition also tells me that GCS is less likely to be used than either AWS or Azure |
The Chainlit data layer stores files in Google Cloud Storage. However, an error occurs when a user attempts to access those files from a private GCS bucket.
The issue stems from the
sync_upload_file
method, which returns the direct public URLf"https://storage.googleapis.com/{self.bucket.name}/{object_key}"
. A direct URL will return a 403 Forbidden error for non-publicly accessible buckets.sync_upload_file
method to return a signed URL instead of a direct URL. Now, the application consistently uses authenticated signed URLs throughout, which will work with private buckets.GCS.py
, which didn't have any previously.