meshagent-api 0.57.0__tar.gz → 0.57.1__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.
- {meshagent_api-0.57.0/meshagent_api.egg-info → meshagent_api-0.57.1}/PKG-INFO +1 -1
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/files.py +7 -1
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/files_test.py +31 -2
- meshagent_api-0.57.1/meshagent/api/version.py +1 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1/meshagent_api.egg-info}/PKG-INFO +1 -1
- meshagent_api-0.57.0/meshagent/api/version.py +0 -1
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/LICENSE +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/MANIFEST.in +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/README.md +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/__init__.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/agent_content.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/aiohttp_redaction.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/chan.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/client.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/client_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/crdt.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/dataset_schema.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/entrypoint.js +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/error_codes.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/file_permissions.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/helpers.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/http.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/image_runtime.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/keys.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/llm_router_config.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/managed_agents.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/managed_agents_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/messaging.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/messaging_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/mime_types.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/mime_types_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/oauth.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/oauth_branding.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/oauth_scopes.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/oauth_scopes_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/participant.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/participant_token.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/participant_token_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/port_forward.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/port_forward_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/protocol.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/protocol_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/py.typed +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/reasoning_schema.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/registry_auth.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/room_ports.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/room_server_client.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/room_server_client_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/runtime.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/runtime_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/schema.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/schema_document.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/schema_document_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/schema_registry.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/schema_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/schema_util.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/service_spec_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/service_template_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/services.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/services_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/specs/service.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/sql.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/sql_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/sqlite_batch_integration_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/sqlite_replication_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/sqlite_transfer.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/sqlite_transfer_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/storage_connections.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/storage_connections_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/storage_policy_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/token_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/urls.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/webhooks.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/webhooks_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/websocket_protocol.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/websocket_protocol_test.py +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent_api.egg-info/SOURCES.txt +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent_api.egg-info/dependency_links.txt +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent_api.egg-info/requires.txt +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent_api.egg-info/top_level.txt +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/pyproject.toml +0 -0
- {meshagent_api-0.57.0 → meshagent_api-0.57.1}/setup.cfg +0 -0
|
@@ -261,12 +261,18 @@ class TargetFilesClient:
|
|
|
261
261
|
*,
|
|
262
262
|
content_type: str = "application/octet-stream",
|
|
263
263
|
overwrite: bool = True,
|
|
264
|
+
if_match: str | None = None,
|
|
264
265
|
) -> None:
|
|
266
|
+
if if_match is not None and not if_match.strip():
|
|
267
|
+
raise ValueError("If-Match ETag must not be empty")
|
|
265
268
|
client = self._files._client
|
|
269
|
+
headers = {**client._get_headers(), "Content-Type": content_type}
|
|
270
|
+
if if_match is not None:
|
|
271
|
+
headers["If-Match"] = if_match
|
|
266
272
|
async with client._session.put(
|
|
267
273
|
await self._files._url(self.target, path),
|
|
268
274
|
params={"overwrite": str(overwrite).lower()},
|
|
269
|
-
headers=
|
|
275
|
+
headers=headers,
|
|
270
276
|
data=data,
|
|
271
277
|
allow_redirects=False,
|
|
272
278
|
) as response:
|
|
@@ -19,6 +19,7 @@ class FilesApiFixture:
|
|
|
19
19
|
calls: list[tuple[str, str, dict[str, str], str]] = field(default_factory=list)
|
|
20
20
|
blobs: dict[str, bytes] = field(default_factory=dict)
|
|
21
21
|
actions: list[dict] = field(default_factory=list)
|
|
22
|
+
etags: dict[str, int] = field(default_factory=dict)
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
@pytest_asyncio.fixture
|
|
@@ -73,10 +74,23 @@ async def files_api() -> AsyncIterator[FilesApiFixture]:
|
|
|
73
74
|
state.actions.append(await request.json())
|
|
74
75
|
return web.json_response({})
|
|
75
76
|
if request.method == "PUT":
|
|
77
|
+
current = state.etags.get(request.path)
|
|
78
|
+
if (
|
|
79
|
+
request.headers.get("If-Match") is not None
|
|
80
|
+
and request.headers["If-Match"] != f'"v{current}"'
|
|
81
|
+
):
|
|
82
|
+
return web.Response(status=412)
|
|
83
|
+
if (
|
|
84
|
+
not request.query.get("overwrite", "true") == "true"
|
|
85
|
+
and current is not None
|
|
86
|
+
):
|
|
87
|
+
return web.Response(status=409)
|
|
76
88
|
state.blobs[request.path] = await request.read()
|
|
89
|
+
state.etags[request.path] = (current or 0) + 1
|
|
77
90
|
return web.Response(status=204)
|
|
78
91
|
if request.method == "DELETE":
|
|
79
92
|
state.blobs.pop(request.path, None)
|
|
93
|
+
state.etags.pop(request.path, None)
|
|
80
94
|
return web.Response(status=204)
|
|
81
95
|
data = state.blobs.get(request.path)
|
|
82
96
|
if data is None:
|
|
@@ -84,7 +98,7 @@ async def files_api() -> AsyncIterator[FilesApiFixture]:
|
|
|
84
98
|
return web.Response(
|
|
85
99
|
body=data,
|
|
86
100
|
content_type="application/octet-stream",
|
|
87
|
-
headers={"ETag": '"
|
|
101
|
+
headers={"ETag": f'"v{state.etags[request.path]}"'},
|
|
88
102
|
)
|
|
89
103
|
|
|
90
104
|
app.router.add_get("/config", config)
|
|
@@ -126,7 +140,7 @@ async def test_room_agent_streams_share_discovery_session_and_current_credential
|
|
|
126
140
|
)
|
|
127
141
|
metadata = await room.stat(path)
|
|
128
142
|
assert metadata.size == len(b"\x00\xfffirstsecond")
|
|
129
|
-
assert metadata.etag == '"
|
|
143
|
+
assert metadata.etag == '"v1"'
|
|
130
144
|
assert await agent.exists(path)
|
|
131
145
|
assert not await agent.exists("missing")
|
|
132
146
|
client.token = "rotated-token"
|
|
@@ -233,3 +247,18 @@ async def test_invalid_paths_fail_before_discovery(files_api):
|
|
|
233
247
|
def test_target_cannot_escape_namespace(name):
|
|
234
248
|
with pytest.raises(ValidationError):
|
|
235
249
|
FilesTarget(project_id="p1", kind="agent", name=name)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
@pytest.mark.asyncio
|
|
253
|
+
async def test_conditional_upload_rejects_stale_etag(files_api):
|
|
254
|
+
async with Meshagent(base_url=files_api.base_url, token="test-token") as client:
|
|
255
|
+
files = client.files.for_room(project_id="p", room_name="r")
|
|
256
|
+
await files.upload("workbook", b"first", overwrite=False)
|
|
257
|
+
etag = (await files.stat("workbook")).etag
|
|
258
|
+
assert etag == '"v1"'
|
|
259
|
+
await files.upload("workbook", b"second", if_match=etag)
|
|
260
|
+
with pytest.raises(RoomException):
|
|
261
|
+
await files.upload("workbook", b"stale", if_match=etag)
|
|
262
|
+
assert await files.download("workbook") == b"second"
|
|
263
|
+
with pytest.raises(ValueError):
|
|
264
|
+
await files.upload("workbook", b"invalid", if_match=" ")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.57.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.57.0"
|
|
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
|
|
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
|
{meshagent_api-0.57.0 → meshagent_api-0.57.1}/meshagent/api/sqlite_batch_integration_test.py
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
|