Fix public audience interop - #999
Conversation
Normalize compact relay Follow payloads before deciding whether to add an RSA Linked Data signature. This keeps Ed25519 proofs consistent with the JSON-LD sent on the wire. Add regressions for middleware delivery and Object Integrity Proof verification. fedify-dev#998 Assisted-by: Codex:gpt-5.6-sol
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
|
doc ci failure seems unrelated to this pr...? |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d294c7be2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| contextLoader, | ||
| context, | ||
| }); | ||
| compactMsg = normalizePublicFollowObject(compactMsg); |
There was a problem hiding this comment.
Keep the serialized object aligned with its proof
When callers use the public signObject() API directly for a Follow targeting PUBLIC_COLLECTION, this hashes the normalized full URI but returns an object that still serializes object as as:Public; consequently, sending that serialization or passing it directly to verifyObject() fails proof verification. The added test masks the mismatch by explicitly calling normalizePublicFollowObject() after serializing, so the signed object itself is not independently usable as promised.
AGENTS.md reference: AGENTS.md:L189-L189
Useful? React with 👍 / 👎.
| format: "compact", | ||
| contextLoader, | ||
| }); | ||
| jsonLd = normalizePublicFollowObject(jsonLd); |
There was a problem hiding this comment.
Preserve pre-existing proofs during normalization
When the supplied public Follow already has an Object Integrity Proof created over the compact as:Public representation—for example, a persisted activity signed by an earlier Fedify release—the preceding proof check skips re-signing, but this line changes the signed payload before delivery. Receivers then hash the full-URI representation and reject the existing proof, so normalization must not mutate bytes covered by a retained proof without replacing that proof.
AGENTS.md reference: AGENTS.md:L189-L189
Useful? React with 👍 / 👎.
Closes #998
It adds
normalizePublicFollowObject()helper to rewrite the compactas:PublicorPublicin theFollow.objectto the full ActivityStreams Public collection URI. Some ActivityPub implementations, especially relays in this issue, compare the field as a plain URL without applying JSON-LD expansion. That causes them to reject public-addressedFollowactivities that use a compact IRI.This fix follows the structure introduced in #710, but does not copy the entire
public-audience.tsfile because the2.0-maintenancebranch predates the Threadiverse tutorial.