mirror of
https://github.com/langchain-ai/langgraphjs.git
synced 2026-07-25 13:15:45 -04:00
fix(api): make meta routes unauthed (#1471)
Co-authored-by: Tat Dat Duong <david@duong.cz>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@langchain/langgraph-api": patch
|
||||
---
|
||||
|
||||
exlcude meta routes from auth
|
||||
@@ -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"
|
||||
|
||||
@@ -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) });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user