Skip to content

basalt / http/src / isRouteVisible

Function: isRouteVisible() ​

> isRouteVisible(route, context, container): Promise<boolean>

Defined in: http/src/route-visibility.ts:47

True unless the caller statically cannot pass this route's guards, judged only by pure checks:

  • built in: a route declaring meta.auth is hidden from a caller with no context.user — but only when a registered guard claimed auth (under an edge-auth waiver no user ever appears in the context, and hiding every route would be wrong);
  • every RouteVisibilityCheck registered in ROUTE_VISIBILITY_BUCKET (e.g. teamsPlugin's meta.teamRole check). A check that throws hides the route (fail closed).

Keys no plugin registered a check for are NOT filtered — the route stays visible and its guards decide on the call.

Parameters ​

route ​

BasaltRoute

context ​

Record<string, unknown>

container ​

Container

Returns ​

Promise<boolean>

Released under the MIT License.