MCPcopy
hub / github.com/cshum/imagor / TestSignerAlgorithm

Function TestSignerAlgorithm

config/config_test.go:122–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestSignerAlgorithm(t *testing.T) {
123 srv := CreateServer([]string{
124 "-imagor-signer-type", "sha256",
125 })
126 app := srv.App.(*imagor.Imagor)
127 assert.Equal(t, "WN6mgyl8pD4KTy5IDSBs0GcFPaV7-R970JLsd01pqAU=", app.Signer.Sign("bar"))
128
129 srv = CreateServer([]string{
130 "-imagor-signer-type", "sha512",
131 "-imagor-signer-truncate", "32",
132 })
133 app = srv.App.(*imagor.Imagor)
134 assert.Equal(t, "Kmml5ejnmsn7M7TszYkeM2j5G3bpI7mp", app.Signer.Sign("bar"))
135}
136
137func TestCacheHeaderNoCache(t *testing.T) {
138 srv := CreateServer([]string{"-imagor-cache-header-no-cache"})

Callers

nothing calls this directly

Calls 2

CreateServerFunction · 0.85
SignMethod · 0.65

Tested by

no test coverage detected