winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.07k stars 198 forks source link

Making the bucket serve `publicUrl` and `signedUrl` using an express server on `sim` target #4143

Closed tsuf239 closed 2 months ago

tsuf239 commented 1 year ago

Feature Spec

Strongly related to: #4137 (better to complete that one first/ during the work on this issue) This task has two parts-

  1. Adding an express server to the bucket.inflight (the same way we do for the website and the api, the issue above suggest unifying it in some way)
  2. Implement the signedUrl method for the sim target: One way to do it will be:
    • In the signedUrl method, calculate the time it will be expired and hash it along in the key
    • Create an endpoint to serve the files- it should decode the URL to extract the key and expiry time, if the key was deleted already or the Date.now() is bigger than the expiry date- throw an error, otherwise serve the file (serving a deleted file should be added to the test) (any other ways are welcome!!)
  3. go to the publicUrl and signedUrl SDK spec tests and remove the condition skipping the sim target :)

Use Cases

signedUrl and publicUrl will work properly on the sim target.

Implementation Notes

No response

Component

SDK

Community Notes

github-actions[bot] commented 1 year ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] commented 10 months ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] commented 7 months ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] commented 4 months ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

Chriscbr commented 2 months ago

We recently added support for bucket signed URLs on the simulator, but when the bucket is public, the URL that the user used to upload the file can't also be used to view the file due to this limitation. Updating the existing express server we added so that it can also be used to view files (and updating the publicUrl method accordingly) should fix this.

monadabot commented 2 months ago

Congrats! :rocket: This was released in Wing 0.85.10.