Skip to content

Commit f4e3f9c

Browse files
committed
Remove redundant example code
1 parent 10e4b1c commit f4e3f9c

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

signaturesex_test.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,3 @@ Signature: sig77=:3e9KqLP62NHfHY5OMG4036+U6tvBowZF35ALzTjpsf0=:
4545
fmt.Printf("verified: %t", err == nil)
4646
// Output: verified: true
4747
}
48-
49-
// Same as ExampleVerifyRequest but using Message
50-
func ExampleMessageVerifyRequest() {
51-
config := httpsign.NewVerifyConfig().SetKeyID("my-shared-secret").SetVerifyCreated(false) // for testing only
52-
verifier, _ := httpsign.NewHMACSHA256Verifier(bytes.Repeat([]byte{0x77}, 64), config,
53-
httpsign.Headers("@authority", "Date", "@method"))
54-
reqStr := `GET /foo HTTP/1.1
55-
Host: example.org
56-
Date: Tue, 20 Apr 2021 02:07:55 GMT
57-
Cache-Control: max-age=60
58-
Signature-Input: sig77=("@authority" "date" "@method");alg="hmac-sha256";keyid="my-shared-secret"
59-
Signature: sig77=:3e9KqLP62NHfHY5OMG4036+U6tvBowZF35ALzTjpsf0=:
60-
61-
`
62-
req, _ := http.ReadRequest(bufio.NewReader(strings.NewReader(reqStr)))
63-
msg, _ := httpsign.NewMessage(httpsign.NewMessageConfig().WithRequest(req))
64-
_, err := msg.Verify("sig77", *verifier)
65-
fmt.Printf("verified: %t", err == nil)
66-
// Output: verified: true
67-
}

0 commit comments

Comments
 (0)