mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-09 23:27:43 +02:00
cryptutil: use bytes for hmac (#2067)
This commit is contained in:
parent
a935c1ba30
commit
a51c7140ea
12 changed files with 28 additions and 28 deletions
|
@ -125,13 +125,13 @@ func TestValidateSignature(t *testing.T) {
|
|||
|
||||
tests := []struct {
|
||||
name string
|
||||
secretA string
|
||||
secretB string
|
||||
secretA []byte
|
||||
secretB []byte
|
||||
wantStatus int
|
||||
wantBody string
|
||||
}{
|
||||
{"good", "secret", "secret", http.StatusOK, http.StatusText(http.StatusOK)},
|
||||
{"secret mistmatch", "secret", "hunter42", http.StatusBadRequest, "{\"Status\":400,\"Error\":\"Bad Request: internal/urlutil: hmac failed\"}\n"},
|
||||
{"good", []byte("secret"), []byte("secret"), http.StatusOK, http.StatusText(http.StatusOK)},
|
||||
{"secret mistmatch", []byte("secret"), []byte("hunter42"), http.StatusBadRequest, "{\"Status\":400,\"Error\":\"Bad Request: internal/urlutil: hmac failed\"}\n"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue