Skip to content

Topics, rules and tickets

This page is the working reference for the three things that decide whether a client hears a push: the topic it names, the rule that allows it, and the ticket that grants what a rule cannot. Every example below is a case from the conformance vectors that the Go and Java framework modules, the Go SDK and the platform gateway are tested against, so they are behaviour you can rely on.

For the model behind them see Push to clients; for the code that publishes and listens see Push from a use case and listen in the browser.

A topic is {application}:{segment}(:{segment})*.

  • The first segment is the application’s code: lower case letters, digits and -, starting with a letter. This is what keeps two applications’ topics apart.
  • Every other segment is [0-9A-Za-z_.-]+.
  • At least two segments, at most 255 characters.
Topic Accepted Why
shop:order:ord_0ABCDEFGH01 yes
shop:store:12:dock yes segments may be numbers
a:B.c_d-1 yes later segments allow upper case, ., _, -
shop no one segment
shop: and shop::x no an empty segment
Shop:order:1 no the application segment is lower case
sho_p:order no _ is not allowed in the application segment
shop:order 1, shop:order/1 no spaces and /
shop:{id} no a topic is concrete; placeholders belong to rules
255 characters yes
256 characters no too long

A type is [a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)*, at most 100 characters.

Type Accepted Code when refused
order.updated, job, job-2.assigned-to.worker yes
Order.updated, order..updated, order., order_updated, order.1x, empty no TYPE_INVALID
reset, auth-expired, subscribed, fw.anything no TYPE_RESERVED
fw, reset.done yes only the exact reserved names and the fw. prefix are taken

Data is a JSON object, stored as compact JSON, at most push.max-data-bytes (16 KiB by default, 64 KiB at most).

