fix(binjovi): one error handler per staging rule, so HTML gets its redirect #118
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/binjovi-dev-dashboard-routes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #116, found on the first browser probe of
https://binjovi.dev/after binjovi v0.1.716 landed.Each
binjovi-dev-*rule listed two per-rule error handlers:redirectwith an HTMLwhen, andjsonwith no condition. Oathkeeper treats a handler without a condition as responsible for every request, so an HTML request found two responsible handlers and answered500 "Found more than one error handlers to be responsible for this request". A request that was not HTML still got its 401, so the availability gate passed and the staging Deploy went through; only the browser path was broken.Per the Ory pipeline documentation, per-rule handlers must not overlap, and a request that matches no rule handler falls back to the global list, whose
jsonhandler is what gives the 401. So each staging rule now carries only the HTML redirect. The contract refuses a per-rulejsonhandler on the staging twins and explains why.tests/check.shpasses; the six rules parse with exactly[redirect]as their error handlers.Verified before the change: anonymous
curl https://binjovi.dev/→ 401 JSON from Oathkeeper; withAccept: text/html→ 500. Expected after: the same 401, and a 302 tohttps://binjovi.dev/oauth2/start?rd=…for HTML.https://claude.ai/code/session_01XdBRc9CHgFhAxCyHbdVtt6