fix: Signatureヘッダーを追加

This commit is contained in:
usbharu 2023-03-31 12:36:35 +09:00
parent 0d21be805b
commit 3c241312f1
2 changed files with 2 additions and 1 deletions

View File

@ -100,7 +100,7 @@ val httpSignaturePlugin = createClientPlugin("HttpSign",::HttpSignaturePluginCon
}
}
val builder = HttpMessageSigner.builder().algorithm(algorithmType).keyId(keyId).keyMap(keyMap)
val builder = HttpMessageSigner.builder().algorithm(algorithmType).keyId("${Config.configData.url}/users/$keyId/pubkey").keyMap(keyMap)
var tmp = builder
headers.forEach {
tmp = tmp.addHeaderToSign(it)

View File

@ -50,6 +50,7 @@ class ActivityPubUserService(
val inboxUrl = person.inbox ?: throw IllegalArgumentException("inbox is not found")
httpClient.post(inboxUrl) {
contentType(ContentType.Application.Activity)
header("Signature","keyId=\"${person.preferredUsername}\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date\"")
setBody(Accept(
name = "Follow",
`object` = follow,