Skip to content
Playground(another site)

bynk.actor.caller_not_admitted

Error A call is made from a context the callee's Caller refinement does not admit.

A refinement over Caller, such as actor Admin = Caller where IsContext(shop.admin), names the contexts that may call a service. The compiler sees every call in the project, so a call from any other context is refused here, at the call, before anything is deployed. The wire format still checks the caller at run time (a 403), because signing keys are per pair of contexts and a caller from before the restriction may still be deployed. In a test, a call-site by Admin("shop.web") is checked the same way. Call a service the context may call, or add the context to the actor's IsContext(…).

Example

shop/billing.bynk
context shop.billing
actor Admin = Caller where IsContext(shop.admin)
service refunds {
on call(id: String) -> Effect[Int] by Admin {
Effect.pure(1)
}
}
service quote {
on call(id: String) -> Effect[Int] by Caller {
Effect.pure(2)
}
}
// shop/orders.bynk
context shop.orders
consumes shop.billing
service place {
on call(id: String) -> Effect[Int] by Caller {
shop.billing.refunds(id) // ✗ `shop.orders` is not `shop.admin`
shop.billing.quote(id) // ✓ `quote` admits any consuming context
}
}

See also

  • Every code in its category, Actors, on the diagnostic index.
  • bynk explain bynk.actor.caller_not_admitted shows the same from the installed toolchain, without a network.