Skip to content

Publish on the identity-scoped dispatch subject (input.kernel.pgCK.id.<sub>.action.>) so verified dispatch seals real identity #11

Description

@styk-tv

Follow-up to #9 (closed) — the identity-scoped dispatch subject contract has landed, so the client's publish subject is now identity-bearing.

Context

pgCK v0.4.24 closed the server-derived dispatch identity work (styk-tv/pgCK#10). The NATS auth-callout admits a connection and the broker enforces an identity-scoped subject segment: a verified connection may publish only on its own

input.kernel.pgCK.id.<sub>.action.>

The legacy input.kernel.pgCK.action.<verb> still routes, but as an anonymous dispatch (back-compat). The acting identity is read from the broker-enforced subject segment — never a payload field or header — and set as ckp.requester before dispatch, so the seal records the real created_by and delivered events carry by: urn:ckp:participant:<sub>.

Requirement (WHAT, not how)

When the client is connected under a verified identity, dispatch actions must be published on the identity-scoped subject:

input.kernel.pgCK.id.<sub>.action.<verb>

so that the dispatch seals with the real created_by and the delivered event's by carries the true subject. Publishing on the legacy subject yields anonymous attribution (subscribe-only clients and unverified connections are unaffected).

Never-assert is preserved

The client still never asserts identity in the payload. <sub> is the broker-enforced identity of the verified connection surfaced to the client (from its own connect context), used solely to form the subject the broker already permits — not a client claim. A forged <sub> on the wire is denied by the broker and never seals.

Links

Scope: WHAT-only — the client-side "how" is this repo's.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Priority 0 — do nowenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions