Package-level declarations

Types

Link copied to clipboard
class WowHttpOptions @InternalWowApi constructor(val requestFacts: Set<String> = emptySet(), val errorStatuses: Map<String, Int> = emptyMap(), val manifestEndpoint: Boolean = true, val openApiEndpoint: Boolean = true, val clientFacts: Boolean = true, val requestIdHeaders: List<String> = listOf(WowHeaders.REQUEST_ID))

What the host configures of the public routes (and the wow.http.* properties of the host).

Functions

Link copied to clipboard
fun callRoutes(manifest: Manifest, gateway: CommandGateway, callerResolver: CallerResolver, options: WowHttpOptions = WowHttpOptions(), permits: CallPermits = CallPermits(emptyMap()), scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)): RouterFunction<ServerResponse>

The routes of the services' synchronous calls, served on the internal port beside the cluster channel and the wait signals: every command route of manifest, the same paths and answers as on the public port, sending the command through gateway, an internal command's (@InternalCommand) included, which the public port does not serve. Each request must come from a service identity, which callerResolver resolves (the service the request names, me.ahoo.wow.http.caller.DeclaredServices), and carry Wow-Call; any other, one that names no service too, is answered 403 wow.auth.forbidden. The public port refuses Wow-Call (wowRoutes), so the root command a call asserts reaches a node only through its internal network, from a service it trusts. A service calls only the commands permits lets it: the domain commands by default, a system command (wow.*: the lifecycle, the snapshot rebuild, the schedules and the jobs, whose routes are the public port's too) only when listed; any other is answered 403 CallPermits.COMMAND_FORBIDDEN. A call of a command route the Manifest does not have, in a context it serves, is answered 400 wow.command.unhandled with its REJECTED result, not 404: the caller's contract names a command this service does not decide, which a retry does not mend. The streamed answers are produced in scope, as wowRoutes's are.

Link copied to clipboard
fun peerReadRoutes(manifest: Manifest, gateway: CommandGateway, callerResolver: CallerResolver, queries: HttpQueries, reads: StateReads = StateReads.NONE, options: WowHttpOptions = WowHttpOptions(), permits: CallPermits = CallPermits(emptyMap()), masks: PayloadMasks = PayloadMasks(manifest), scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)): RouterFunction<ServerResponse>

The read routes of the services' peer reads, served on the internal port beside the call routes (callRoutes): the same paths and answers as the public port's query routes, state reads and dataset routes, for the services that read this one through wow-client's service mode, without the end user's credential.

Link copied to clipboard
fun wowOpenApi(manifest: Manifest, options: WowHttpOptions = WowHttpOptions(), queries: HttpQueries = HttpQueries.NONE, securitySchemes: Map<String, OpenApiSecurityScheme> = emptyMap()): Map<String, Any?>

The OpenAPI document of the routes wowRoutes serves from manifest, options and queries, the one GET /wow/openapi answers, with the securitySchemes the host's caller resolver accepts: the document the host merges into springdoc's. The public port's routes alone: the internal port's call routes, cluster channel and signals are never in it.

Link copied to clipboard
fun wowRoutes(manifest: Manifest, gateway: CommandGateway, reads: StateReads = StateReads.NONE, callerResolver: CallerResolver = CallerResolver.ANONYMOUS, options: WowHttpOptions = WowHttpOptions(), queries: HttpQueries = HttpQueries.NONE, masks: PayloadMasks = PayloadMasks(manifest), scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default), routes: ServiceRoutes = ServiceRoutes.NONE): RouterFunction<ServerResponse>

The routes of the public port (.2; –), materialized from manifest alone: