langgraph-api 0.0.10__tar.gz → 0.0.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of langgraph-api might be problematic. Click here for more details.
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/PKG-INFO +2 -1
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/auth/custom.py +24 -2
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/utils.py +3 -3
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/ops.py +1 -1
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/pyproject.toml +2 -2
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/LICENSE +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/README.md +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/__init__.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/api/__init__.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/api/assistants.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/api/meta.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/api/openapi.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/api/runs.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/api/store.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/api/threads.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/asyncio.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/auth/__init__.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/auth/langsmith/__init__.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/auth/langsmith/backend.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/auth/langsmith/client.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/auth/middleware.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/auth/noop.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/cli.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/config.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/cron_scheduler.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/errors.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/graph.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/http.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/http_logger.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/.gitignore +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/build.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/client.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/global.d.ts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/package.json +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/remote.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/server_sent_events.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/graph.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/hooks.mjs +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/parser/parser.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/parser/parser.worker.mjs +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/schema/types.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/schema/types.template.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/utils/importMap.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/utils/pythonSchemas.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/utils/serde.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/api.test.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/compose-postgres.yml +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/.gitignore +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/agent.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/error.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/langgraph.json +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/nested.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/package.json +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/weather.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/graphs/yarn.lock +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/parser.test.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/tests/utils.mts +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/yarn.lock +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/lifespan.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/logging.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/metadata.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/models/__init__.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/models/run.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/patch.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/queue.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/route.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/schema.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/serde.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/server.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/sse.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/state.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/stream.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/validation.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_license/__init__.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_license/middleware.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_license/validation.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/__init__.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/checkpoint.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/database.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/queue.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/retry.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/store.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_storage/ttl_dict.py +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/logging.json +0 -0
- {langgraph_api-0.0.10 → langgraph_api-0.0.11}/openapi.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: langgraph-api
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
4
4
|
Summary:
|
|
5
5
|
License: Elastic-2.0
|
|
6
6
|
Author: Nuno Campos
|
|
@@ -16,6 +16,7 @@ Requires-Dist: jsonschema-rs (>=0.25.0,<0.26.0)
|
|
|
16
16
|
Requires-Dist: langchain-core (>=0.2.38,<0.4.0)
|
|
17
17
|
Requires-Dist: langgraph (>=0.2.56,<0.3.0)
|
|
18
18
|
Requires-Dist: langgraph-checkpoint (>=2.0.7,<3.0)
|
|
19
|
+
Requires-Dist: langgraph-sdk (>=0.1.47,<0.2.0)
|
|
19
20
|
Requires-Dist: langsmith (>=0.1.63,<0.3.0)
|
|
20
21
|
Requires-Dist: orjson (>=3.10.1)
|
|
21
22
|
Requires-Dist: pyjwt (>=2.9.0,<3.0.0)
|
|
@@ -158,8 +158,8 @@ class CustomAuthBackend(AuthenticationBackend):
|
|
|
158
158
|
args = _extract_arguments_from_scope(
|
|
159
159
|
conn.scope, self._param_names, request=Request(conn.scope)
|
|
160
160
|
)
|
|
161
|
-
|
|
162
|
-
return
|
|
161
|
+
response = await self.fn(**args)
|
|
162
|
+
return _normalize_auth_response(response)
|
|
163
163
|
except AssertionError as e:
|
|
164
164
|
raise AuthenticationError(str(e)) from None
|
|
165
165
|
|
|
@@ -415,6 +415,28 @@ class ProxyUser(BaseUser):
|
|
|
415
415
|
return getattr(self._user, name)
|
|
416
416
|
|
|
417
417
|
|
|
418
|
+
def _normalize_auth_response(
|
|
419
|
+
response: Any,
|
|
420
|
+
) -> tuple[AuthCredentials, BaseUser]:
|
|
421
|
+
if isinstance(response, tuple):
|
|
422
|
+
if len(response) != 2:
|
|
423
|
+
raise ValueError(
|
|
424
|
+
f"Expected a tuple with two elements (permissions, user), got {len(response)}"
|
|
425
|
+
)
|
|
426
|
+
permissions, user = response
|
|
427
|
+
elif hasattr(response, "permissions"):
|
|
428
|
+
permissions = response.permissions
|
|
429
|
+
user = response
|
|
430
|
+
elif isinstance(response, dict | Mapping) and "permissions" in response:
|
|
431
|
+
permissions = response["permissions"]
|
|
432
|
+
user = response
|
|
433
|
+
else:
|
|
434
|
+
user = response
|
|
435
|
+
permissions = []
|
|
436
|
+
|
|
437
|
+
return AuthCredentials(permissions), _normalize_user(user)
|
|
438
|
+
|
|
439
|
+
|
|
418
440
|
def _normalize_user(user: Any) -> BaseUser:
|
|
419
441
|
"""Normalize user into a BaseUser instance."""
|
|
420
442
|
if isinstance(user, BaseUser):
|
|
@@ -6,7 +6,7 @@ from datetime import datetime
|
|
|
6
6
|
from typing import Any, Protocol, TypeAlias, TypeVar
|
|
7
7
|
|
|
8
8
|
from langgraph_sdk import Auth
|
|
9
|
-
from starlette.authentication import AuthCredentials, BaseUser
|
|
9
|
+
from starlette.authentication import AuthCredentials, BaseUser, SimpleUser
|
|
10
10
|
from starlette.exceptions import HTTPException
|
|
11
11
|
|
|
12
12
|
T = TypeVar("T")
|
|
@@ -32,8 +32,8 @@ def set_auth_ctx(user: BaseUser | None, auth: AuthCredentials | None) -> None:
|
|
|
32
32
|
else:
|
|
33
33
|
AuthContext.set(
|
|
34
34
|
Auth.types.BaseAuthContext(
|
|
35
|
-
|
|
36
|
-
user=user,
|
|
35
|
+
permissions=auth.scopes,
|
|
36
|
+
user=user or SimpleUser(""),
|
|
37
37
|
)
|
|
38
38
|
)
|
|
39
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "langgraph-api"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.11"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = [
|
|
6
6
|
"Nuno Campos <nuno@langchain.dev>",
|
|
@@ -35,6 +35,7 @@ jsonschema-rs = "^0.25.0"
|
|
|
35
35
|
structlog = "^24.4.0"
|
|
36
36
|
pyjwt = "^2.9.0"
|
|
37
37
|
cryptography = "^43.0.3"
|
|
38
|
+
langgraph-sdk = "^0.1.47"
|
|
38
39
|
|
|
39
40
|
[tool.poetry.group.dev.dependencies]
|
|
40
41
|
ruff = "^0.6.2"
|
|
@@ -43,7 +44,6 @@ pytest = "^7.4.4"
|
|
|
43
44
|
anyio = "^4.4.0"
|
|
44
45
|
pytest-watcher = "^0.4.2"
|
|
45
46
|
langgraph-cli = "^0.1.63"
|
|
46
|
-
langgraph-sdk = "^0.1.45"
|
|
47
47
|
pytest-repeat = "^0.9.3"
|
|
48
48
|
pytest-retry = "^1.6.3"
|
|
49
49
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langgraph_api-0.0.10 → langgraph_api-0.0.11}/langgraph_api/js/src/schema/types.template.mts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|