mirror of https://github.com/usbharu/Hideout.git
fix: Signatureヘッダーを追加
This commit is contained in:
parent
0d21be805b
commit
3c241312f1
|
@ -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
|
var tmp = builder
|
||||||
headers.forEach {
|
headers.forEach {
|
||||||
tmp = tmp.addHeaderToSign(it)
|
tmp = tmp.addHeaderToSign(it)
|
||||||
|
|
|
@ -50,6 +50,7 @@ class ActivityPubUserService(
|
||||||
val inboxUrl = person.inbox ?: throw IllegalArgumentException("inbox is not found")
|
val inboxUrl = person.inbox ?: throw IllegalArgumentException("inbox is not found")
|
||||||
httpClient.post(inboxUrl) {
|
httpClient.post(inboxUrl) {
|
||||||
contentType(ContentType.Application.Activity)
|
contentType(ContentType.Application.Activity)
|
||||||
|
header("Signature","keyId=\"${person.preferredUsername}\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date\"")
|
||||||
setBody(Accept(
|
setBody(Accept(
|
||||||
name = "Follow",
|
name = "Follow",
|
||||||
`object` = follow,
|
`object` = follow,
|
||||||
|
|
Loading…
Reference in New Issue