fix(api): make meta routes unauthed (#1471)

Co-authored-by: Tat Dat Duong <david@duong.cz>
This commit is contained in:
lc-arjun
2025-07-30 17:57:24 -07:00
committed by GitHub
parent ef84039244
commit 7edf347d7d
3 changed files with 16 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@langchain/langgraph-api": patch
---
exlcude meta routes from auth
+3
View File
@@ -72,6 +72,9 @@ export const auth = (): MiddlewareHandler => {
return async (c, next) => {
if (!isAuthRegistered()) return next();
// skip for /info
if (c.req.path === "/info") return next();
if (
!isStudioAuthDisabled() &&
c.req.header("x-auth-scheme") === "langsmith"
+8
View File
@@ -743,3 +743,11 @@ it.skipIf(process.version.startsWith("v18."))(
expect(chunks.find((i) => i.event === "error")).not.toBeDefined();
}
);
it("info endpoint", async () => {
const res = await fetch(API_URL + "/info");
expect(res.status).toBe(200);
const json = await res.json();
expect(json).toMatchObject({ version: expect.any(String) });
});