summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/ActivityPubServerService.ts (follow)
Commit message (Collapse)AuthorAgeFilesLines
* split url into webUrl and localUrl (like mastodon)stableFreya Murphy16 hours1-7/+7
|
* don't allow boosts to be fetched as a note over APHazelnoot2025-06-181-1/+6
|
* filter boosts out of pinned notes when federatingHazelnoot2025-06-181-1/+1
|
* set X-Robots-Tag to disable indexing API endpointsHazelnoot2025-06-131-0/+4
|
* Merge branch 'develop' into merge/2025-03-24Hazelnoot2025-05-061-3/+26
|\
| * remove leftover debug linedakkar2025-04-301-1/+0
| |
| * check signatures with and without query - fix #1036dakkar2025-04-211-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @Oneric explained: > Spec says query params must be included in the signature; Mastodon > being Mastodon used to always exclude it though and for > compatibility everyone followed this. At some point GtS decided to > follow spec instead which caused interop issues, but succeeded in > getting Mastodon (and others like *oma) to accept incoming requests > with (and also still without) query params though outgoing requests > remaing query-param-free. Some still only accept query-param-less > requests though and GtS uses a retry mechanism to resend any request > failing with 401 with an query-parama-less signature once. (Also > see: > https://docs.gotosocial.org/en/latest/federation/http_signatures/ ) > > So for incoming requests both versions need to be checked. For > outgoing requests, unless you want to jump through retry hoops like > GtS, omitting query-params is the safer bet for now (presumably this > will only change if Mastodon ever decides to send out requests > signed with query params)
* | merge upstream againHazelnoot2025-04-241-10/+38
|\ \
| * | fix: use ftt for outbox (#15819)anatawa122025-04-151-10/+38
| | | | | | | | | | | | | | | | | | | | | * fix: use ftt for outbox * chore: check for enableFanoutTimeline * lint: fix lint
| * | fix: resolve with non-lowercased acct is broken (#15813)anatawa122025-04-131-1/+1
| | | | | | | | | | | | | | | * fix: resolve with non-lowercased acct is broken * docs(changelog): Fix: 大文字を含むユーザの URL で紹介された場合に 404 エラーを返す問題
* | | merge upstreamHazelnoot2025-03-251-1/+76
|\| | | |/ |/|
| * fix(backend): ↵syuilo2025-03-171-1/+79
| | | | | | | | 連合無しモードでも外部から照会可能だった問題を修正
| * deps: update pnpm to v10 (#15588)かっこかり2025-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Revert "fix(build): corepackのバグの回避 (#15387)" This reverts commit 9c70a4e63130f85d191c5bc16d0a4be5cd1dece2. * deps: update pnpm to v10 * fix broken lockfile * update changelog * fix * fix * Revert "fix" This reverts commit 4abc6c194edc20989f5ec97d343307a4b8c9047d. * fix * fix * attempt to fix docker build * lint fixes * fix: revertしすぎた * detect pnpm version and install it * fix: そもそもpnpmを2回入れる必要がないかも * fix * refactor * fix * refactor: remove unnecessary arg * Update Dockerfile * update pnpm to v10.6.1 * Update Changelog * chore: use node to avoid installing jq
* | implement replies collection for postsHazelnoot2025-03-191-0/+46
| |
* | convert Authorized Fetch to a setting and add support for hybrid mode ↵Hazelnoot2025-03-161-89/+131
| | | | | | | | (essential metadata only)
* | fix: use toLowerCase() to make sure usernameLower matches while compared to ↵Marie2025-03-061-1/+1
| | | | | | | | request with possibly capitalization
* | append default CW when rendering AP `Note` objectsHazelnoot2025-02-161-6/+11
| |
* | Merge branch 'develop' into merge/2024-02-03Hazelnoot2025-02-081-2/+2
|\ \ | | | | | | | | | | | | | | | # Conflicts: # packages/backend/src/server/ActivityPubServerService.ts # pnpm-lock.yaml
| * | move imports to fix git diff in ActivityPubServerService.tsHazelnoot2025-02-051-2/+2
| | |
| * | lookup and cache rate limit factors directly within SkRateLimiterServiceHazelnoot2025-02-051-2/+2
| | |
* | | fix import order in ActivityPubServerService.tsHazelnoot2025-02-041-2/+2
| | |
* | | merge upstream 2025-02-03Hazelnoot2025-02-031-2/+2
|\ \ \ | |/ / |/| / | |/
| * fix(backend): apOrHtml ↵かっこかり2025-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Constraintが正しく評価されない問題を修正 (#15213) * fix(backend/ActivityPubServerService): apOrHtml Constraintが正しく評価されない問題を修正 (MisskeyIO#869) * Update Changelog * indent --------- Co-authored-by: あわわわとーにゅ <17376330+u1-liquid@users.noreply.github.com>
* | fix lintsdakkar2024-11-221-1/+1
| |
* | Merge tag '2024.11.0' into feature/2024.10dakkar2024-11-221-5/+18
|\|
| * Merge commit from forkJulia2024-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * enhance: Add a few validation fixes from Sharkey See the original MR on the GitLab instance: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/484 Co-Authored-By: Dakkar <dakkar@thenautilus.net> * fix: primitive 2: acceptance of cross-origin alternate Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 3: validation of non-final url * fix: primitive 4: missing same-origin identifier validation of collection-wrapped activities * fix: primitives 5 & 8: reject activities with non string identifiers Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 6: reject anonymous objects that were fetched by their id * fix: primitives 9, 10 & 11: http signature validation doesn't enforce required headers or specify auth header name Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 14: improper validation of outbox, followers, following & shared inbox collections * fix: code style for primitive 14 * fix: primitive 15: improper same-origin validation for note uri and url Co-Authored-By: Laura Hausmann <laura@hausmann.dev> * fix: primitive 16: improper same-origin validation for user uri and url * fix: primitive 17: note same-origin identifier validation can be bypassed by wrapping the id in an array * fix: code style for primitive 17 * fix: check attribution against actor in notes While this isn't strictly required to fix the exploits at hand, this mirrors the fix in `ApQuestionService` for GHSA-5h8r-gq97-xv69, as a preemptive countermeasure. * fix: primitive 18: `ap/get` bypasses access checks One might argue that we could make this one actually preform access checks against the returned activity object, but I feel like that's a lot more work than just restricting it to administrators, since, to me at least, it seems more like a debugging tool than anything else. * fix: primitive 19 & 20: respect blocks and hide more Ideally, the user property should also be hidden (as leaving it in leaks information slightly), but given the schema of the note endpoint, I don't think that would be possible without introducing some kind of "ghost" user, who is attributed for posts by users who have you blocked. * fix: primitives 21, 22, and 23: reuse resolver This also increases the default `recursionLimit` for `Resolver`, as it theoretically will go higher that it previously would and could possibly fail on non-malicious collection activities. * fix: primitives 25-33: proper local instance checks * revert: fix: primitive 19 & 20 This reverts commit 465a9fe6591de90f78bd3d084e3c01e65dc3cf3c. --------- Co-authored-by: Dakkar <dakkar@thenautilus.net> Co-authored-by: Laura Hausmann <laura@hausmann.dev> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
| * enhance(backend) : ↵momoirodouhu2024-11-091-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | リモートユーザーの照会をオリジナルにリダイレクトするように (#12892) (#14897) * enhance(backend) : リモートユーザーの照会をオリジナルにリダイレクトするように (#12892) * オリジンリダイレクトのテストをtodoとして追加。 e2eテストにリモートユーザー考慮のテストがなさそうなので。 次のコマンドで動くことは確認済みです。 curl "http://localhost:3000/@foo@bar" -H "accept: application/activity+json" -L * Acctのパースを既存のパーサーでするように修正 * lint
| * revert 5f88d56d96syuilo2024-07-201-34/+53
| | | | | | | | バグがある(かつすぐに修正できそうにない) & まだレビュー途中で意図せずマージされたため
| * perf(federation): Ed25519署名に対応する (#13464)tamaina2024-07-181-53/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 1. ed25519キーペアを発行・Personとして公開鍵を送受信 * validate additionalPublicKeys * getAuthUserFromApIdはmainを選ぶ * :v: * fix * signatureAlgorithm * set publicKeyCache lifetime * refresh * httpMessageSignatureAcceptable * ED25519_SIGNED_ALGORITHM * ED25519_PUBLIC_KEY_SIGNATURE_ALGORITHM * remove sign additionalPublicKeys signature requirements * httpMessageSignaturesSupported * httpMessageSignaturesImplementationLevel * httpMessageSignaturesImplementationLevel: '01' * perf(federation): Use hint for getAuthUserFromApId (#13470) * Hint for getAuthUserFromApId * とどのつまりこれでいいのか? * use @misskey-dev/node-http-message-signatures * fix * signedPost, signedGet * ap-request.tsを復活させる * remove digest prerender * fix test? * fix test * add httpMessageSignaturesImplementationLevel to FederationInstance * ManyToOne * fetchPersonWithRenewal * exactKey * :v: * use const * use gen-key-pair fn. from '@misskey-dev/node-http-message-signatures' * update node-http-message-signatures * fix * @misskey-dev/node-http-message-signatures@0.0.0-alpha.11 * getAuthUserFromApIdでupdatePersonの頻度を増やす * cacheRaw.date * use requiredInputs https://github.com/misskey-dev/misskey/pull/13464#discussion_r1509964359 * update @misskey-dev/node-http-message-signatures * clean up * err msg * fix(backend): fetchInstanceMetadataのLockが永遠に解除されない問題を修正 Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> * fix httpMessageSignaturesImplementationLevel validation * fix test * fix * comment * comment * improve test * fix * use Promise.all in genRSAAndEd25519KeyPair * refreshAndprepareEd25519KeyPair * refreshAndfindKey * commetn * refactor public keys add * digestプリレンダを復活させる RFC実装時にどうするか考える * fix, async * fix * !== true * use save * Deliver update person when new key generated (not tested) https://github.com/misskey-dev/misskey/pull/13464#issuecomment-1977049061 * 循環参照で落ちるのを解消? * fix? * Revert "fix?" This reverts commit 0082f6f8e8c5d5febd14933ba9a1ac643f70ca92. * a * logger * log * change logger * 秘密鍵の変更は、フラグではなく鍵を引き回すようにする * addAllKnowingSharedInboxRecipe * nanka meccha kaeta * delivre * キャッシュ有効チェックはロック取得前に行う * @misskey-dev/node-http-message-signatures@0.0.3 * PrivateKeyPem * getLocalUserPrivateKey * fix test * if * fix ap-request * update node-http-message-signatures * fix type error * update package * fix type * update package * retry no key * @misskey-dev/node-http-message-signatures@0.0.8 * fix type error * log keyid * logger * db-resolver * JSON.stringify * HTTP Signatureがなかったり使えなかったりしそうな場合にLD Signatureを活用するように * inbox-delayed use actor if no signature * ユーザーとキーの同一性チェックはhostの一致にする * log signature parse err * save array * とりあえずtryで囲っておく * fetchPersonWithRenewalでエラーが起きたら古いデータを返す * use transactionalEntityManager * fix spdx * @misskey-dev/node-http-message-signatures@0.0.10 * add comment * fix * publicKeyに配列が入ってもいいようにする https://github.com/misskey-dev/misskey/pull/13950 * define additionalPublicKeys * fix * merge fix * refreshAndprepareEd25519KeyPair → refreshAndPrepareEd25519KeyPair * remove gen-key-pair.ts * defaultMaxListeners = 512 * Revert "defaultMaxListeners = 512" This reverts commit f2c412c18057a9300540794ccbe4dfbf6d259ed6. * genRSAAndEd25519KeyPairではキーを直列に生成する? * maxConcurrency: 8 * maxConcurrency: 16 * maxConcurrency: 8 * Revert "genRSAAndEd25519KeyPairではキーを直列に生成する?" This reverts commit d0aada55c1ed5aa98f18731ec82f3ac5eb5a6c16. * maxWorkers: '90%' * Revert "maxWorkers: '90%'" This reverts commit 9e0a93f110456320d6485a871f014f7cdab29b33. * e2e/timelines.tsで個々のテストに対するtimeoutを削除, maxConcurrency: 32 * better error handling of this.userPublickeysRepository.delete * better comment * set result to keypairEntityCache * deliverJobConcurrency: 16, deliverJobPerSec: 1024, inboxJobConcurrency: 4 * inboxJobPerSec: 64 * delete request.headers['host']; * fix * // node-fetch will generate this for us. if we keep 'Host', it won't change with redirects! * move delete host * modify comment * modify comment * fix correct → collect * refreshAndfindKey → refreshAndFindKey * modify comment * modify attachLdSignature * getApId, InboxProcessorService * TODO * [skip ci] add CHANGELOG --------- Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com> Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
* | fix: primitives 9, 10 & 11: http signature validation doesn't enforce ↵Laura Hausmann2024-11-201-2/+2
| | | | | | | | required headers or specify auth header name
* | normalize re-fetch logic between InboxProcessorService and ↵Hazelnoot2024-10-261-5/+1
| | | | | | | | ActivityPubServerService
* | fix "federation allowed" check in our codedakkar2024-10-121-1/+1
| |
* | remove MetaService from ActivityPubServerServicedakkar2024-10-091-3/+0
| |
* | replace `isBlockedHost` with `isFederationAllowedHost`dakkar2024-10-091-3/+3
| |
* | Merge remote-tracking branch 'misskey/develop' into future-2024-04-25dakkar2024-04-251-2/+2
|\|
| * fix(backend): incorrect logic for determining whether Quote or not (#13700)zyoshoka2024-04-141-2/+2
| | | | | | | | | | | | | | | | | | * fix(backend): incorrect logic for determining whether Quote or not * Update CHANGELOG.md --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
* | merge: upstreamMarie2024-02-191-1/+1
|\|
| * (re) update SPDX-FileCopyrightTexttamaina2024-02-131-1/+1
| | | | | | | | Fix #13290
| * Revert "update SPDX-FileCopyrightText"tamaina2024-02-131-1/+1
| | | | | | | | This reverts commit 9b5aeb76d8c9372d67058c512597152b6bf222f2.
| * update SPDX-FileCopyrightTextsyuilo2024-02-121-1/+1
| |
* | merge: upstream (1)Marie2024-01-211-0/+4
|\|
| * return a `Vary: Accept` header for all dual-format endpoints #365 (#13044)かっこかり2024-01-211-0/+4
| | | | | | | | | | | | | | | | | | | | `/users/:user`, `/@:user`, `/notes/:note` return different responses depending on the request's `Accept:` header. If we don't consistently return a `Vary: Accept` header, browsers and caching proxies will get confused, and return AP representations when HTML was requested, or vice versa. Co-authored-by: dakkar <dakkar@thenautilus.net> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* | authorised fetch: log more detailsdakkar2024-01-081-10/+12
| | | | | | | | | | this will help debugging problems in the implementation; thanks to @ShittyKopper for the suggestion
* | lintdakkar2023-12-311-32/+16
| |
* | auth-fetch: ask to never cache responsesdakkar2023-12-311-16/+39
| | | | | | | | | | | | | | I could have factored out all the lines that set cache headers, but that would have made future merges even more complicated ☹ thanks ShittyCopper for reporting the problem!
* | fix loggingdakkar2023-12-231-1/+1
| |
* | fix typodakkar2023-12-231-1/+1
| | | | | | | | thanks @Marie
* | authorized fetch: log when things go wrongdakkar2023-12-231-2/+21
| |
* | authorized fetch: let /@instance.actor throughdakkar2023-12-231-0/+1
| | | | | | | | | | | | | | this is probably never actually used, but it still looks like a good idea (also, FireFish does it) thanks @ShittyKoper for noticing!
* | authorized fetch #217dakkar2023-12-231-0/+129
|/ | | | | the implementation is copied from the other places we already check HTTP signatures, and cross-checked with Firefish's implementation