canonicalString assembles the byte string fed to HMAC. Field order must match between Sign and Verify and is part of the wire contract; changing it is a breaking signature change.
(verified, sender, entityType, domainCheck, delegation, ts, messageID, bodyHash string)
| 157 | // must match between Sign and Verify and is part of the wire contract; |
| 158 | // changing it is a breaking signature change. |
| 159 | func canonicalString(verified, sender, entityType, domainCheck, delegation, ts, messageID, bodyHash string) string { |
| 160 | return strings.Join([]string{ |
| 161 | verified, |
| 162 | sender, |
| 163 | entityType, |
| 164 | domainCheck, |
| 165 | delegation, |
| 166 | ts, |
| 167 | messageID, |
| 168 | bodyHash, |
| 169 | }, "\n") |
| 170 | } |
| 171 | |
| 172 | func (s *Signer) Verify(h AuthHeaders) bool { |
| 173 | return Verify([]string{string(s.secret)}, h) |
no outgoing calls
no test coverage detected