Data Result
{"orderId": "ord_1", "version": 7} accepted, stored as {"orderId":"ord_1","version":7}
{} accepted
[1,2], "text", null DATA_NOT_OBJECT
{"a": DATA_INVALID
an object of exactly the limit, 16384 compact bytes accepted
one byte over DATA_TOO_LARGE

A rule is a topic pattern, with optional required permissions. A pattern’s segments are literals or {placeholders}:

  • {principal} must equal the caller’s principal id.
  • {client} must equal the caller’s client.
  • Any other {name} matches exactly one segment. Names are [a-z][A-Za-z0-9]*.
  • The application segment must be a literal.
  • requires lists permissions the caller must all hold. Wildcards in the caller’s permissions, such as shop:*:view, count.

A rule is refused when it is declared if it names neither {principal} nor a required permission, so no topic is open to everyone by accident. A deliberately open topic is declared public instead, and a public rule cannot also require permissions.

Declaration Refused? Why
shop:order:{id} requires shop:order:view no
shop:user:{principal} no the placeholder ties it to one caller
shop:store:{id}:dock requires shop:dock:view and shop:store:view no both are needed
shop:announcements, public no open on purpose
shop:order:{id} with nothing required yes neither {principal} nor requires
shop:client:{client} with nothing required yes {client} alone opens every topic of the client to anyone in it
{app}:order:{id} yes the application segment is a literal
shop:order:{Id}, shop:order:{}, shop:order:x{id} yes bad placeholder
shop yes not a topic pattern
Rule Caller (client, principal, permissions) Topic Allowed Why
shop:order:{id} requires shop:order:view acme, prn_1, shop:order:view shop:order:ord_1 yes
same acme, prn_1, shop:*:view shop:order:ord_1 yes wildcard permission
same acme, prn_1, no permissions shop:order:ord_1 no permission missing
same acme, prn_1, shop:order:view shop:order:ord_1:lines no {id} is one segment
same acme, prn_1, shop:order:view shop:orders:ord_1 no a literal differs
same no credentials shop:order:ord_1 no a rule needs a caller
shop:user:{principal} acme, prn_0ABC shop:user:prn_0ABC yes own topic
same acme, prn_0ABC shop:user:prn_0XYZ no someone else’s
same acme, no principal shop:user:prn_0ABC no no principal to compare
shop:field-worker:{principal}:jobs acme, fwu_0W1 shop:field-worker:fwu_0W1:jobs yes a field worker’s own jobs
shop:client:{client}:news requires shop:news:view acme, prn_1, shop:news:view shop:client:acme:news yes
same acme, prn_1, shop:news:view shop:client:other:news no {client} is the caller’s own
shop:store:{id}:dock requires shop:dock:view and shop:store:view acme, prn_1, shop:dock:view shop:store:12:dock no one permission missing
same acme, prn_1, both shop:store:12:dock yes
shop:announcements, public no credentials shop:announcements yes public
same no credentials shop:announcements:x no the pattern is exact

Rules decide topic access only. Which pushes a stream receives is a second check made for every push: the stream must be subscribed to its topic and the push’s client must be the stream’s client, or the push must have been written for the platform as a whole (no client), or the stream must have been opened in the platform client’s context.

Use a ticket when the answer depends on data a rule cannot see (“this user may see order 7 but not order 8”). Your own endpoint does its access check, mints a ticket and returns it to the client, which sends it in the subscribe request.

A ticket is a compact JWS signed with Ed25519 (alg EdDSA), with a kid header naming the key.

Claim Meaning
iss your application’s code; every topic must begin with it
aud fw-push
client the stream’s client (_platform for platform-wide)
topics patterns; a placeholder matches any one segment; at most 100
sub optional principal, recorded in the stream token for logs
cnf optional {"jkt": "<thumbprint>"}: the subscribe must carry a DPoP proof for that key
iat, exp exp at most 5 minutes after iat: the time to subscribe, not the life of the stream
stream-exp optional: the latest the stream may live

The framework mints tickets valid for two minutes; the SDK minters default to 60 seconds and accept 1 to 300.

A topic in a ticket may contain placeholders, so one ticket for shop:order:{id} covers every order of the stream’s client. Mint a concrete id when the access check is per record, as in the “order 7 but not order 8” case.

Each row is a subscribe from tickets.json, against a host for the application shop that holds a current and a previous key. “Caller” is the request’s own credential.

Case Caller Result
Valid ticket, no credentials none granted shop:order:1; the stream’s client and principal are the ticket’s
Signed with the previous key none granted (during a rotation, old tickets still verify)
Unknown kid acme, prn_2 topic denied TICKET_INVALID, then 403 NO_TOPICS
Unknown kid, no credentials none 401: no valid ticket names a client
Right kid, signed by another key acme, prn_2 TICKET_INVALID (signature)
Expired acme, prn_2 TICKET_INVALID
exp more than 5 minutes after iat acme, prn_2 TICKET_INVALID
Wrong aud acme, prn_2 TICKET_INVALID
alg other than EdDSA acme, prn_2 TICKET_INVALID
Another application’s ticket (iss) acme, prn_2 TICKET_INVALID: this host knows only its own keys
A topic outside iss acme, prn_2 the whole ticket grants nothing
The ticket’s client is not the stream’s client acme, prn_2 TICKET_INVALID
cnf set, request proved the same key acme, prn_2, jkt-A granted
cnf set, request proved another key acme, prn_2, jkt-B TICKET_INVALID
cnf set, request proved no key none 401
stream-exp earlier than the default acme, prn_2 granted; the stream token expires at stream-exp
Platform-wide (client _platform) none granted; the stream is platform-wide
Two tickets, the first invalid none the invalid one is denied; the valid one is granted and names the client
A malformed ticket, or claims that are not JSON acme, prn_2 400 VALIDATION

On a host with several applications (the gateway), tickets of different issuers in one subscribe are each checked against their own issuer’s keys, and each grants only its own application’s topics.

POST {base}/push/subscriptions answers 200 with:

{
"streamToken": "<opaque>",
"expiresAt": "2026-11-08T13:00:00Z",
"granted": ["shop:order:ord_1"],
"denied": [{ "topic": "shop:user:prn_0ABC", "code": "TOPIC_FORBIDDEN" }]
}

A denied topic is reported and never fails the others.

Answer Meaning
200 at least one topic granted
400 VALIDATION malformed body, an invalid topic, more than push.max-topics (100) topics, or a malformed ticket
401 credentials were given and failed, or the tickets alone name no client
403 NO_TOPICS nothing was granted
403 CLIENT_FORBIDDEN the body named a client the credential cannot use
429 PUSH_LIMIT a stream limit; on the gateway the body says whether the scope is the host or one application
503 the instance is draining

The denial codes are TOPIC_FORBIDDEN (no rule or ticket grants it) and TICKET_INVALID.

The stream token expires at the earliest of the credential’s expiry, every ticket’s stream-exp and push.stream.max-lifetime (1 hour by default). It is signed by the host and is only a capability to listen. At its expiry the stream sends auth-expired and ends; the client subscribes again and resumes from its last event id.

Keys are published as a JWKS, current key first, up to four. To rotate without refusing live tickets:

  1. Add the new key and keep the old one as a previous key.
  2. Sync (or restart the app-hosted module). Both keys now verify.
  3. Start signing with the new key.
  4. Wait one ticket lifetime (at most 5 minutes).
  5. Drop the old key and sync again.

A page where you type a topic, a rule and a caller and see the result is planned. Until then the tables above are the same cases. conformance/push/ in the framework repository holds the full JSON files, including a fixed test key pair that is published on purpose and must never be configured anywhere real.