Support unsigned URLs
I use unsigned URLs to purge images and as base URLs for clients to append their own parameters.
This pull request generates an unsigned URL when source.token is nil.
Imgex.url(path, params, %{token: nil})
However, I’m not entirely happy with this solution but it‘s the best I can come up with to maintain backwards compatibility. The most idiomatic way would be to pass an option to a trailing opts.
Imgex.url(path, params, sign: false)
Alternate source domains and tokens should be passed as opts too, but this is a breaking change.
What do you think?
@ianwalter @axelson Follow up on this? :smile:
@jayjun I don't really like the implicit behavior of token == nil means don't sign the url. Thinking about it a bit we could actually support a keyword list as the third argument since the third argument is currently a map. That way we could deprecate the old behavior without breaking any clients.
Also we need to ensure that srcset/3 works in a similar matter as well.
I don't plan on tackling this but I will review the code if someone else wants to tackle it.