Skip to main content

Function: replyPrefixes()

replyPrefixes(key, input?): readonly string[]

Defined in: packages/contracts/src/permissions/replies.ts:25

The inbox prefixes a server may answer a request key on: one per principal that calls the key over the broker, each _INBOX.<principal>. with its trailing dot.

A caller hosted by the same principal as the server is left out, because that call is carried in process and never arrives with a reply subject. A key nobody calls over the broker gives an empty list, so every reply to it is refused.

A command to an agent is answered the same way: one prefix per principal that hosts a listed sender. An agent hosts nobody, so every sender is over the broker.

Why it exists: allow_responses lets a server publish to whatever reply subject a request names, and the requester chooses that subject. Without this check a caller could name another principal's inbox, or any subject at all, and have credential (or an agent, which holds key material) deliver its answer there.

Parameters​

key​

string

A request or command registry key, such as request.*.identity.person.get.v1 or agent.shared.admin.did.create.v1.

input?​

HostingInput = ESTATE_HOSTING

Defaults to the real estate.

Returns​

readonly string[]

The prefixes, in table order, each ending in a dot.