CoSecIdentity
The identity a CoSec gateway forwards in CoSec-Identity once it has verified a person's token and permitted the request: what a local client or an end-to-end test sends a service behind one (wow.cosec.mode: gateway), which believes the header as it comes. subject of tenant with roles in the scope app and space (empty for none and the default space), its token valid for ttl from the moment the header is written. The credential is a person's (auth.kind person, CoSec 8.0.0-beta.9's IDN-44), as a user's sign-in is: a header without the member is read as a workload's.
val headers = CoSecIdentity("alice", listOf("buyer")).headers() // {"CoSec-Identity": "eyJ2Ijox…"}Written as CoSec documents the header, base64url without padding of its JSON, format version 1 (Forwarding the identity, schema/cosec-identity.schema.json): CoSec's own codec is its internal API, which only CoSec's modules use. The services' tests that run behind CoSec's gateway mode read it through CoSec's own pipeline, so a change of the format fails them. It is a test's and a developer's tool, never a gateway's: a service believes whoever sends it.