Skip to content
Playground(another site)

bynk.test.principal_identity_mismatch

Error A call-site by <Actor> acts as an actor whose identity is incompatible with the addressed handler's actor, or names no member of the handler's actor sum.

A handler guarded by an actor runs as that actor, so a case must act as it, with the identity type it declares. by Visitor carries no identity, so it cannot stand in for User, and an actor outside the handler's by sum is no member of it. Act as the actor the handler names. To exercise an unauthenticated request instead, use by Nobody in a system case.

Example

demo/api.bynk
actor User { … }
// tests/api.test.bynk
let r <- api.GET("/a") by Visitor // ✗ the handler is `by u: User`
let r <- api.GET("/a") by User("bob") // ✓

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