Skip to content
Playground(another site)

bynk.test.no_subject_needs_oidc_route

Error A case drives by NoSubject at an address that is not an http route with an Oidc actor; it sends correctly signed tokens whose sub is empty and whose sub is missing, so only an Oidc seam can refuse them.

by NoSubject sends two correctly signed, unexpired tokens whose sub the seam must refuse: one empty, one missing. Only an Oidc actor's seam is driven with these tokens, so on any other route, a Bearer or Signature one or a public one, 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_audience_needs_oidc_route and bynk.test.wrong_algorithm_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 NoSubject // ✗ a `Bearer` route is not an `Oidc` one
let r <- api.GET("/who") by NoSubject // ✓

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