Skip to content
Playground(another site)

bynk.test.principal_claims_not_oidc

Error A call-site principal passes token claims for an actor that isn't Oidc.

TokenClaims.of([…]) supplies the claims an Oidc actor's token carries, which the handler reads and the actor's rules check. A Bearer actor's token holds an identity and nothing else, so there is no claim set to fill, and the argument is refused. Drop the claims, or test a route guarded by an Oidc actor. See bynk.test.actor_no_identity for the other extra argument.

Example

tests/api.test.bynk
let r <- api.GET("/me") by User("bob", TokenClaims.of(["repository: acme/money"])) // ✗ a Bearer actor
let r <- api.GET("/me") by User("bob") // ✓

In the Book

See also

  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.principal_claims_not_oidc shows the same from the installed toolchain, without a network.