Expand description
Confined server file destinations shared by result sinks and blob verbs.
Constants§
- EXPORT_
ROOT_ ENV - Environment override for the allowed
save_toexport root. - IMPORT_
ROOT_ ENV - Environment override for the confined server import directory.
Functions§
- confined_
file_ roots - Both file verbs require disjoint canonical roots at the time of the call.
- export_
root - Resolve (and create) the allowed export root for
save_todestinations. Defaults to~/.khive/exports; overridable viaKHIVE_SAVE_TO_ROOT. - import_
root - Resolve (and create) the import root, defaulting to
~/.khive/imports. - open_
import - Open the validated source and recheck the opened object’s type.
- resolve_
destination - validate_
destination - Validate a client-supplied
save_topath against the allowed exportrootand return the canonicalized destination. Rejects..traversal, a resolved parent outsideroot, and an existing symlink at the destination. Seecrates/khive-mcp/docs/save-sink.md. - validate_
import - Validate an existing import file without accepting symlinks within the root.