From 00652fd9cb837c893de7fb9bfb979ad248d53271 Mon Sep 17 00:00:00 2001 From: John Bolliger Date: Mon, 13 Jan 2020 01:19:50 -0700 Subject: [PATCH] Added signed options example into the documentation. --- docs/url-signing.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/url-signing.md b/docs/url-signing.md index 259029b..14807a5 100644 --- a/docs/url-signing.md +++ b/docs/url-signing.md @@ -60,6 +60,24 @@ options are sorted, moving `q75` before `r90`. [ParseOptions]: https://godoc.org/willnorris.com/go/imageproxy#ParseOptions [size option]: https://godoc.org/willnorris.com/go/imageproxy#hdr-Size_and_Cropping + +## Signed options example + +Here is an example with signed options through each step. + +Using the github codercat, our image url is `https://octodex.github.com/images/codercat.jpg` and our options are `400x400` and `q40`. + +The signature key is `secretkey` + +The value that goes into the Digest is `https://octodex.github.com/images/codercat.jpg#400x400,q40` + +and our resulting signed key is `0sR2kjyfiF1RQRj4Jm2fFa3_6SDFqdAaDEmy1oD2U-4=` + +The final url would be +`http://localhost:8080/400x400,q40,s0sR2kjyfiF1RQRj4Jm2fFa3_6SDFqdAaDEmy1oD2U-4=/https://octodex.github.com/images/codercat.jpg` + + + ## Language Examples Here are examples of calculating signatures in a variety of languages. These