Ticket

sealed class Ticket

A Routex service ticket. The raw string is a JWT whose data.service claim names the specific service it authenticates; the subclasses pin that service at the type level so the Kotlin compiler rejects passing an Accounts ticket to balances() and vice versa.

Ticket instances are cheap to create: construction parses the JWT payload (no signature verification) and caches the extracted data.id claim.

Inheritors

Types

Link copied to clipboard
data class Accounts(val raw: String) : Ticket

Ticket that authenticates a call to the accounts service.

Link copied to clipboard
data class Balances(val raw: String) : Ticket

Ticket that authenticates a call to the balances service.

Link copied to clipboard
data class CollectPayment(val raw: String) : Ticket

Ticket that authenticates a call to the collect-payment service.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Transactions(val raw: String) : Ticket

Ticket that authenticates a call to the transactions service.

Link copied to clipboard
data class Transfer(val raw: String) : Ticket

Ticket that authenticates a call to the transfer service.

Properties

Link copied to clipboard
abstract val id: Uuid

The data.id UUIDv4 claim extracted from the JWT payload.

Link copied to clipboard
abstract val raw: String

The underlying JWT string.