Skip to main content

Module paths

Module paths 

Source
Expand description

Profile-root resolution + name validation.

Root: $XDG_DATA_HOME/afhttp/profiles/ (or $HOME/.local/share/afhttp/profiles/). Persistent profiles are scoped by backend family under <root>/<backend>/<name>. Name validation rejects anything that would escape the root or break filesystem traversal.

Constants§

KNOWN_BACKENDS

Functions§

default_root
Resolve the default profile root.
ensure_backend_dir
ensure_no_filesystem_collision
Ensure that <root>/<name> either does not exist or is already a directory. Rejects the case where a regular file or symlink occupies the slot — afhttp host --profile foo should not silently start over a non-directory entry the user (or another tool) put there.
join_root_backend_name
join_root_name
Join the root + name into a concrete profile directory path. Performs structural validation only; callers that touch the filesystem should also run ensure_no_filesystem_collision.
validate_backend_key
validate_name
Validate a profile name. Allowed: ASCII alphanumerics plus -, _, . (but never starting with .), max 64 chars. Rejects Windows reserved device names so a profile created on Linux cannot become a poisoned path when the directory is read on Windows.