mirror of https://github.com/usbharu/Hideout.git
fix: Signatureヘッダーを追加
This commit is contained in:
parent
c7919b3c1f
commit
72ce47b268
src/main/kotlin/dev/usbharu/hideout
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue