callRoutes

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.