fix(backend): Handle array values for Actor.publicKey
#14181
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
リモートのActivityPubの
Actor
のpublicKey
の値として配列が設定されているケースに対応します。配列が設定されている場合はその先頭の値をアクターの公開鍵として採用します。Why
ActivityPub and HTTP Signatures community group reportに
publicKey
が複数の値を持つ場合の処理についての記述があり、ActivityPub標準としてはpublicKey
は複数の値を取りうるという立場であることが読み取れます(関連:swicg/activitypub-http-signature#9)。https://swicg.github.io/activitypub-http-signature/#how-to-obtain-a-signature-s-public-key:
引用元の仕様では複数の値から目的の鍵の
id
に合致するものを選ぶように定められていますが、本パッチではとりあえずエラーを抑止するのを主目的とし、簡単のためMastodonの挙動に合わせて先頭の値を取る形で対応しています。Additional info (optional)
Checklist