CoSecProblemRenderer

Writes the body of CoSec's refusals as Wow's problems (wow.cosec.problems: wow, #6591), so a service that decides its requests itself answers them in one catalog. It writes the body alone: the status and every header stay CoSec's (Content-Type, CoSec-Request-Id, Retry-After, the RateLimit-* headers).

  • The type is Wow's (codeOf): 401 wow.auth.unauthenticated, 403 wow.auth.forbidden, 400 wow.request.malformed, 429 wow.request.rate-limited, 503 wow.auth.unavailable, and 500 about:blank, as Wow answers an unexpected failure of its own.

  • CoSec's own type and code stay in the member cosec, and its requestId and traceId under their names, so a client that reads CoSec's problems reads cosec.code (CoSec's TypeScript client reads the top-level code, and does not see these refusals: whoever uses it on the service keeps CoSec's bodies).

  • A type of CoSec's Wow does not know, one a later CoSec adds, is written as CoSec writes it (ProblemRenderer.DEFAULT).

It runs on the thread that writes the response, an event loop, and only serializes; one that throws is replaced by CoSec's own body, and the request stays refused.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Functions

Link copied to clipboard
open override fun render(problem: Problem): ByteArray