bynk.test.wrong_audience_needs_oidc_route
Error A case drives by WrongAudience at an address that is not an http route with an Oidc actor; it sends a correctly signed token whose aud is not the actor's, so only an Oidc seam can refuse it.
by WrongAudience sends a correctly signed, unexpired token whose aud is not the actor's audience. Only an Oidc actor has an audience 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_issuer_needs_oidc_route, bynk.test.wrong_algorithm_needs_oidc_route and bynk.test.no_subject_needs_oidc_route.
Example
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.bynklet r <- api.GET("/me") by WrongAudience // ✗ a `Bearer` token has no audiencelet r <- api.GET("/who") by WrongAudience // ✓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_audience_needs_oidc_routeshows the same from the installed toolchain, without a network.