Open NZhuravlev opened 4 years ago
Not sure this is possible directly, maybe with playing around with custom signing method where you'd make temporary keys and sign them in client.
Also, why not make the key validity longer? Or per-upload?
Per-upload would be too much - we upload thousands of files. And there is no control over validity time.
The expiration time of the used temporary credentials is unfortunately not in our hands as we are running our application on EC2 instances (with an attached role) and use the functionality provided by AWS APIs to generate them.
Ideally, we would like to avoid signing on the client side to not expose the secret to it for security reasons.
Do you agree that setting the aws_key
after having received the signed URL is a good solution in this scenario? Do you think it would be hard to implement such a change?
I see.. I am not sure, PRs welcome :)
@jakubzitny is it possible to handle this situation if we use customAuthMethod
?
Yes, but that requires signing on client where you'd need a secret. We do it with temporary secrets that backend sends to client only for specific time, iam and location on s3.
Or you can do extra request to you signing backend custom url, but you could do that with signerUrl
.
@jakubzitny could you share some code with us how you do the signing on the client? How do you deal with the situation when the temporary credentials expire while there are still files in the upload queue?
I shared something here: https://github.com/TTLabs/EvaporateJS/issues/402#issuecomment-449481388
And we don't do that. We have separate credentials for each upload and if something fails or takes a long time we create a new credentials and start over.
In case
aws_key
is only valid for 1 hour, how should I handle the situation when the upload process has been started with [Evaporate#add](https://github.com/TTLabs/EvaporateJS/wiki/Evaporate.prototype.add()) using one accessKey, but URL was signed with a different key?In
signResponseHandler
I have both signed URL and an access key it was signed with. But according to the [Evaporate#add](https://github.com/TTLabs/EvaporateJS/wiki/Evaporate.prototype.add()) source code there is no way to updatefileUpload
configuration.