mirror of https://github.com/usbharu/Hideout.git
fix: pubkeyの場所を変更
This commit is contained in:
parent
6df3c1a670
commit
70c3e408f4
|
@ -146,7 +146,7 @@ val httpSignaturePlugin = createClientPlugin("HttpSign", ::HttpSignaturePluginCo
|
|||
|
||||
class KtorKeyMap(private val userAuthRepository: IUserAuthService) : KeyMap {
|
||||
override fun getPublicKey(keyId: String?): PublicKey = runBlocking {
|
||||
val username = (keyId ?: throw IllegalArgumentException("keyId is null")).substringBeforeLast("/pubkey")
|
||||
val username = (keyId ?: throw IllegalArgumentException("keyId is null")).substringBeforeLast("#pubkey")
|
||||
.substringAfterLast("/")
|
||||
val publicBytes = Base64.getDecoder().decode(
|
||||
userAuthRepository.findByUsername(
|
||||
|
@ -159,7 +159,7 @@ class KtorKeyMap(private val userAuthRepository: IUserAuthService) : KeyMap {
|
|||
}
|
||||
|
||||
override fun getPrivateKey(keyId: String?): PrivateKey = runBlocking {
|
||||
val username = (keyId ?: throw IllegalArgumentException("keyId is null")).substringBeforeLast("/pubkey")
|
||||
val username = (keyId ?: throw IllegalArgumentException("keyId is null")).substringBeforeLast("#pubkey")
|
||||
.substringAfterLast("/")
|
||||
val publicBytes = Base64.getDecoder().decode(
|
||||
userAuthRepository.findByUsername(
|
||||
|
|
|
@ -33,7 +33,7 @@ class ActivityPubUserService(
|
|||
publicKey = Key(
|
||||
type = emptyList(),
|
||||
name = "Public Key",
|
||||
id = "$userUrl/pubkey",
|
||||
id = "$userUrl#pubkey",
|
||||
owner = userUrl,
|
||||
publicKeyPem = userAuthEntity.publicKey
|
||||
)
|
||||
|
@ -45,7 +45,7 @@ class ActivityPubUserService(
|
|||
val person = webFingerService.fetchUserModel(actor) ?: throw IllegalArgumentException("actor is not found")
|
||||
val inboxUrl = person.inbox ?: throw IllegalArgumentException("inbox is not found")
|
||||
httpClient.postAp(
|
||||
inboxUrl, "${follow.`object`!!}/pubkey", Accept(
|
||||
inboxUrl, "${follow.`object`!!}#pubkey", Accept(
|
||||
name = "Follow",
|
||||
`object` = follow,
|
||||
actor = follow.`object`.orEmpty()
|
||||
|
|
Loading…
Reference in New Issue