Files
DECNET/decnet/web/router/deckies/__init__.py
anti 0bc4b05c73 feat(deckies): generic file drops on fleet + MazeNET deckies
Extracts the docker-exec-with-base64-stdin pattern out of canary/planter
and orchestrator/drivers/ssh into a shared decnet.decky_io package.
Both consumers now delegate; the canary planter test still proves the
contract end-to-end.

Adds POST/DELETE /api/v1/deckies/files for arbitrary file drops.
Container resolution is shared with the canary path: topology_id absent
means fleet (<name>-ssh), present routes through resolve_decky_container
which picks <name>-ssh when the topology decky exposes ssh, else the
topology base container decnet_t_<id8>_<name>.

Path validation rejects relative paths and '..' traversal at the request
model layer.  Bad base64 → 400; unknown topology → 404; decky not in
topology → 422; docker exec failure → 409.
2026-04-28 22:43:34 -04:00

22 lines
575 B
Python

"""Cross-cutting decky operation endpoints.
These routes apply to both fleet and MazeNET (topology) deckies; the
MazeNET case is selected by passing ``topology_id`` in the request body.
Compare with:
* :mod:`decnet.web.router.fleet` — fleet-only CRUD (deploy, mutate,
list).
* :mod:`decnet.web.router.topology` — topology-only CRUD.
"""
from __future__ import annotations
from fastapi import APIRouter
from .api_file_drop import router as file_drop_router
deckies_router = APIRouter()
deckies_router.include_router(file_drop_router)
__all__ = ["deckies_router"]