imgix-flavoured client-side URL signing.
Wire-format-compatible with Image.Plug.Provider.Imgix.Signing
on the server side and with imgix's hosted signed URLs.
Sign-only — verification happens at the back-end.
HMAC-SHA256 over secret <> path-and-query. Signature appended
as ?s=<hex> (or &s=<hex> if a query is already present).
Summary
Functions
Signs path_with_query with the first key in keys.
Functions
Signs path_with_query with the first key in keys.
Arguments
path_with_queryis the imgix request path, optionally with an existing query string.keysis a non-empty list of imgix secret tokens.
Options
:expires_at—DateTimeor unix-seconds. Adds anexpires=<unix>parameter; the back-end's verifier rejects the URL after that time.
Returns
- The path with
?s=<hex>(and optional?expires=…) appended.
Examples
iex> Image.Components.Signing.Imgix.sign("/cat.jpg?w=200", ["secret"])
...> =~ "?w=200&s="
true