Expand description
Profile-root resolution + name validation.
Root: $XDG_DATA_HOME/afhttp/profiles/ (or $HOME/.local/share/afhttp/profiles/).
Name validation rejects anything that would escape the root or break
filesystem traversal.
Functionsยง
- default_
root - Resolve the default profile root.
- 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 fooshould not silently start over a non-directory entry the user (or another tool) put there. - 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_
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.