aboutsummaryrefslogtreecommitdiff
path: root/registry/registry.go
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2023-01-06 00:18:32 +0000
committerJulio Capote <jcapote@gmail.com>2023-01-06 00:18:32 +0000
commitb10b9f6dc993e1757b702dd6def09df65cecfa44 (patch)
tree312a926817ca7eabf5c2276004c735634388a600 /registry/registry.go
parent786d49b884124e5cf83594558974999078b90242 (diff)
downloadcommunique-b10b9f6dc993e1757b702dd6def09df65cecfa44.tar.gz
log signature string
Diffstat (limited to 'registry/registry.go')
-rw-r--r--registry/registry.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/registry/registry.go b/registry/registry.go
index 01d92c7..f1ec426 100644
--- a/registry/registry.go
+++ b/registry/registry.go
@@ -272,6 +272,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol
request.Header.Add("Digest", "SHA-256="+digestHeader)
request.Header.Add("Content-Type", "application/activity+json")
+ signedString := fmt.Sprintf("(request-target): post %s\ncontent-type: %s\ndate: %s\ndigest: %s\nhost: %s", url.Path, request.Header.Get("Content-Type"), date, digestHeader, url.Host)
+
r.log.With(
"type",
"delivery",
@@ -279,6 +281,9 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol
"payload",
payload,
).With(
+ "signature string",
+ signedString,
+ ).With(
"date",
request.Header.Get("date"),
).With(
@@ -286,10 +291,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol
request.Header.Get("host"),
).Debugf("signing request")
- signed_string := fmt.Sprintf("(request-target): post %s\ncontent-type: %s\ndate: %s\ndigest: %s\nhost: %s", url.Path, request.Header.Get("Content-Type"), date, digestHeader, url.Host)
-
digest := sha256.New()
- digest.Write([]byte(signed_string))
+ digest.Write([]byte(signedString))
digestBytes := digest.Sum(nil)
r.mu.Lock()