Skip to content

Commit ff1a875

Browse files
sij411claude
andcommitted
Use instanceActor predicate to keep actor endpoint public
Instead of removing .authorize() from the actor dispatcher entirely, use a dedicated instanceActor predicate that: - Returns true for identifier "i" (instance actor is always public) - Delegates to authorize() for other identifiers This approach keeps .authorize() on the actor dispatcher while ensuring the instance actor remains publicly accessible for key fetching per the ActivityPub HTTP Signature spec. Reference: https://swicg.github.io/activitypub-http-signature/#instance-actor 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7540c79 commit ff1a875

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

packages/cli/src/inbox.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ export async function runInbox(
153153
return await ctx.getSignedKey() != null;
154154
};
155155

156+
// Instance actor must be public for key fetching per spec
157+
// https://swicg.github.io/activitypub-http-signature/#instance-actor
158+
const instanceActor = async (
159+
ctx: RequestContext<ContextData>,
160+
identifier: string,
161+
) => {
162+
if (identifier === "i") return true;
163+
return await authorize(ctx);
164+
};
165+
156166
const federation = createFederation<ContextData>({
157167
kv: new MemoryKvStore(),
158168
documentLoaderFactory: () => federationDocumentLoader,
@@ -199,7 +209,8 @@ export async function runInbox(
199209
];
200210
}
201211
return actorKeyPairs;
202-
});
212+
})
213+
.authorize(instanceActor);
203214

204215
// Set up inbox listeners
205216
federation

0 commit comments

Comments
 (0)