Let /login/oidc through without an API key: /login alone was exempt

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 16:37:24 +02:00
1 parent dfe4093aea
commit 5cff456b9b
2 files changed
+14 -1

No files matched your search

+13
View File
@@ -255,3 +255,16 @@ func TestAJudgeModelIsNotNamedToClientsInErrors(t *testing.T) {
t.Errorf("named: %s", rec.Body.String())
}
}
func TestSignInThroughAProviderNeedsNoAPIKey(t *testing.T) {
e := newFakeEngine(t, "qwen2.5-14b-instruct")
rt, _ := pricedRouter(t, e.srv.URL)
rt.oidc = config.OIDC{Issuer: "http://127.0.0.1:1", ClientID: "llmgw"}
rec := httptest.NewRecorder()
rt.Handler().ServeHTTP(rec, httptest.NewRequest("GET", "/login/oidc", nil))
// The provider is not there, so the page says so — but it is the page,
// not the API's "no key".
if rec.Code == http.StatusUnauthorized || !strings.Contains(rec.Body.String(), "sign-in service") {
t.Errorf("%d %s", rec.Code, rec.Body.String())
}
}
+1 -1
View File
@@ -261,7 +261,7 @@ func (r *Router) Handler() http.Handler {
// stays open because a load balancer has no key.
return auth.Middleware(r.auth, r.log,
"/health", "/ready", "/leader", "/", "/about", "/_static/", "/claim/",
"/signup", "/login", "/logout", "/profile", "/profile/",
"/signup", "/login", "/login/", "/logout", "/profile", "/profile/", "/scim/",
"/admin", "/admin/", "/chat", "/chat/", "/org", "/org/", "/setup/")(mux)
}