MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / canonicalString

Function canonicalString

internal/headers/signer.go:159–170  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

157// must match between Sign and Verify and is part of the wire contract;
158// changing it is a breaking signature change.
159func 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
172func (s *Signer) Verify(h AuthHeaders) bool {
173 return Verify([]string{string(s.secret)}, h)

Callers 2

SignFunction · 0.85
VerifyWithMaxAgeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected