51 lines
1.3 KiB
Markdown
51 lines
1.3 KiB
Markdown
# COPY_V1_CONSOLIDATION.md
|
|
|
|
## Task lifecycle (copy v1)
|
|
|
|
`POST /api/files/copy`:
|
|
1. Request wordt gevalideerd.
|
|
2. Bij geldige input wordt direct een task aangemaakt met status `queued`.
|
|
3. Een achtergrond-runner zet de task op `running` en vult progress (`done_bytes`, `total_bytes`).
|
|
4. Eindstatus:
|
|
- `completed` bij succesvolle file copy
|
|
- `failed` bij runtime I/O fout (`error_code = io_error`)
|
|
|
|
## Validatiefouten vs runtime-fouten
|
|
|
|
Validatiefouten (voor task-creatie):
|
|
- `invalid_request`
|
|
- `path_traversal_detected`
|
|
- `path_outside_whitelist`
|
|
- `invalid_root_alias`
|
|
- `path_not_found`
|
|
- `type_conflict`
|
|
- `already_exists`
|
|
|
|
Gedrag:
|
|
- request faalt direct met error response
|
|
- er wordt geen task aangemaakt
|
|
|
|
Runtime-fouten (na task-creatie):
|
|
- `io_error`
|
|
|
|
Gedrag:
|
|
- request zelf retourneert `202` met `task_id`
|
|
- task gaat naar `failed`
|
|
- foutdetails verschijnen via `GET /api/tasks/{task_id}`
|
|
|
|
## Copy metadata in v1 (`copy_file(...)`)
|
|
|
|
V1 kopieert:
|
|
- file-inhoud (byte stream)
|
|
- basic filesystem metadata via `copystat` (mtime/atime/mode waar ondersteund)
|
|
|
|
V1 doet niet expliciet:
|
|
- ownership/ACL normalisatie
|
|
- extended attributes beleid
|
|
|
|
## Destination-semantiek (expliciet)
|
|
|
|
`destination` blijft in v1 altijd het volledige doelpad.
|
|
- Geen impliciete "copy into existing directory" interpretatie.
|
|
- Als destination al bestaat: `already_exists`.
|