API|CLI: Added argument 'flake_name' to all CLI and API endpoints. Tests missing.
This commit is contained in:
@@ -17,11 +17,12 @@ from clan_cli.webui.api_outputs import (
|
||||
)
|
||||
|
||||
from ...async_cmd import run
|
||||
from ...flake import create
|
||||
from ...flakes import create
|
||||
from ...nix import nix_command, nix_flake_show
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
# TODO: Check for directory traversal
|
||||
async def get_attrs(url: AnyUrl | Path) -> list[str]:
|
||||
cmd = nix_flake_show(url)
|
||||
@@ -42,6 +43,7 @@ async def get_attrs(url: AnyUrl | Path) -> list[str]:
|
||||
)
|
||||
return flake_attrs
|
||||
|
||||
|
||||
# TODO: Check for directory traversal
|
||||
@router.get("/api/flake/attrs")
|
||||
async def inspect_flake_attrs(url: AnyUrl | Path) -> FlakeAttrResponse:
|
||||
@@ -74,7 +76,6 @@ async def inspect_flake(
|
||||
return FlakeResponse(content=content, actions=actions)
|
||||
|
||||
|
||||
|
||||
@router.post("/api/flake/create", status_code=status.HTTP_201_CREATED)
|
||||
async def create_flake(
|
||||
args: Annotated[FlakeCreateInput, Body()],
|
||||
|
||||
Reference in New Issue
Block a user