Skip to content
Playground(another site)

bynk.test.nobody_needs_secured_route

Error A case drives by Nobody at a route with no Bearer, Oidc or Signature actor (alone, or as a member of an actor sum) (e.g. a public Visitor route) — there is no auth seam to reject the missing credential.

by Nobody sends no credential so that a route's auth seam answers 401. A public route, guarded by Visitor, has no seam that refuses anyone, so the case would test nothing and is refused. Use by Nobody on a route guarded by a Bearer, Oidc or Signature actor, and act as Visitor on a public one. For the other failure principals, see bynk.test.expired_needs_bearer_route.

Example

demo/api.bynk
on GET("/health") () -> Effect[HttpResult[Int]] by v: Visitor { … }
// tests/api.test.bynk
let r <- api.GET("/health") by Nobody // ✗ a public route has no seam
let r <- api.GET("/health") by Visitor // ✓

In the Book

See also

  • The grammar rule it governs: case.
  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.nobody_needs_secured_route shows the same from the installed toolchain, without a network.