Skip to content
Playground(another site)

bynk.test.expired_needs_bearer_route

Error A case drives by Expired at an address that is not an http route with a Bearer actor (alone, or as a member of an actor sum) or an Oidc actor; it sends a correctly signed token whose exp has passed, so only a Bearer or Oidc seam can refuse it.

by Expired sends an expired token, so it needs a route whose seam checks one: a Bearer or Oidc actor. A public route, or one guarded by a Signature actor, has no token to expire; for a Signature route by Stale sends a stale signature. Drive a route guarded by a Bearer or Oidc actor. See bynk.test.nobody_needs_secured_route for the same limit on Nobody.

Example

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

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.expired_needs_bearer_route shows the same from the installed toolchain, without a network.