i2goSignals

goSignals

8. Two revocation endpoints: RFC 7009 /revoke and DELETE /token/{jti}

Date: 2026-05-31

Status

Accepted

Context

Token revocation has two genuinely different callers, and they hold different things:

  1. A token holder — a transmitter, receiver, or tool that possesses the token string and wants to kill it. This is the RFC 7009 model: present the token in a form body and the server revokes it.
  2. An administrator working from a list — an operator looking at the management-plane token table (or its GoSignalsAdmin console equivalent). By design TokenRecord does not store the token string — only the JTI and metadata. The admin has a JTI to act on, never the token itself.

RFC 7009 cannot serve caller 2: the admin has no token string to present. And the pre-existing DELETE /token/{jti} is not RFC 7009 — it is a revoke-by-identifier operation. Collapsing to a single endpoint would force one caller into an unnatural shape (either admins reconstruct tokens they don’t have, or holders look up a JTI they may not know).

Decision

We keep both endpoints, each serving its natural caller.

Both share one authorization rule: a non-admin caller may revoke only tokens within their own project (AuthContext.ProjectId must match the target’s project); admin/root may revoke anything. This blocks a low-scope delivery-token holder in one project from revoking another project’s tokens.

Revocation sets revoked_at; the record is retained (introspection still reports active:false, and lineage survives) until the Mongo TTL reaps it after I2SIG_TOKEN_RETENTION.

Consequences

Positive

Negative