Skip to content

Fix public audience interop - #999

Draft
sij411 wants to merge 4 commits into
fedify-dev:2.0-maintenancefrom
sij411:fix/relay-follow
Draft

Fix public audience interop#999
sij411 wants to merge 4 commits into
fedify-dev:2.0-maintenancefrom
sij411:fix/relay-follow

Conversation

@sij411

@sij411 sij411 commented Aug 18, 2026

Copy link
Copy Markdown
Member

Closes #998

It adds normalizePublicFollowObject() helper to rewrite the compact as:Public or Public in the Follow.object to 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-addressed Follow activities that use a compact IRI.

This fix follows the structure introduced in #710, but does not copy the entire public-audience.ts file because the 2.0-maintenance branch predates the Threadiverse tutorial.

sij411 added 4 commits August 17, 2026 19:20
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
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f839369c-1153-429d-8783-f987819c5f02

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.28571% with 9 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/fedify/src/compat/public-audience.ts 68.96% 7 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
packages/fedify/src/compat/mod.ts 100.00% <100.00%> (ø)
packages/fedify/src/federation/middleware.ts 90.08% <100.00%> (+<0.01%) ⬆️
packages/fedify/src/sig/proof.ts 67.98% <100.00%> (+0.23%) ⬆️
packages/fedify/src/compat/public-audience.ts 68.96% <68.96%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sij411

sij411 commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

doc ci failure seems unrelated to this pr...?

@sij411

sij411 commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant