managed-deepagents 0.6.2.dev44__py3-none-win_amd64.whl → 0.6.2.dev45__py3-none-win_amd64.whl
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 managed-deepagents might be problematic. Click here for more details.
- managed_deepagents/_agent_auth.py +8 -77
- managed_deepagents/_binaries/mda.exe +0 -0
- managed_deepagents/_connections.py +37 -114
- managed_deepagents/_identity_auth.py +0 -19
- managed_deepagents/_identity_runtime.py +0 -6
- managed_deepagents/_validated_token.py +0 -2
- managed_deepagents/identity/__init__.py +0 -4
- {managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/METADATA +7 -10
- {managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/RECORD +13 -13
- {managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/WHEEL +0 -0
- {managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/entry_points.txt +0 -0
- {managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/licenses/LICENSE +0 -0
- {managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/top_level.txt +0 -0
|
@@ -34,41 +34,21 @@ __all__ = [
|
|
|
34
34
|
"AgentAuthUnknownProviderError",
|
|
35
35
|
"CredentialAuthorizationRequiredError",
|
|
36
36
|
"PendingAuthorization",
|
|
37
|
-
"ResolvePrincipalIdentity",
|
|
38
37
|
"WorkspaceConnection",
|
|
39
|
-
"clear_principal_resolve_cache_for_tests",
|
|
40
38
|
]
|
|
41
39
|
|
|
42
40
|
|
|
43
41
|
@dataclass(frozen=True)
|
|
44
42
|
class AgentAuthContext:
|
|
45
43
|
base_url: str
|
|
44
|
+
#: Deployment id, passed to oauth-authorization-sessions as ``agent_id``.
|
|
45
|
+
agent_id: str
|
|
46
46
|
#: Authenticated caller, used as ``owner_id`` for user credentials.
|
|
47
47
|
principal_id: str
|
|
48
|
-
#: Deployment id when present. Required for agent-owned lookups; optional for user OAuth.
|
|
49
|
-
agent_id: str | None = None
|
|
50
48
|
api_key: str | None = None
|
|
51
49
|
workspace_id: str | None = None
|
|
52
50
|
|
|
53
51
|
|
|
54
|
-
class ResolvePrincipalIdentity(TypedDict):
|
|
55
|
-
provider: str
|
|
56
|
-
issuer: str
|
|
57
|
-
subject: str
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_principal_resolve_cache: dict[str, str] = {}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def clear_principal_resolve_cache_for_tests() -> None:
|
|
64
|
-
"""Drop cached principal resolutions. Test-only."""
|
|
65
|
-
_principal_resolve_cache.clear()
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def _principal_resolve_cache_key(identity: ResolvePrincipalIdentity) -> str:
|
|
69
|
-
return f"{identity['provider']}\0{identity['issuer']}\0{identity['subject']}"
|
|
70
|
-
|
|
71
|
-
|
|
72
52
|
class PendingAuthorization(TypedDict):
|
|
73
53
|
"""One connection slug the caller has not granted, with its connect URL."""
|
|
74
54
|
|
|
@@ -135,52 +115,6 @@ class AgentAuth:
|
|
|
135
115
|
self._timeout = timeout
|
|
136
116
|
self._request: AgentAuthRequest = request if request is not None else self._urlopen_json
|
|
137
117
|
|
|
138
|
-
def resolve_principal(self, identity: ResolvePrincipalIdentity) -> str:
|
|
139
|
-
"""Resolve a verified external identity to an Agent Auth principal UUID."""
|
|
140
|
-
provider = identity["provider"].strip()
|
|
141
|
-
issuer = identity["issuer"].strip()
|
|
142
|
-
subject = identity["subject"].strip()
|
|
143
|
-
if not provider or not issuer or not subject:
|
|
144
|
-
raise CredentialStoreError(
|
|
145
|
-
"Agent Auth principal resolve requires provider, issuer, and subject"
|
|
146
|
-
)
|
|
147
|
-
key = _principal_resolve_cache_key(
|
|
148
|
-
{"provider": provider, "issuer": issuer, "subject": subject}
|
|
149
|
-
)
|
|
150
|
-
cached = _principal_resolve_cache.get(key)
|
|
151
|
-
if cached is not None:
|
|
152
|
-
return cached
|
|
153
|
-
try:
|
|
154
|
-
principal_id = self._resolve_principal_uncached(
|
|
155
|
-
{"provider": provider, "issuer": issuer, "subject": subject}
|
|
156
|
-
)
|
|
157
|
-
except Exception:
|
|
158
|
-
raise
|
|
159
|
-
_principal_resolve_cache[key] = principal_id
|
|
160
|
-
return principal_id
|
|
161
|
-
|
|
162
|
-
def _resolve_principal_uncached(self, identity: ResolvePrincipalIdentity) -> str:
|
|
163
|
-
status, body = self._request(
|
|
164
|
-
"POST",
|
|
165
|
-
"/v1/agent-auth/principals",
|
|
166
|
-
body={
|
|
167
|
-
"provider": identity["provider"],
|
|
168
|
-
"issuer": identity["issuer"],
|
|
169
|
-
"subject": identity["subject"],
|
|
170
|
-
},
|
|
171
|
-
)
|
|
172
|
-
if status >= _HTTP_BAD_REQUEST:
|
|
173
|
-
raise CredentialStoreError("Agent Auth resolve principal failed", status, body)
|
|
174
|
-
principal = body.get("principal")
|
|
175
|
-
principal_id = ""
|
|
176
|
-
if isinstance(principal, Mapping):
|
|
177
|
-
raw = principal.get("id")
|
|
178
|
-
if isinstance(raw, str):
|
|
179
|
-
principal_id = raw.strip()
|
|
180
|
-
if not principal_id:
|
|
181
|
-
raise CredentialStoreError("Agent Auth resolve principal returned no principal id")
|
|
182
|
-
return principal_id
|
|
183
|
-
|
|
184
118
|
def find_workspace_connection(self, slug: str) -> WorkspaceConnection | None:
|
|
185
119
|
"""List workspace connections and return the row for ``slug``, if any."""
|
|
186
120
|
if not (self.context.workspace_id or "").strip():
|
|
@@ -241,17 +175,14 @@ class AgentAuth:
|
|
|
241
175
|
"""
|
|
242
176
|
if connection.kind != "secret":
|
|
243
177
|
return None
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
"connections are not configured: LANGSMITH_HOST_PROJECT_ID is not set"
|
|
248
|
-
)
|
|
249
|
-
from_agent = self._credential_id_for_owner(connection.connection_id, "agent", agent_id)
|
|
178
|
+
from_agent = self._credential_id_for_owner(
|
|
179
|
+
connection.connection_id, "agent", self.context.agent_id
|
|
180
|
+
)
|
|
250
181
|
if from_agent is not None:
|
|
251
182
|
return from_agent
|
|
252
183
|
return self.find_credential_id(
|
|
253
184
|
owner_type="agent",
|
|
254
|
-
owner_id=agent_id,
|
|
185
|
+
owner_id=self.context.agent_id,
|
|
255
186
|
kind="secret",
|
|
256
187
|
slug=slug,
|
|
257
188
|
)
|
|
@@ -346,8 +277,8 @@ class AgentAuth:
|
|
|
346
277
|
"/v1/agent-auth/oauth-authorization-sessions",
|
|
347
278
|
body={
|
|
348
279
|
"connection_id": connection.connection_id,
|
|
349
|
-
"
|
|
350
|
-
"
|
|
280
|
+
"principal_id": self.context.principal_id,
|
|
281
|
+
"agent_id": self.context.agent_id,
|
|
351
282
|
},
|
|
352
283
|
)
|
|
353
284
|
if status >= _HTTP_BAD_REQUEST:
|
|
Binary file
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
``{ type: "agent" }`` resolves material owned by the current deployment.
|
|
4
4
|
``{ type: "user" }`` resolves per-caller grants (OAuth or opaque). Resolution
|
|
5
|
-
reads Agent Auth on every await and never caches
|
|
5
|
+
reads Agent Auth on every await and never caches.
|
|
6
6
|
|
|
7
7
|
``mda dev`` substitutes local values for agent opaque secrets via ``MDA_DEV_*``.
|
|
8
|
-
User-owned connections
|
|
9
|
-
|
|
8
|
+
User-owned connections need a deployment; opaque user grants use the same
|
|
9
|
+
pre-run gate as OAuth.
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
from __future__ import annotations
|
|
@@ -25,7 +25,6 @@ from managed_deepagents._agent_auth import (
|
|
|
25
25
|
AgentAuthContext,
|
|
26
26
|
CredentialAuthorizationRequiredError,
|
|
27
27
|
WorkspaceConnection,
|
|
28
|
-
clear_principal_resolve_cache_for_tests,
|
|
29
28
|
)
|
|
30
29
|
from managed_deepagents._agent_auth_http import (
|
|
31
30
|
AGENT_AUTH_TIMEOUT_SECONDS,
|
|
@@ -50,12 +49,10 @@ __all__ = [
|
|
|
50
49
|
"CredentialStoreError",
|
|
51
50
|
"InvalidAgentAuthEndpointError",
|
|
52
51
|
"agent_connection_env_key",
|
|
53
|
-
"clear_principal_resolve_cache_for_tests",
|
|
54
52
|
"connections",
|
|
55
53
|
"is_connection_reference",
|
|
56
54
|
"resolve_agent_auth_base_url",
|
|
57
55
|
"resolve_agent_auth_context",
|
|
58
|
-
"resolve_credential_principal_id",
|
|
59
56
|
"resolve_owner_id",
|
|
60
57
|
]
|
|
61
58
|
|
|
@@ -111,7 +108,19 @@ class ConnectionNotFoundError(LookupError):
|
|
|
111
108
|
_SLUG_PATTERN = re.compile(r"[a-z0-9]+(?:-[a-z0-9]+)*")
|
|
112
109
|
_MAX_SLUG_LENGTH = 64
|
|
113
110
|
_DEV_CREDENTIAL_PREFIX = "MDA_DEV_"
|
|
114
|
-
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _local_user_connection_unsupported(slug: str | None = None) -> str:
|
|
114
|
+
local_hint = (
|
|
115
|
+
f"set {agent_connection_env_key(slug)}"
|
|
116
|
+
if slug
|
|
117
|
+
else "set the corresponding MDA_DEV_<slug> variable"
|
|
118
|
+
)
|
|
119
|
+
return (
|
|
120
|
+
"user-owned connections need a deployment, so they do not resolve in `mda dev`: "
|
|
121
|
+
"deploy with `mda deploy` to exercise this connection, or declare it as "
|
|
122
|
+
f'{{"type": "agent"}} and {local_hint} for local runs'
|
|
123
|
+
)
|
|
115
124
|
|
|
116
125
|
|
|
117
126
|
#: Env var naming the LangSmith platform API that serves Agent Auth.
|
|
@@ -167,29 +176,15 @@ class AgentAuthConnectionStore:
|
|
|
167
176
|
async def fetch(self, request: ConnectionRequest) -> str | None:
|
|
168
177
|
owner = request["owner"]
|
|
169
178
|
resolved = os.environ if self._env is None else self._env
|
|
170
|
-
if resolved.get("MDA_LOCAL_DEV") == "1"
|
|
171
|
-
return
|
|
179
|
+
if resolved.get("MDA_LOCAL_DEV") == "1":
|
|
180
|
+
return _fetch_local_dev_connection(resolved, request["slug"], owner)
|
|
172
181
|
config = _resolve_agent_auth_config(self._env)
|
|
173
|
-
|
|
174
|
-
raise CredentialStoreError(
|
|
175
|
-
f"connections are not configured: {DEPLOYMENT_ID_ENV} is not set"
|
|
176
|
-
)
|
|
177
|
-
# Source-identity match still uses JWT sub / channel actor.
|
|
178
|
-
resolve_owner_id(owner, request["identity"], config.deployment_id)
|
|
179
|
-
if owner["type"] == "user":
|
|
180
|
-
principal_id = resolve_credential_principal_id(
|
|
181
|
-
request["identity"],
|
|
182
|
-
config,
|
|
183
|
-
request_fn=self._bind_request(config),
|
|
184
|
-
timeout=self._timeout,
|
|
185
|
-
)
|
|
186
|
-
else:
|
|
187
|
-
principal_id = resolve_owner_id(owner, request["identity"], config.deployment_id)
|
|
182
|
+
owner_id = resolve_owner_id(owner, request["identity"], config.deployment_id)
|
|
188
183
|
client = AgentAuth(
|
|
189
184
|
AgentAuthContext(
|
|
190
185
|
base_url=config.base_url,
|
|
191
|
-
agent_id=config.deployment_id,
|
|
192
|
-
principal_id=
|
|
186
|
+
agent_id=config.deployment_id or owner_id,
|
|
187
|
+
principal_id=owner_id,
|
|
193
188
|
api_key=config.api_key,
|
|
194
189
|
workspace_id=config.workspace_id,
|
|
195
190
|
),
|
|
@@ -213,14 +208,12 @@ class AgentAuthConnectionStore:
|
|
|
213
208
|
*,
|
|
214
209
|
body: dict[str, object] | None = None,
|
|
215
210
|
) -> tuple[int, dict[str, object]]:
|
|
211
|
+
del method, body
|
|
216
212
|
url = f"{config.base_url}{path}"
|
|
217
213
|
headers = agent_auth_headers(
|
|
218
214
|
api_key=config.api_key,
|
|
219
215
|
workspace_id=config.workspace_id,
|
|
220
216
|
)
|
|
221
|
-
# Test injects only support GET-shaped responses; path still distinguishes
|
|
222
|
-
# principals vs connections for mock routers.
|
|
223
|
-
del method, body
|
|
224
217
|
response = http_get(url, headers, timeout)
|
|
225
218
|
status = response.get("status")
|
|
226
219
|
raw_body = response.get("body", b"")
|
|
@@ -234,7 +227,13 @@ class AgentAuthConnectionStore:
|
|
|
234
227
|
return request
|
|
235
228
|
|
|
236
229
|
|
|
237
|
-
def
|
|
230
|
+
def _fetch_local_dev_connection(
|
|
231
|
+
resolved: Mapping[str, str],
|
|
232
|
+
slug: str,
|
|
233
|
+
owner: ConnectionOwner,
|
|
234
|
+
) -> str:
|
|
235
|
+
if owner["type"] == "user":
|
|
236
|
+
raise CredentialStoreError(_local_user_connection_unsupported(slug))
|
|
238
237
|
value = resolved.get(agent_connection_env_key(slug))
|
|
239
238
|
if value is not None and value.strip():
|
|
240
239
|
return value
|
|
@@ -411,100 +410,24 @@ def resolve_owner_id(
|
|
|
411
410
|
def resolve_agent_auth_context(
|
|
412
411
|
identity: RuntimeIdentity | None,
|
|
413
412
|
env: Mapping[str, str] | None = None,
|
|
414
|
-
*,
|
|
415
|
-
request_fn: Callable[..., tuple[int, dict[str, object]]] | None = None,
|
|
416
|
-
timeout: float = AGENT_AUTH_TIMEOUT_SECONDS,
|
|
417
413
|
) -> AgentAuthContext:
|
|
414
|
+
resolved = os.environ if env is None else env
|
|
415
|
+
if resolved.get("MDA_LOCAL_DEV") == "1":
|
|
416
|
+
raise CredentialStoreError(_local_user_connection_unsupported())
|
|
418
417
|
config = _resolve_agent_auth_config(env)
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
418
|
+
if not config.deployment_id:
|
|
419
|
+
raise CredentialStoreError(
|
|
420
|
+
f"connections are not configured: {DEPLOYMENT_ID_ENV} is not set"
|
|
421
|
+
)
|
|
422
422
|
return AgentAuthContext(
|
|
423
423
|
base_url=config.base_url,
|
|
424
424
|
agent_id=config.deployment_id,
|
|
425
|
-
principal_id=
|
|
425
|
+
principal_id=resolve_owner_id({"type": "user"}, identity, config.deployment_id),
|
|
426
426
|
api_key=config.api_key,
|
|
427
427
|
workspace_id=config.workspace_id,
|
|
428
428
|
)
|
|
429
429
|
|
|
430
430
|
|
|
431
|
-
def resolve_credential_principal_id(
|
|
432
|
-
identity: RuntimeIdentity | None,
|
|
433
|
-
config: _AgentAuthConfig,
|
|
434
|
-
*,
|
|
435
|
-
request_fn: Callable[..., tuple[int, dict[str, object]]] | None = None,
|
|
436
|
-
timeout: float = AGENT_AUTH_TIMEOUT_SECONDS,
|
|
437
|
-
) -> str:
|
|
438
|
-
"""Map a runtime identity to the Agent Auth principal used for user grants."""
|
|
439
|
-
if identity is None:
|
|
440
|
-
raise CredentialStoreError("user connections require an authenticated user principal")
|
|
441
|
-
user = identity.get("user") or {}
|
|
442
|
-
user_id = user.get("id") if isinstance(user, Mapping) else None
|
|
443
|
-
if not isinstance(user_id, str) or not user_id.strip():
|
|
444
|
-
raise CredentialStoreError("user connections require an authenticated user principal")
|
|
445
|
-
kind = user.get("kind") if isinstance(user, Mapping) else None
|
|
446
|
-
if kind == "service":
|
|
447
|
-
raise CredentialStoreError(
|
|
448
|
-
"user-owned connections require a person principal; "
|
|
449
|
-
"Studio and other service callers cannot own OAuth grants"
|
|
450
|
-
)
|
|
451
|
-
stamped = identity.get("agent_auth_principal_id")
|
|
452
|
-
if isinstance(stamped, str) and stamped.strip():
|
|
453
|
-
return stamped.strip()
|
|
454
|
-
|
|
455
|
-
subject = user_id.strip()
|
|
456
|
-
external = _external_identity_for_resolve(identity, config.workspace_id)
|
|
457
|
-
if external is None:
|
|
458
|
-
raise CredentialStoreError(
|
|
459
|
-
"user-owned connections need a resolvable identity "
|
|
460
|
-
"(validated-token issuer/subject, channel identity_context, or trusted backend)"
|
|
461
|
-
)
|
|
462
|
-
bootstrap = AgentAuth(
|
|
463
|
-
AgentAuthContext(
|
|
464
|
-
base_url=config.base_url,
|
|
465
|
-
principal_id=subject,
|
|
466
|
-
api_key=config.api_key,
|
|
467
|
-
workspace_id=config.workspace_id,
|
|
468
|
-
agent_id=config.deployment_id,
|
|
469
|
-
),
|
|
470
|
-
request=request_fn,
|
|
471
|
-
timeout=timeout,
|
|
472
|
-
)
|
|
473
|
-
return bootstrap.resolve_principal(external)
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
def _external_identity_for_resolve(
|
|
477
|
-
identity: RuntimeIdentity,
|
|
478
|
-
workspace_id: str | None,
|
|
479
|
-
) -> dict[str, str] | None:
|
|
480
|
-
user = identity.get("user") or {}
|
|
481
|
-
subject = user.get("id") if isinstance(user, Mapping) else None
|
|
482
|
-
if not isinstance(subject, str) or not subject.strip():
|
|
483
|
-
return None
|
|
484
|
-
subject = subject.strip()
|
|
485
|
-
provider = identity.get("identity_provider")
|
|
486
|
-
claims = identity.get("claims")
|
|
487
|
-
issuer = None
|
|
488
|
-
if isinstance(claims, Mapping):
|
|
489
|
-
raw_iss = claims.get("iss")
|
|
490
|
-
if isinstance(raw_iss, str) and raw_iss.strip():
|
|
491
|
-
issuer = raw_iss.strip()
|
|
492
|
-
if isinstance(provider, str) and provider.strip() and issuer:
|
|
493
|
-
return {
|
|
494
|
-
"provider": provider.strip(),
|
|
495
|
-
"issuer": issuer,
|
|
496
|
-
"subject": subject,
|
|
497
|
-
}
|
|
498
|
-
workspace = (workspace_id or "").strip()
|
|
499
|
-
if not workspace:
|
|
500
|
-
return None
|
|
501
|
-
return {
|
|
502
|
-
"provider": _TRUSTED_BACKEND_PROVIDER,
|
|
503
|
-
"issuer": workspace,
|
|
504
|
-
"subject": subject,
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
|
|
508
431
|
def _resolve_agent_auth_config(env: Mapping[str, str] | None) -> _AgentAuthConfig:
|
|
509
432
|
resolved = os.environ if env is None else env
|
|
510
433
|
api_key = (resolved.get(_API_KEY_ENV) or "").strip()
|
|
@@ -16,7 +16,6 @@ import asyncio
|
|
|
16
16
|
import hmac
|
|
17
17
|
import json
|
|
18
18
|
import os
|
|
19
|
-
import re
|
|
20
19
|
from collections.abc import Callable, Iterable, Mapping
|
|
21
20
|
from http import HTTPStatus
|
|
22
21
|
from importlib import import_module
|
|
@@ -59,21 +58,6 @@ class ManagedUser(ManagedUserRequired, total=False):
|
|
|
59
58
|
mda_source_provider: str
|
|
60
59
|
mda_source_thread_id: str
|
|
61
60
|
mda_user_kind: Literal["user", "service"]
|
|
62
|
-
#: Validated-token provider id for Agent Auth principal resolve.
|
|
63
|
-
mda_identity_provider: str
|
|
64
|
-
#: Agent Auth principal UUID when Trigger ``identity_context`` already resolved one.
|
|
65
|
-
mda_agent_auth_principal_id: str
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
_AGENT_AUTH_PRINCIPAL_ID = re.compile(
|
|
69
|
-
r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
|
|
70
|
-
re.IGNORECASE,
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def is_agent_auth_principal_id(value: str) -> bool:
|
|
75
|
-
"""True when ``value`` is shaped like an Agent Auth principal UUID."""
|
|
76
|
-
return bool(_AGENT_AUTH_PRINCIPAL_ID.fullmatch(value.strip()))
|
|
77
61
|
|
|
78
62
|
|
|
79
63
|
if TYPE_CHECKING:
|
|
@@ -493,9 +477,6 @@ def _trusted_headers_user(headers: Mapping[str, object]) -> ManagedUser:
|
|
|
493
477
|
if source_provider is not None and source_thread is not None:
|
|
494
478
|
user["mda_source_provider"] = str(source_provider)
|
|
495
479
|
user["mda_source_thread_id"] = str(source_thread)
|
|
496
|
-
# Trigger loopback stamps the identity_context principal UUID.
|
|
497
|
-
if is_agent_auth_principal_id(str(actor)):
|
|
498
|
-
user["mda_agent_auth_principal_id"] = str(actor)
|
|
499
480
|
return user
|
|
500
481
|
|
|
501
482
|
|
|
@@ -455,12 +455,6 @@ def build_runtime_identity(configurable: Mapping[str, object] | None) -> Runtime
|
|
|
455
455
|
claims = _field(user, "mda_claims")
|
|
456
456
|
if isinstance(claims, Mapping):
|
|
457
457
|
identity["claims"] = dict(cast("Mapping[str, object]", claims))
|
|
458
|
-
identity_provider = _field(user, "mda_identity_provider")
|
|
459
|
-
if isinstance(identity_provider, str) and identity_provider.strip():
|
|
460
|
-
identity["identity_provider"] = identity_provider.strip()
|
|
461
|
-
agent_auth_principal_id = _field(user, "mda_agent_auth_principal_id")
|
|
462
|
-
if isinstance(agent_auth_principal_id, str) and agent_auth_principal_id.strip():
|
|
463
|
-
identity["agent_auth_principal_id"] = agent_auth_principal_id.strip()
|
|
464
458
|
# Immutable: tools/middleware get a read-only view they cannot tamper with.
|
|
465
459
|
return cast("RuntimeIdentity", _freeze(identity))
|
|
466
460
|
|
|
@@ -263,8 +263,6 @@ def claims_to_user(provider: ValidatedTokenProvider, claims: Mapping[str, object
|
|
|
263
263
|
"permissions": [],
|
|
264
264
|
"mda_user_id": str(caller),
|
|
265
265
|
"mda_claims": dict(claims),
|
|
266
|
-
# Provider id drives Agent Auth POST /principals (provider, issuer, subject).
|
|
267
|
-
"mda_identity_provider": (provider.get("id") or "").strip() or "oidc",
|
|
268
266
|
}
|
|
269
267
|
groups = normalize_groups(claims.get(claim_map["groups"])) if claim_map.get("groups") else []
|
|
270
268
|
if groups:
|
|
@@ -177,10 +177,6 @@ class RuntimeIdentity(RuntimeIdentityRequired, total=False):
|
|
|
177
177
|
#: tools and middleware.
|
|
178
178
|
groups: tuple[str, ...]
|
|
179
179
|
claims: JsonObject
|
|
180
|
-
#: Validated-token provider id for Agent Auth principal resolve.
|
|
181
|
-
identity_provider: str
|
|
182
|
-
#: Agent Auth principal UUID when channel ingress already resolved one.
|
|
183
|
-
agent_auth_principal_id: str
|
|
184
180
|
|
|
185
181
|
|
|
186
182
|
class PrincipalRequired(TypedDict):
|
{managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: managed-deepagents
|
|
3
|
-
Version: 0.6.2.
|
|
3
|
+
Version: 0.6.2.dev45
|
|
4
4
|
Summary: Managed Deep Agents — the define_deep_agent authoring interface plus the CLI that compiles and deploys a code-first Deep Agent repository to a managed LangGraph runtime.
|
|
5
5
|
Author: LangChain
|
|
6
6
|
License: MIT
|
|
@@ -277,19 +277,16 @@ connector = connectors.mcp(
|
|
|
277
277
|
For this example, set `MDA_DEV_DOCS_TOKEN`.
|
|
278
278
|
|
|
279
279
|
A user-owned connection — `connections.get(slug, {"type": "user"})` — resolves
|
|
280
|
-
per caller (OAuth or opaque). The
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
connection rows exist — use a person principal (for example a Supabase JWT),
|
|
285
|
-
not Studio’s synthetic service user. OAuth completes on LangSmith’s platform
|
|
286
|
-
callback URL; the local UI must surface `credential_authorization_required`
|
|
287
|
-
and resume after the user connects.
|
|
280
|
+
per caller (OAuth or opaque). The pre-run credential gate interrupts the run
|
|
281
|
+
when a grant is missing. `mda dev` has no deployment to hold user grants, so
|
|
282
|
+
a user-owned connection fails there with an actionable error; deploy the agent
|
|
283
|
+
to exercise one.
|
|
288
284
|
|
|
289
285
|
Deploy the project first, then provision its connections with
|
|
290
286
|
`mda connections create`. Agent-owned opaque secrets are scoped to that
|
|
291
287
|
deployment, so the command refuses to create one before `mda deploy`.
|
|
292
|
-
`mda
|
|
288
|
+
`mda deploy` fails when a slug a project declares is missing from the
|
|
289
|
+
workspace.
|
|
293
290
|
|
|
294
291
|
Use `include_tools` or `exclude_tools` inside a server config to select a
|
|
295
292
|
subset. Tool names are raw MCP tool names before the managed `{server}__` prefix
|
{managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/RECORD
RENAMED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
managed_deepagents/__init__.py,sha256=RezkpgYxCcywj6_W7Nk3PN9TMBfYyFgIatxGrIeY8V4,1862
|
|
2
2
|
managed_deepagents/__main__.py,sha256=GcjmqN0Ea5v8OHKMxYToasm3eCX_doSLOlpEzAi1tAw,67
|
|
3
|
-
managed_deepagents/_agent_auth.py,sha256=
|
|
3
|
+
managed_deepagents/_agent_auth.py,sha256=bOxTT1ZX9BZZyvgIaxd9SZycbEaQl-HuCrPieCAv6G0,17258
|
|
4
4
|
managed_deepagents/_agent_auth_http.py,sha256=aCYn7Rrtw3cnK3r4ir4JWxwzFkb7cF7nBgPpNdydxDw,5108
|
|
5
5
|
managed_deepagents/_channel.py,sha256=-Og7QOM1yvV-yeTDOfv2CxXpR2HLY4xdX1bLrIsPi5k,5272
|
|
6
6
|
managed_deepagents/_cli.py,sha256=jVaw2i1ysdRoWziMdPFmRXtKry_baYGRspyzyIeGWoU,1688
|
|
7
|
-
managed_deepagents/_connections.py,sha256=
|
|
7
|
+
managed_deepagents/_connections.py,sha256=VwVBwM4T0rp1MgYu9D8QjGj1ireYeEuP3VIAFN5urFY,16246
|
|
8
8
|
managed_deepagents/_connector.py,sha256=Syp0SRs1oFCUUltIUmZbSNi1Ys_PxObVdiAi-I9GBzs,8040
|
|
9
9
|
managed_deepagents/_cors.py,sha256=V96RPrqewdRWG5RpEMEBnPuRq9_zF8nf4vf99k5dkuI,7597
|
|
10
10
|
managed_deepagents/_credential_gate.py,sha256=SNxXunqmHgjBsZpiZu8yp49YkRIO0amkl0-7GHLGnIg,12280
|
|
11
11
|
managed_deepagents/_eval_filesystem.py,sha256=1nuD0yn3gh19JrWNocWyPFyeJW42E7Gse3XRWCUSTAA,1399
|
|
12
12
|
managed_deepagents/_extension.py,sha256=x2H1S8inkvTZQ_dr7kq0M8o8rre1FjzCDvMzItw4iyk,5318
|
|
13
|
-
managed_deepagents/_identity_auth.py,sha256=
|
|
13
|
+
managed_deepagents/_identity_auth.py,sha256=l0t0Xx-J1-z_Zw4K5D-B2yV6lNdeJgOw7UvxODxUxZQ,32798
|
|
14
14
|
managed_deepagents/_identity_http.py,sha256=aVQfZr7UKQoXF1Dry3p9fzXIj1882sEa668rvhn37i0,16029
|
|
15
15
|
managed_deepagents/_identity_links.py,sha256=Z1H2Seo2KaI-vcdU3_PGM-F06wOz0IQqUP-28wqiQsA,9172
|
|
16
|
-
managed_deepagents/_identity_runtime.py,sha256=
|
|
16
|
+
managed_deepagents/_identity_runtime.py,sha256=vsshj0TNWd-rXUhVsPAqXIkANunQT7jI94CWgzq-1cY,24409
|
|
17
17
|
managed_deepagents/_ingress.py,sha256=iqsGm2jZKKn0FqjNn2nJAlR7d-IqCpVKWo6NbMEhjxw,12323
|
|
18
18
|
managed_deepagents/_log.py,sha256=oYwOO0ZL4-INkge9YJvtLuCxL9zAtgjSPIggVbkcyc8,2932
|
|
19
19
|
managed_deepagents/_loopback.py,sha256=hQ1oNi77XpdUjzZURSBRoMvJ1mGCs-STobfBftGmXuE,2409
|
|
20
20
|
managed_deepagents/_managed_middleware.py,sha256=cfInVHTVjWoy_DBoFlnslfrDf2_n6llGnTGasta4AIo,10295
|
|
21
21
|
managed_deepagents/_managed_tools.py,sha256=KsFDULbv5fv0RY3Nj0zbv6z0Y80_o5YazhqeiQ9PnPk,9105
|
|
22
22
|
managed_deepagents/_memory_instructions.py,sha256=lyxKfNuXrWih574gmy3NHhIq_hIpJIM5zl3P8V69mUs,6678
|
|
23
|
-
managed_deepagents/_validated_token.py,sha256=
|
|
23
|
+
managed_deepagents/_validated_token.py,sha256=BY-66bgAOxhhRS3tfkDWVVU2l9HFHAuYXXCKV1pZ-nE,17232
|
|
24
24
|
managed_deepagents/define_deep_agent.py,sha256=17VfiiBINyhlqlATHrlJRPihKVlBsDGDP8K4-fxjxU8,5611
|
|
25
25
|
managed_deepagents/define_memory.py,sha256=n7Ya20dWGvwbZOkPIXoa68nTnJie8tpKEkRwfJQt_fU,5036
|
|
26
26
|
managed_deepagents/namespaces.py,sha256=GS76G19-V5Svfpbca-9xhQfJ6vel52jcJyfj6loLt_Y,4199
|
|
@@ -28,7 +28,7 @@ managed_deepagents/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
|
28
28
|
managed_deepagents/runtime.py,sha256=B4iKTJZD0zXx_MZ09pqQFOkVo07tqJDT3qvOBr-0iOk,65782
|
|
29
29
|
managed_deepagents/sandbox.py,sha256=xlpcWa6CoVX6GKip2nK-0Lw-HBCoFGFYm0r4x9eYwcY,2530
|
|
30
30
|
managed_deepagents/schedules.py,sha256=MtTQN4tlm1NizFDCjZZv_huGfbQx-dj9WP1dIBybCug,5237
|
|
31
|
-
managed_deepagents/_binaries/mda.exe,sha256=
|
|
31
|
+
managed_deepagents/_binaries/mda.exe,sha256=4V3cKtTKLxZ5XptKKAuUWjbcMlOB2fznFXLcQToy-gY,3904512
|
|
32
32
|
managed_deepagents/_channels/__init__.py,sha256=Z6eXmzaLxG09DSyJoY_CX34axcsBo9gSJ0G7pRm2D6M,1216
|
|
33
33
|
managed_deepagents/_channels/assistant_text.py,sha256=f-Z3J3PlQFXZHztgBxlRoqB2LigU1Hj1YpwoXBMTR18,2171
|
|
34
34
|
managed_deepagents/_channels/binding.py,sha256=6vAKbWpg-eyLErJ0SsozH4mZc50hA1NhquM63mVmWDQ,3423
|
|
@@ -65,13 +65,13 @@ managed_deepagents/_memory/mounts.py,sha256=b2KtaTX3apTkmoqQxG2ENtkO86avSt1Nvrv3
|
|
|
65
65
|
managed_deepagents/_memory/paths.py,sha256=gHI-9KyawUv1ftX1K0kjaBbM4IYLeP7S-_WCaS2gVBM,353
|
|
66
66
|
managed_deepagents/_memory/slices.py,sha256=ljL78ECmDZ27xc3ajzkLliOfUln_bNr-d1ycC1wlS38,3559
|
|
67
67
|
managed_deepagents/_memory/types.py,sha256=scSk6mH0k2OC59wzUCa67szvXylSjWDrfzWWRIU9tZA,4336
|
|
68
|
-
managed_deepagents/identity/__init__.py,sha256=
|
|
68
|
+
managed_deepagents/identity/__init__.py,sha256=Slm-oEqKxbaZEQsMqHfD3LbG5M4vH2lKUmralVPB_Zs,16137
|
|
69
69
|
managed_deepagents/identity/claims.py,sha256=prby7r_8Lww3MmoBm8PX6PsSGE3GwSHkr8mVIz_08nU,1180
|
|
70
70
|
managed_deepagents/identity/options.py,sha256=x_yMbXEFR7zXyehEjDHG2qjAlukXjrRBcQLcM6IndLM,2550
|
|
71
71
|
managed_deepagents/identity/supabase.py,sha256=8uobl3WCrQL_ieSXG8KTLf1th7Qjim9liZT50HeaJE0,6026
|
|
72
|
-
managed_deepagents-0.6.2.
|
|
73
|
-
managed_deepagents-0.6.2.
|
|
74
|
-
managed_deepagents-0.6.2.
|
|
75
|
-
managed_deepagents-0.6.2.
|
|
76
|
-
managed_deepagents-0.6.2.
|
|
77
|
-
managed_deepagents-0.6.2.
|
|
72
|
+
managed_deepagents-0.6.2.dev45.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
|
|
73
|
+
managed_deepagents-0.6.2.dev45.dist-info/METADATA,sha256=79n2x0_csFlDwyCA9y95PRNCCbajRUOhAqTyPe5iOjI,13718
|
|
74
|
+
managed_deepagents-0.6.2.dev45.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
|
|
75
|
+
managed_deepagents-0.6.2.dev45.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
|
|
76
|
+
managed_deepagents-0.6.2.dev45.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
|
|
77
|
+
managed_deepagents-0.6.2.dev45.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{managed_deepagents-0.6.2.dev44.dist-info → managed_deepagents-0.6.2.dev45.dist-info}/top_level.txt
RENAMED
|
File without changes
|