Skip to content
Playground(another site)

bynk.test.wrong_issuer_needs_oidc_route

Error A case drives by WrongIssuer at an address that is not an http route with an Oidc actor; it sends a correctly signed token whose iss is not the actor's, so only an Oidc seam can refuse it.

by WrongIssuer sends a correctly signed, unexpired token whose iss is not the actor's issuer. Only an Oidc actor has an issuer to check: a Bearer token has none, and a Signature or public route has no token. On any other route the case is refused. Drive a route guarded by an Oidc actor. The same holds for bynk.test.wrong_audience_needs_oidc_route, bynk.test.wrong_algorithm_needs_oidc_route and bynk.test.no_subject_needs_oidc_route.

Example

demo/api.bynk
actor User { auth = Bearer(secret = "S"), identity = UserId }
actor Workload { auth = Oidc(…
on GET("/me") () -> Effect[HttpResult[String]] by u: User { … }
on GET("/who") () -> Effect[HttpResult[String]] by w: Workload { … }
// tests/api.test.bynk
let r <- api.GET("/me") by WrongIssuer // ✗ a `Bearer` token has no issuer
let r <- api.GET("/who") by WrongIssuer // ✓

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