-
Notifications
You must be signed in to change notification settings - Fork 25
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
Url with expires #15
Comments
You can see an example here : https://github.com/renchap/shrine-google_cloud_storage/blob/master/test/gcs_test.rb#L139 GCS requires you to specify an issuer and a signing key when generating a presign URL, and those are different than your Google Cloud API key. So supporting the @janko-m any advice here on which API would be best to keep it coherent with other Shrine storages ? |
So the current usage for an existing file is: uploaded_file = agreement.document
presigned_url = uploaded_file.storage().presign(uploaded_file.id(), options) It seems like we might want agreement.document.url(options) If you are good with that I can PR, unless you want to do it. |
In my case I run within GKE (google container engine), so based on the API doc it looks like I don't need to provide any credentials because of default discovery (I think).
@renchap Am I missing something here? That would also make the desire for |
I notice now that you are not using I'm going to work on a conversion to |
@renchap Shrine doesn't have any convention for expiring URLs, In GCS case that seems to be true, so it seems it might be a good idea for |
@janko-m the only thing I see missing at this point in 1.6 is batch delete. How important is it to retain batching here? It appears that batching will not be supported: googleapis/google-cloud-ruby#1008
|
@rosskevin Implementing the Though it would be nice to still be able to implement |
@rosskevin If you want to have a look at switching to I am fine with allowing presigned urls in The SA used to presign the URLs needs to be allowed to be specified as a parameter to the |
PR submitted, I think it is complete/mergeable. |
Ah @renchap, I just saw your note. You can definitely still sign with your own, I verified that. You can also override and specify your own |
Fixed by #16 |
I see in #7 that signed urls are implemented with
presign
.I'm thinking about access to an expiring url from an existing
activerecord
model with a file, and the implementation here seems like a different pattern than that of theS3#url
.I'm new to shrine, so please point out what I'm missing.
Assuming a model
Agreement
and a shrine fielddocument_data
, withS3
docs it looks as though you should be able toagreement.document.url(expires_in: 300)
.Shouldn't the expected usage here be
agreement.document.url(expires: 300)
based on the above pattern, theUploadedFile
api, and the GCSUsing signed urls
?expires
)?presign
from my model and I'm missing it?The text was updated successfully, but these errors were encountered: