How To Extend Duration Of Amazon S3 Signed Link In Elixir Arc — Tentamen Software Testing Blog

Image for post
Image for post

TL;DR

This post explains how to change default Elixir Arc S3 Signed Link expiration time.

Elixir Arc

is a valuable Elixir library that enables developers to store files to Amazon S3 buckets from a Web application. In Arc Github readme page, there is documentation on how to URL:

# To generate a signed url:
Avatar.url({“selfie.png”, user}, :thumb, signed: true)

Signed URL is publically available, but hard to guess URL, something like this:

Link expiration parameter is X-Amz-Expires=300 where 300 is default Arc value in seconds. How to change that value? An important thing with Open Source Elixir is that readable code is publically available. We searched Arc Github repo for the word signed and we found this line:

Which gives us the following code for setting sign expiration time:

Avatar.url({“selfie.png”, user}, :thumb, [signed: true, expires_in: 36_000])

With this, we set the expiration time to ten hours.

Originally published at on August 31, 2020.

Written by

Founder of Tentamen, software testing agency.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store